strategy gold 2

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

    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
    JSJS
    Participant
    Master

    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
    AragornaAragorna
    Participant
    Average

    thanks

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 AragornaAragorna
1 year ago.

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