--- In [email protected], "joe2dixon" <joe2di...@...> wrote: > > ang_60: > > Maybe if you try > > TrRng= ref( ATR(1),-1 ); > > It should then look for the True Range for the previous day. > > >
Hi Joe, thanks for taking the time to look into this matter, but I feel the problem pops up with the "TimeFrameExpand" command... the lines of code before are OK. As I'm not able to resolve it, I adopted a turnaround, adding two lines to the code of my previous message; After TrueRange_Daily = TimeFrameExpand (TrRng, inDaily); I added: LastBarofDay = ( DateNum()!= Ref(DateNum(),1) ); TrueRange_D = IIf (LastBarofDay, Ref(TrueRange_Daily, -1), TrueRange_Daily); This way the code works as I expected, although it's not satisfactory from a conceptual point of view: I'd wish to see some of the senior users of the list (not to mention TJ) would pop up and explain why the "TimeFrameExpand" has this behaviour(*), but evidently I'm the only one from some thousand users on these list to see a problem with this. (*) which happens on all last 5 minute bar of day EXCEPT the last bar of the last day in test, which from my point of view is even stranger..
