Open Range Break Out Dax 5 / 15 min

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #111721 quote
    Valiant747
    Participant
    New

    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?

    #111726 quote
    robertogozzi
    Moderator
    Master

    >> Please update your country flag in your profile. Thank you 🙂 <<

    #111731 quote
    Nicolas
    Keymaster
    Master
    Topic moved to automated trading forum. Please post the code of your automatic trading strategy in order to help you.
    #111739 quote
    Valiant747
    Participant
    New
    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
    #111740 quote
    Vonasi
    Moderator
    Master
    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 🙂
    #111744 quote
    Valiant747
    Participant
    New
    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!
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Open Range Break Out Dax 5 / 15 min


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Valiant747 @valiant747 Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by Valiant747
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/31/2019
Status: Active
Attachments: No files
Logo Logo
Loading...