Hi,
how to a make it so my algorithms only trade for certain hours a day. I want to keep the codes running but only trade between for example, 9am -5 pm. is this done within the code, or within the pro real time software.
thanks
There you go (just add TradingAllowed to your conditions to enter a trade):
TradingAllowed = (Time >= 090000) AND (Time <= 173000) //9am to 5pm
JSParticipant
Senior
Hi @ACACAC
You say “I want to keep the codes running” but do you also want your positions to remain open outside of your trading hours?
If you also want to close your positions outside your trading hours, you can use:
DefParam FlatBefore=090000
DefParam FlatAfter=170000
Hi everybody,
another way I’m using to trade in certain period is adding to the IF condition this:
and (hour=>H1 and hour<=H2)
In this way you can put
H1 and
H2 as variables to be checked to find the best hours to trade.