strategy gold 2

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #251279 quote
    Aragorna
    Participant
    Junior

    Hello,

     

    can I ask please a conversion of this strategy for gold? in attachment

    thanks in advance

     

    Alessio

    IMG_9733.jpg IMG_9733.jpg
    #251284 quote
    JS
    Participant
    Senior

    Try this one…

    DefParam CumulateOrders=False
    
    // === Parameters ===
    LengthA = 70
    LengthB = 25
    Stopx   = 2000    // stop-loss in punten
    BarX    = 20      // bars-sinds-entry exit
    
    
    // === Channel Values ===
    hhA = Highest[LengthA](high)
    llA = Lowest[LengthA](low)
    
    hhB = Highest[LengthB](high)
    llB = Lowest[LengthB](low)
    
    // === Conditions ===
    c1 = hhA > hhB
    c2 = llA < llB
    c3 = hhB > Highest[3](high)
    c4 = llB < Lowest[3](low)
    c5 = ADX[14] >= 20
    
    // === Entries ===
    If NOT OnMarket AND c1 AND c2 AND c3 AND c4 AND c5 AND LengthA > LengthB THEN
    BUY 1 CONTRACT AT hhB STOP
    SELLSHORT 1 CONTRACT AT llB STOP
    ENDIF
    
    // === Stop-loss ===
    SET STOP pLOSS Stopx
    
    // === Time exit ===
    IF OnMarket THEN
    IF (BarIndex - TradeIndex) >= BarX THEN
    IF LongOnMarket THEN
    SELL AT MARKET
    ELSE
    EXITSHORT AT MARKET
    ENDIF
    ENDIF
    ENDIF
    
    Iván González and robertogozzi thanked this post
    #251667 quote
    Aragorna
    Participant
    Junior

    thanks

    JS thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

strategy gold 2


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Aragorna @aragorna Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Aragorna
4 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/22/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...