Page 1 of 1

'Not enough data' error not making sense!!??

Posted: Feb 18 2014
by kajkanjan
Hi all,

I have the below code. It works fine on a chart and plots as required on a low amount of bar showing e.g. 100 bars.
however, if I put this indicator into a watch list screener window, I need to 'Format Resolution (all instruments)' to a custom data range of 300+ bars back! Or else I get the 'Not Enough Data' error.

I specifically want to show the value of Plot 5 (the Overbought or Oversold text) against any stock I put in the watch list.

Am I missing something obvious!?!
Why does this indicator need so many bars back to give me a value in a Watchlist screen, when the calculations only need a few bars to calculate and it works fine on a chart????

thank you so much for any time and help,
Kindest Regards,
KJ

Code: Select all

inputs:
BollingerPrice( Close ),
TestHighPrice( High ),
TestLowPrice( Low ),
Length( 21 ),
NumDevsDn( 3 ),
RSIPrice (Close),
RSILen (14),
RSIOverbought(70),
RSIOversold(30),
PriceH( High ),
PriceL( Low ),
PriceC( Close ),
StochLength( 14 ),
SmoothingLength1( 3 ),
SmoothingLength2( 3 ),
SmoothingType( 1 ),
StoOverSold( 20 ),
StoOverBought( 80 ) ;



variables:
TopBollingerValue( 0 ) ,
BottomBollingerValue( 0 ),
RSIValue (0) ,
StochasticValue (0),
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;

TopBollingerValue = BollingerBand( BollingerPrice, Length, NumDevsDn ) ;
BottomBollingerValue= BollingerBand( BollingerPrice, Length, -NumDevsDn ) ;
RSIValue = RSI(RSIPRice,RSILen);
Value1 = Stochastic( PriceH, PriceL, PriceC, StochLength, SmoothingLength1, SmoothingLength2, SmoothingType, var0, var1, var2, var3 ) ;
StochasticValue = var3 ;

condition1 = TestHighPrice> TopBollingerValue ;
condition2 = TestLowPrice< BottomBollingerValue ;

Condition3 = RSIValue > RSIOverbought;
Condition4 = RSIValue < RSIOversold;

condition5 = StochasticValue > StoOverBought;
condition6 = StochasticValue < StoOverSold;



if condition1 and condition3 and condition5 then
begin
PlotPaintBar (high, low, open, close,"");
plot5("Overbought");
end
else
if condition2 and condition4 and condition6 then
begin
PlotPaintBar (high, low, open, close,"");
plot5("Oversold");
end
else
plot5("");

Re: 'Not enough data' error not making sense!!??

Posted: Feb 19 2014
by Henry MultiСharts
Hello kajkanjan,

The indicator code you have provided works the same way on 100 bars in the scanner window and in the chart. There are no error messages generated on our end.
What exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About)
Please attach the workspace you are using for replicating this behavior.

Re: 'Not enough data' error not making sense!!??

Posted: Feb 19 2014
by kajkanjan
Hi Henry,

Below is a screenshot of the error on a stock code GEM-ASX.
You can see in the weekly chart (right) the code is working fine and highlighting blue etc. with minimal data bars.
however, if you look in the watch list you can see that GEM-ASX is giving the error.
I have the watchlist looking 300 bars back.
The code works on most stocks when I force 300 bars back, the issue is that some stocks don't have 300 weekly bars of data as they are new.

regardless, this code should be working with e.g. 60 bars back. If I set it to 60 bars back (or auto) in the watchlist, every single stock will show the "Not enough data error"

Re: 'Not enough data' error not making sense!!??

Posted: Feb 19 2014
by kajkanjan
The workspace attached.

Multicharts64 Version 8.8 Release (Build 8593).

eSignal is being used to power the data feed.

Re: 'Not enough data' error not making sense!!??

Posted: Feb 20 2014
by Henry MultiСharts
kajkanjan, we were unable to replicate it on our end. Please come to our live chat Monday-Friday 6:30 am - 3 pm EST to demonstrate it remotely.

Re: 'Not enough data' error not making sense!!??

Posted: Feb 20 2014
by kajkanjan
Hi Henry,

I will try use the live chat. The AUS time difference in a pain though, so is it okay I ask just one more question:

I edited the code to include a new plot at the bottom of the existing code:

Code: Select all

plot6(MaxBarsBack, "MaxBarsBack");
So now that I can see this data being plotted, this is where it makes no sense.
If I run the code on weekly price chart, it is giving a value of "21" for the MaxBarsBack plot - which makes sense as the largest value is the 21 numeric value used for the Bollinger Band Length variable.

*But* - if I then run the exact same indicator in the watchlist screen (I leave the "Format Resolution" to be automatic) the MaxBarsBack plot is showing a value of 200!!!??
Why is this???

So the errors I am getting with the "Not Enough Data" are coming in on stocks that don't have 200+ bars of weekly history - of which there are a few.

Out of interest, if I force the "Format Resolution" in the watchlist to be 100 [weekly] bars back, the "Not enough data" error comes on all stocks in the watchlist - i.e. it seems in the watchlist view it is saying the code/indicator must have a min 200 bars before it can calculate.... ???

So the question, I suppose is: why is the chart version of the indicator sensibly using only 21 bars back for the calculation (as that is all that is required) but the watchlist implementation is forcing 200 bars back!?


Is there some setting I am missing?
Is there something in the code I need to add?

Thanks
KJ

Re: 'Not enough data' error not making sense!!??

Posted: Feb 21 2014
by Henry MultiСharts
So the question, I suppose is: why is the chart version of the indicator sensibly using only 21 bars back for the calculation (as that is all that is required) but the watchlist implementation is forcing 200 bars back!?
kajkanjan, there is no setting and nothing that must be added to the code you have provided above. It works ok on our end and does not require more than 21 bars for calculation (both on the chart and in the scanner).

If you are using a different code - please provide the exact code you are using.
If you have this behavior with the exact code you have provided above - please come to our live chat to demonstrate this behavior.

Re: 'Not enough data' error not making sense!!??  [SOLVED]

Posted: Feb 24 2014
by kajkanjan
Figured it out!!

Just posting in case anybody else gets caught.

At some stage I must have edited the settings of the indicator in the PowerLanguage Editor! (I don't know how as I didn't even know these settings existed there!)
But if I open my code and go File -> Properties... then go to the Properties tab, in there you can set the Max number of bars study will reference.
My settings were manually set to 200.
I set it to Auto-detect. closed and re-opened MultiCharts. Everything working!

Cheers
KJ