I have a 1 min chart of FB as data1 and a daily chart of FB as data2.
Something is wrong with this code since it is not returning the ATR of data2 :I m being stopped a few cents below my buy while the ATR is 2,2. Not sure what s wrong. Thanks for the help in advance !
Code: Select all
var:
atr(0,data2);
atr=average(truerange, 14) of data2; // value ATR
if C>C[4] then buy 100 shares next bar at market;
setstoploss(atr);