Error 037: Invalid value in plot bar 1 Chart

Posted By: Comper

Error 037: Invalid value in plot bar 1 Chart - 10/12/16 23:26

Hi,

I'm trying to plot a simple RSI line and no matter which currency I'm using, I'm always getting the 037 error.
I downloaded tick data from FXCM since 2012, tried different currencies, setting bar period, time, etc.

Error 037: Invalid value in plot "RSI" bar 1

function run() {

set(PLOTNOW);
vars r = series(RSI(priceClose,11));
plot("RSI", r, LINE, GREEN );

}

I'm really not sure how to fix this, there are a few other related topics on web, however I couldn't fix it.
I'd appreciate your feedback.
Posted By: boatman

Re: Error 037: Invalid value in plot bar 1 Chart - 10/13/16 10:55

There's probably a zero or null value in the denominator of the RSI calculation. Try this:

Code:
function run() 
{	
    set(PLOTNOW);
    vars r = series(RSI(series(priceClose()),11));
    plot("RSI", r, NEW, GREEN );
}



You can also make a separate series out of the closing prices, for example:
Code:
...
vars Close = series(priceClose());
vars rsi = series(RSI(Close, 11));
...

Posted By: Comper

Re: Error 037: Invalid value in plot bar 1 Chart - 10/14/16 11:10

The first version proposed works.

Thanks!
© 2024 lite-C Forums