[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Time Frames



PureBytes Links

Trading Reference Links

> Easier might be something like this:
> if FracPortion(CurrentBar)=0 then C1 = close[1];

That test is ALWAYS true.  CurrentBar is an integral value so its 
FracPortion is always zero.

Maybe you meant something like

if FracPortion(CurrentBar / N)=0 then C1 = close[1];

...which is similar to the Modulo solution I proposed, except using 
CurrentBar instead of Time.  Since the original poster used the 
example of something that was true at 30 mins past the hour, I think 
Time is a better value to test.  If you really do want every other 
bar, then you could use Mod(CurrentBar, 2) = 0.  But note that this 
will NOT always be at 30 mins past the hour, depending on gaps in 
your data, odd number of bars per day, etc.

(BTW I goofed in my original post.  The function is named "Mod" in 
EL, not "Modulo".)

Gary