Question on core.crossesOver

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Question on core.crossesOver

Postby peternz » Tue Aug 30, 2011 9:57 pm


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
peternz
 
Posts: 26
Joined: Thu Jun 30, 2011 6:07 am

Re: Question on core.crossesOver

Postby sunshine » Wed Aug 31, 2011 3:08 am

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.
sunshine
 

Thank you. for explains Helper.lua doing.

Postby Saito_N » Tue Oct 03, 2017 4:50 am

Thank you. sunshine for explains Helper.lua doing.
User avatar
Saito_N
 
Posts: 9
Joined: Tue Mar 21, 2017 3:13 pm


Return to Discussions

Who is online

Users browsing this forum: No registered users and 12 guests