I see the problem now.
TimesTraded=0
FOR i=0 to 10 do
if tradeprice(i) = myLong then
TimesTraded = TimesTraded +1
endif
next
where myLong is a number/support (e.g. 13010 on nas). All I am trying to do is if this level was traded by the program already. Then, in my limit order I try to do:
IF NOT LongOnMarket AND TIMEOPERATE AND LongCondition and TimesTraded < 3 THEN
SET STOP LOSS Sl
SET TARGET PROFIT ProfitLimit
myBuyPrice = myLong
ENDIF
How can I fix the first part to avoid the system getting stopped because of the error mentioned in the first post? Any idea? Thanks