Below is snapshot what I have created : Timerange = TimeNum() > 091500 AND TimeNum() < 094500 ; Timerange1 = TimeNum() > 133000 AND TimeNum() < 143000 ; Timeout = TimeNum() > 151500; Range = LLV(L,5) ; Range2 = HHV(H,5) ; X = one of the resistance level Y = one of the support level Trend = Timerange AND Ref(Range,-1) > X ; Trend2 = (Timerange AND Ref(Range,-1) > X) and (Timerange1 and Ref(Range2,-1) < Y) ; Buy = Trend ; Sell = Timeout OR Trend2; Short = Trend2 ; Cover = Timeout ; Buy = ExRem(Buy,Sell) ; Short = ExRem(short,Cover) ; Sell = ExRem(Sell,Buy) ; Cover = ExRem(Cover,Short) ; The issue is that Trend 2 is only reading "Timerange" array and is not reading "Timerange1" array.
AFL is "Greek" to me but why are you referencing Trend characteristics again in Trend2 when breaking support and resistance are two different events?
This is because.."Trend" is a buy indicator and Trend2 is for shorting only those stocks which were buy earlier.. so..my expression for short is that is stock was trading above x in "timerange" and later on in "timrange1" it came below Y then it should shortsell my stock. As it will shortsell...it will also square off my buy position.. Hope I'm able to make it clear..let me know your doubts
Just guessing here, have you tried......? Trend = Timerange AND Ref(Range,-1) > X ; Trend1 = Timerange1 AND Ref(Range2,-1) < Y ; Trend2 = Trend + Trend1 ;
No ..This is also not working... I think the issue is that system is getting confused while reading 2 timeranges.. I mean..whether it should read Timerange first and then Timerange1 or the other way round.. Can we tell system to read the timerange on current day only..it might be reading one "timerange1" from previous day and "Timerange" from current day..just a thought