Max e min ultime N candele e range ultima candela

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #69760 quote
    volpiemanuele
    Participant
    Veteran

    Vorrei sviluppare un sistema che entra a mercato se il close è maggiore (long) o minore (short) delle ultime 26 candele e se l’ultima candela rientra in un certo range. Puo’ andare questo codice ?

    DEFPARAM CumulateOrders = FALSE
    ordersize=1
    ONCE MaxBarre = 26            //Numero di candele nel range
    ONCE MaxPips  = 20            //Numero di pips di differenza
    hh = highest[MaxBarre](high)  //prezzo più alto  delle barre desiderate
    ll = lowest[MaxBarre](low)    //prezzo più basso delle barre desiderate
    Laterale = (high  low) <= (MaxPips * pipsize) // se siamo in un range ultima candela
    If  close > hh and laterale Then

    Buy ordersize shares at market nextbaropen

    endif

    if  close < ll and laterale then

    Sellshort ordersize shares at market nextbaropen

    endif

    #69761 quote
    robertogozzi
    Moderator
    Master

    Si, va bene. Devi solo aggiungere lo Stop Loss ed il Target Profit.

    NEXTBAROPEN puoi anche non metterla, le strategie vengono sempre essguite alla chiusura di ogni barra, prima dell’apertura della successiva. È un’istruzione obsoleta tenuta per compatibilità con vecchie strategie.

    (high – low) puoi sostituirlo con RANGE, è la stessa cosa.

    #69769 quote
    volpiemanuele
    Participant
    Veteran

    Grazie…devo aggiungere altre cose….se ho difficoltà posto qui il resto.

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

Max e min ultime N candele e range ultima candela


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by volpiemanuele
7 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/04/2018
Status: Active
Attachments: No files
Logo Logo
Loading...