TRAILING STOP

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #125598 quote
    romanelli4romanelli4
    Participant
    Average
    Buongiorno, se mi potete aiutare  cortesemente dovrei impostare per i ts un mytrailing stop cosi fatto:

    // Definizione dei parametri del codice
    
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l'orario "Flat Before" non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 080500
    // Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all'orario "Flat After"
    DEFPARAM FLATAFTER = 215900
    
    
    indicator1 = Average[20](close)
    
    
    // Condizioni per entrare long
    
    c1 = (close[0] CROSSES OVER indicator1[1])
    c2 = (close[0] CROSSES UNDER indicator1[1])
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    IF c2 THEN
    sell 1 CONTRACT AT MARKET
    ENDIF
    
    // Condizioni per  posizioni short
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    IF c1 THEN
    exitshort 1 CONTRACT AT MARKET
    ENDIF
    
    myTrailing = al range della barra che mi genera il segnale +5 punti
    
    SET STOP PTRAILING myTrailing
    campione.png campione.png
    #125608 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    Inserisci la riga:
    myTrailing = range
    tra la 17 e la 18 e tra la 27 e 28. Per il trailing stop è consigliabile usare il codice dalle righe 17 a 56 a questo link https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/. SET STOP TRAILING può dare risultati molto diversi tra backtest e reale ed ha un passo di una sola unità (predefinita e immodificabile). Gli si può solo dire quando iniziare.
Viewing 2 posts - 1 through 2 (of 2 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

TRAILING STOP


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
romanelli4 @romanelli4 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/10/2020
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...