Forums › ProRealTime English forum › ProOrder support › Strategy DayOpen Straddle for DAX › Reply To: Strategy DayOpen Straddle for DAX
11/07/2018 at 3:27 PM
#84334
Still working on it.. A problem though,
I want to skip the first 2 weeks every year since those two are bad for trading.
Does PRT support week-numbers perhaps?
I want to make it optional to exclude those days.
How should I code this most efficiently?
If you add the code below, and add trading=0 to the buy criteria, it doesn’t work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
//skip first two weeks of the year (weeknumber 1 and 2) IF YEAR=2015 AND MONTH=1 AND (DAY>=1 AND DAY<=10) THEN TRADING = 1 ELSE TRADING = 0 ENDIF IF YEAR=2016 AND MONTH=1 AND (DAY>=1 AND DAY<=16) THEN TRADING = 1 ELSE TRADING = 0 ENDIF IF YEAR=2017 AND MONTH=1 AND (DAY>=1 AND DAY<=14) THEN TRADING = 1 ELSE TRADING = 0 ENDIF IF YEAR=2018 AND MONTH=1 AND (DAY>=1 AND DAY<=13) THEN TRADING = 1 ELSE TRADING = 0 ENDIF IF YEAR=2019 AND MONTH=1 AND (DAY>=1 AND DAY<=12) THEN TRADING = 1 ELSE TRADING = 0 ENDIF |