Gold strategy from Tradestation to PRT

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #250807 quote
    Aragorna
    Participant
    Junior
    inputs:Longlenght(58), Max(4250);
    
    //entries with filters
    if (ADX(14) and RSI(close,14) > 60 and StdDev(Close,20)> StdDev(close,20)[1])=false //Filters #672 ADX RSI Vol Up
    and ADX(5) <50 then begin// filters #190: ADX above 50
    Buy next bar highest (high,longhlenght) stop; end;
    
    If (close<lowest(low,21)[1]=false //filter #243 close below lowest average lows +1
    and (StdDev(close,10)>StdDev(close,20) and RSI(close,14) <40 and CCI(14)<-100) = false then begin // Filters #725: StdDev RSI CCI down
    If (PivotHighVSBar (1,high,2,2,50)<PivotLowVSBar(1,low,2,2,50)) then begin   
    Sellshort next bar Lowest (Low, Longlenght) Stop; end;end;
    
    //Exit: Profit,StopLoss, #15 High/Low trail stop
    Setprofittarget(Max); Setstoploss (Max*0.3);
    if marketposition>0 then sell next bar at lowest(Low,10) stop;
    if marketposition<0 then buytocover next bar at highest(high,10) stop

    Hello, can you please convert this easylanguage strategy for PRT?

     

    many thanks in advance

     

    regards

     

    Alessio

    Madrosat thanked this post
    #250833 quote
    Iván González
    Moderator
    Master

    Hi, here you have the strategy.

    //-----------------------------------------------
    //PRC_Gold Strategy
    //version = 0
    //15.09.2025
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-----------------------------------------------
    // --- STRATEGY SETTINGS & PARAMETERS ---
    DEFPARAM CumulateOrders = false
    longlenght = 58      
    maxProfit = 4250     
    stopLossValue = maxProfit * 0.3 
    //-----------------------------------------------
    // --- LONG ENTRY LOGIC ---
    //-----------------------------------------------
    // Indicator definitions for the long entry condition.
    myADX14 = ADX[14]
    myRSI14 = RSI[14](close)
    myStdDev20 = STD[20](close)
    myADX5 = ADX[5]
    
    // This filter group must be FALSE for a long entry to be considered.
    longFilter = (myADX14 > 60 AND myRSI14 > 60 AND myStdDev20 > myStdDev20[1])
    
    // Main long entry condition:
    IF NOT LongOnMarket AND NOT longFilter AND myADX5 < 50 THEN
    entryPrice = HIGHEST[longlenght](high)
    BUY 1 CONTRACT AT entryPrice STOP
    ENDIF
    //-----------------------------------------------
    // --- SHORT ENTRY LOGIC ---
    //-----------------------------------------------
    // Indicator definitions for the short entry condition.
    myStdDev10 = STD[10](close)
    myCCI14 = CCI[14]
    
    // Filter conditions that must be FALSE for a short entry.
    shortFilter1 = (close < LOWEST[21](low)[1])
    shortFilter2 = (myStdDev10 > myStdDev20 AND myRSI14 < 40 AND myCCI14 < -100)
    
    // Simplified Pivot Point Logic
    ONCE prd = 2 // Period to define the pivot
    ONCE pivotH = 0
    ONCE pivotL = 0
    
    // Pivot High Detection
    ph1 = high < high[prd]
    ph2 = HIGHEST[prd](high) < high[prd]
    ph3 = high[prd] > HIGHEST[prd](high)[prd+1]
    
    IF ph1 AND ph2 AND ph3 THEN
    pivotH = high[prd]
    ENDIF
    
    // Pivot Low Detection
    pl1 = low > low[prd]
    pl2 = LOWEST[prd](low) > low[prd]
    pl3 = low[prd] < LOWEST[prd](low)[prd+1]
    
    IF pl1 AND pl2 AND pl3 THEN
    pivotL = low[prd]
    ENDIF
    
    pivotCondition = (pivotH > 0) AND (pivotL > 0) AND (pivotH < pivotL)
    
    // Main short entry condition:
    IF NOT ShortOnMarket AND NOT shortFilter1 AND NOT shortFilter2 AND pivotCondition THEN
    entryPrice = LOWEST[longlenght](low)
    SELLSHORT 1 CONTRACT AT entryPrice STOP
    ENDIF
    //-----------------------------------------------
    // --- EXIT MANAGEMENT ---
    //-----------------------------------------------
    // Fixed stop loss and profit target.
    SET STOP $LOSS stopLossValue
    SET TARGET $PROFIT maxProfit
    
    // Dynamic Trailing Stop based on a 10-period high/low.
    
    IF LongOnMarket THEN
    exitLevel = LOWEST[10](low)
    SELL AT exitLevel STOP
    ENDIF
    
    IF ShortOnMarket THEN
    exitLevel = HIGHEST[10](high)
    EXITSHORT AT exitLevel STOP
    ENDIF
    robertogozzi thanked this post
    #250928 quote
    Aragorna
    Participant
    Junior

    Thank you very much

    #257107 quote
    Maik2404
    Participant
    Veteran

    A very interesting strategy. Congratulations.

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

Gold strategy from Tradestation to PRT


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Aragorna @aragorna Participant
Summary

This topic contains 3 replies,
has 1 voice, and was last updated by Maik2404
5 days, 12 hours ago.

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