Page 1 of 1

Question on core.crossesOver

PostPosted: Tue Aug 30, 2011 9:57 pm
by peternz

Hi,
I'm using the function core.crossesOver(CCI.DATA, OS, period) to signal when cci crosses over an oversold level. Lets say I'm on a 1hour time frame:

Will this function give a signal if a crossover occurs at any time during the 1 hour candle even if when the candle closes cci value may be below the oversold level and historically show no crossover?


Many Thanks
peternz

Re: Question on core.crossesOver

PostPosted: Wed Aug 31, 2011 3:08 am
by sunshine
The function core.crossesOver should be called in the Update function. So how it will work depends on how the Update function is called.

If you use core.crossesOver in the Update function in your indicator/strategy, then the cross condition will be checked every time when a new bid or ask price appears. Note that you must call cci:update before calling core.crossesOver.

1) in case the strategy uses the ExtSubscribe function of helper.lua to subscribe to tick history, then it will be checked every time when a new tick is received.
2) in case the strategy uses the ExtSubscribe function of helper.lua to subscribe to bar history, then it will be checked every time when a first tick after the most recently closed candle is received.

So, if you check the condition on each tick, then you'll get a signal at once after crossing.
If you check the condition once per hour, you'll get a signal after the period is completed in case there is crossing in this period.

I hope this will help.

Thank you. for explains Helper.lua doing.

PostPosted: Tue Oct 03, 2017 4:50 am
by Saito_N
Thank you. sunshine for explains Helper.lua doing.