What is the correct way to enter Aussie trading hours? In GMT it should be 230000 to 050000 but that gives no trades as it appears to close before it opens.
000000 to 050000 works, but then I lose an hour at the start. 🤔
if time >=230000 or time < 050000 then
That’s what I started with. The optimization returns 0 trades. Changing 230000 to 000000 works.
Defparam flatbefore = 230000
Defparam flatafter = 050000
CTime = Time >= 230000 and Time < 050000
You are using AND where my code uses OR.
Alright alright alright, got it. Thanks!
Can I ask what timezone does pro real code time function use?
I am in Australia – and want to restrict orders during pre-market and post market in US Stocks. What code can I use to trade between 12.30 AM to 7 AM Australian time only.
thanks
Go Settings>Platform>Time Zones and Trading Hours and you’ll find all the various options.
I keep it on my local time then use time restrictions as an entry condition, eg
Tradetime = time >=143000 and time <210000
If Tradetime and (your conditions) then
buy 1 contract at market
endif
Just alter the times for whatever the Wall St hours are down under.
time >=143000 and time <210000
You’ve forgot the OR again Nonetheless … alright, alright, alright … I know you know really! 🙂
Yeah, but those are the GMT times for Wall St, just as an example, so it has to be AND … not sure which you’d have to use if you want NY hours in Oz ???
Actually, if it’s 12.30 AM to 7 AM then it will def be AND
Tradetime = time >=003000 and time <070000