Multiple trading times per day
Forums › ProRealTime English forum › ProOrder support › Multiple trading times per day
- This topic has 5 replies, 4 voices, and was last updated 6 years ago by
GraHal.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
04/11/2019 at 3:28 PM #96114
Hi,
I would like to setup several trading times per day.
With the simplified creation you can only set up one time to not trade before and one time to not trade after (ie. trade between 6am – 4pm)
However, I would like to have no trading from midnight until 6am. Then trade from 6am – 11am. No trading between 11am-12pm. And then trading between 12pm – 5:30pm.
I tried to create a code but it doesn’t work. So there must be a mistake.
Any help very much appreciated.
12345678910111213141516171819// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Cancel all pending orders and close all positions at the "FLATAFTER" timeDEFPARAM FLATAFTER = 173000// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryBeforeTime = 060000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 11000timeEnterAfter = time < noEntryAfterTimenoEntryBeforeTime2 = 120000timeEnterBefore2 = time >= noEntryBeforeTime2// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime2 = 173000timeEnterAfter2 = time < noEntryAfterTime204/11/2019 at 3:29 PM #96115line 11 misses a final “0”
04/11/2019 at 3:37 PM #96116There you go:
123456789IF time >= 090000 AND time <= 110000 THEN //trade from 9 to 11TradingON = 1ELSIF time >= 130500 AND time <= 150000 THEN //trade from 13:05 to 15TradingON = 1ELSIF time >= 163000 AND time <= 190000 THEN //trade from 16:30 to 19TradingON = 1ELSETradingON = 0 //do not trade outside above time rangesENDIFAdd TradingON to your conditions to enter a trade.
04/12/2019 at 12:30 AM #9619309/26/2019 at 6:00 PM #10862509/26/2019 at 6:12 PM #108626Link to above Roberto code added as Log 173 here …
1 user thanked author for this post.
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on
Similar topics: