Watchlist

Hi, I am not sure why this code does not work for ASX:COL. It seems to work for stocks with more than 200 days history fine.

This stock has less than 200 days history and it is bringing back a “True” response in my watchlist for some reason due to it not having more than 200 days information. In my view it should return False / 0 response as there are less than 200 days history. Can someone please help me with this as I have tried everything to get it to work. I have screen shot my settings below - please let me know what I am doing wrong.

 

V1 = (MA(BARS=3, STYLE=Exponential) <= MA(BARS=7, STYLE=Exponential) and (CLOSE() < MA(BARS=200, STYLE=Simple)))*1;

if(BARCOUNT()>=200, V1,0)*1

Thanks,

Karen

Hi Karen,

I’m not sure of the function of the *1 at the end of each line? I removed it, and also adjusted some of the brackets in the V1 variable, and the script is returning the expected result for COL now:

V1 = MA(BARS=3, STYLE=Exponential) <= MA(BARS=7, STYLE=Exponential) and CLOSE() < MA(BARS=200) ; IF(BARCOUNT() >= 200,V1,0)

Chart & Watchlist Example:

Ex10

Thanks Matthew, I will try that.

Kind regards,
Karen