indicatore supertrend

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

    salve a tutti, avrei bisogno di mettere nella mia strategia l’uscita dalla posizione  long o short, utilizzando l’indicatore supertrend, cioè chiudere una posizione long quando il supertrend passa da sotto a sopra le candele, e chiudere una posizione short quando il supertrend passa da sopra a sotto le candele, cioè quando abbiamo il ribaltamento dell’indicatore con il prezzo.

    Come dovrei impostare il codice?

    grazie.

    #20216 quote
    Nicolas
    Keymaster
    Legend

    In primo luogo, definire l’indicatore SuperTrend in una nuova variabile:

    st = supertrend[3,10]


    Quindi, rendere le condizioni, a seconda delle tue posizioni reali sul mercato agli ordini di uscita:

    //BUY ORDERS
    if longonmarket and Close<st then 
     SELL AT MARKET 
    endif 
    
    //SELL ORDERS
    if shortonmarket and Close>st then 
     EXITSHORT AT MARKET 
    endif

     

    Che dovrebbe funzionare, si prega di confermare in questo caso 🙂

    #20227 quote
    Luigi5192
    Participant
    Average

    la ringrazio lo proverò cosi.

    saluti

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

indicatore supertrend


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Luigi5192 @luigi5192 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Luigi5192
9 years, 8 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 01/08/2017
Status: Active
Attachments: No files
Logo Logo
Loading...