Coding open on Tick

Forums ProRealTime English forum ProOrder support Coding open on Tick

Viewing 2 posts - 1 through 2 (of 2 total)
  • #242737

    Hallo all

    I like to code a strategy that take the 8.50 to 9.00 candles as a range and then executes a long above the range high or a short below the range low. I how can I give the code the to execute at the break of the range high or low? I have been trying but with no luck. Thank you for your help, really appreciate it!

    I got this code but no trades are executed

    // Definition of code parameters
    DEFPARAM FLATBEFORE = 090000
    DEFPARAM FLATAFTER = 120000

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated

    //Long Conditions
    IF Time = 085500 THEN
    SignalHigh = max(high, high[1])
    SignalLow = min(low, low[1])
    ENDIF

    //Define the breatout Conditions
    LongCondition = (open > SignalHigh and time >= 090000)
    ShortCondition = (open < SignalLow and time >= 090000)

    TradeLong = 0
    TradeShort = 0

    IF Time = 090000 and open= SignalHigh THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    //Set Stop-Loss
    SET STOP TRAILING 20

    #242738

    Change to below and you should get some trades?

     

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login