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?
>> Please update your country flag in your profile. Thank you 🙂 <<
Topic moved to automated trading forum.
Please post the code of your automatic trading strategy in order to help you.
Hi, 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?
// Open Range Breakout DAX 5/15M
// code-parameter
DEFPARAM FlatAfter = 173000
// window high/low calculation
ONCE StartTime = 90000
ONCE EndTime = 93000
// trading window
ONCE BuyTime = 93000
ONCE SellTime = 173000
// money management
ONCE Capital = 2000
ONCE Risk = 0.01
ONCE StopLoss = 10
ONCE equity = Capital + StrategyProfit
ONCE maxrisk = round(equity*Risk)
ONCE PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
// fixed position size
//ONCE PositionSize = 1
//signal line
signal = Tema[5](close)
// calculate high/low and sl/tp
IF Time >= StartTime AND Time <= EndTime THEN
IF TIME = StartTime THEN
DailyHigh = High
DailyLow = Low
ENDIF
IF High > DailyHigh THEN
DailyHigh = High
ENDIF
IF Low < DailyLow THEN
DailyLow = Low
ENDIF
sl = DailyHigh - DailyLow
tp = sl
TradeCounterLong = 0
TradeCounterShort = 0
ENDIF
// position management
IF Time >= BuyTime AND Time <= SellTime THEN
// Long
IF Not LONGONMARKET AND signal CROSSES OVER DailyHigh AND TradeCounterLong = 0 THEN
// long
IF (Time >= 93000 AND Time <= 113000) OR (Time >= 130000 AND Time <= 171500) THEN // no trading during lunch
BUY PositionSize CONTRACT AT MARKET
TradeCounterLong = TradeCounterLong + 1
ENDIF
ENDIF
// short
IF Not SHORTONMARKET AND signal CROSSES UNDER DailyLow AND close < DClose(1) AND TradeCounterShort = 0 THEN
IF Time >= 93000 AND Time <= 150000 THEN // short breakouts after 1500 are not profitable
SELLSHORT PositionSize CONTRACT AT MARKET
TradeCounterShort = TradeCounterShort + 1
ENDIF
ENDIF
// close positions
IF Time = SellTime THEN
IF LONGONMARKET THEN
SELL AT MARKET
ENDIF
IF SHORTONMARKET AND Time = SellTime THEN
EXITSHORT AT MARKET
ENDIF
ENDIF
// stops and targets
SET STOP LOSS sl
SET TARGET PROFIT tp
ENDIF
Valiant747 – 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 🙂
Hi Vonasi,
Ahh, thanks. I wasn’t aware of that button. I am rather new here. But thanks, I will do it in the future!