Open Range Break Out Dax 5 / 15 min
Forums › ProRealTime English forum › ProOrder support › Open Range Break Out Dax 5 / 15 min
- This topic has 5 replies, 4 voices, and was last updated 4 years ago by Valiant747.
-
-
10/31/2019 at 12:28 AM #111721
Hi, I have on old code of a “Open Range Break Out Dax 5 / 15 min”, but it seems like its not working with the newer version of PRT. Can anyone help me re-write the code so it fits the “new” PRT?
10/31/2019 at 3:25 AM #111726>> Please update your country flag in your profile. Thank you 🙂 <<
10/31/2019 at 9:47 AM #11173110/31/2019 at 11:12 AM #111739Hi, this is how the code looks like. And I cant get it to work on the “new” PRT platform. Can anyone please help me re-write it so it works on “new” PRT?
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879// Open Range Breakout DAX 5/15M// code-parameterDEFPARAM FlatAfter = 173000// window high/low calculationONCE StartTime = 90000ONCE EndTime = 93000// trading windowONCE BuyTime = 93000ONCE SellTime = 173000// money managementONCE Capital = 2000ONCE Risk = 0.01ONCE StopLoss = 10ONCE equity = Capital + StrategyProfitONCE maxrisk = round(equity*Risk)ONCE PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)// fixed position size//ONCE PositionSize = 1//signal linesignal = Tema[5](close)// calculate high/low and sl/tpIF Time >= StartTime AND Time <= EndTime THENIF TIME = StartTime THENDailyHigh = HighDailyLow = LowENDIFIF High > DailyHigh THENDailyHigh = HighENDIFIF Low < DailyLow THENDailyLow = LowENDIFsl = DailyHigh - DailyLowtp = slTradeCounterLong = 0TradeCounterShort = 0ENDIF// position managementIF Time >= BuyTime AND Time <= SellTime THEN// LongIF Not LONGONMARKET AND signal CROSSES OVER DailyHigh AND TradeCounterLong = 0 THEN// longIF (Time >= 93000 AND Time <= 113000) OR (Time >= 130000 AND Time <= 171500) THEN // no trading during lunchBUY PositionSize CONTRACT AT MARKETTradeCounterLong = TradeCounterLong + 1ENDIFENDIF// shortIF Not SHORTONMARKET AND signal CROSSES UNDER DailyLow AND close < DClose(1) AND TradeCounterShort = 0 THENIF Time >= 93000 AND Time <= 150000 THEN // short breakouts after 1500 are not profitableSELLSHORT PositionSize CONTRACT AT MARKETTradeCounterShort = TradeCounterShort + 1ENDIFENDIF// close positionsIF Time = SellTime THENIF LONGONMARKET THENSELL AT MARKETENDIFIF SHORTONMARKET AND Time = SellTime THENEXITSHORT AT MARKETENDIFENDIF// stops and targetsSET STOP LOSS slSET TARGET PROFIT tpENDIF10/31/2019 at 12:45 PM #111740Valiant747 – Please always use the ‘Insert PRT Code’ button when posting code in the forums to make it easier for others to read. I have tidied up your post for you 🙂
10/31/2019 at 2:40 PM #111744Hi Vonasi,
Ahh, thanks. I wasn’t aware of that button. I am rather new here. But thanks, I will do it in the future!
-
AuthorPosts