Is there a good way in a strategy to know when the strategy just started
for the day?
For example, if I have a peak finding strategy, it will only kick in a buy
at the peak, but at the beginning of the trading session, the peak already
passed and the price is already trending so I should recognize the upward
trend and place the buy right at open.
I tried using isDisabled as a flag, but I cant see when its turned off,
since onBookSnapshot is not called, so it only works for the first day.
I general I would like to use something like this which resets for the next
day:
if (trading_just_started) {
// Run special start-up version of strategy
trading_just_started = false;
} else {
// Run the regular strategy
}
--
You received this message because you are subscribed to the Google Groups
"JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/groups/opt_out.