Strategia 1 ora

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #66308 quote
    R05
    Participant
    Veteran

    Gent.mi buongiorno,

    chiedo, cortesemente, aiuto, riguardo la codifica della seguente strategia:

    • time frame orario
    • media mobile esponenziale a 21 periodi
    • condizione long: chiusura candela sopra la media suddetta
    • entrata long: 1 pip sopra il max della candela che ha chiuso sopra la media
    • viceversa per lo short
    • si segue in trailing stop

    Riguardo il trailing stop ho già il codice seguente:

    // Stop e target
    
    IF close > open THEN               //LONG
    MinLow   = low
    StopLoss = low - 2  //2 pips sotto il minimo
    ELSE                               //SHORT
    MaxHigh  = high
    StopLoss = high + 2 //2 pips sopra il massimo
    ENDIF
    
    
    SET STOP PLOSS StopLoss
    
    
    IF LongOnMarket THEN         //per i LONG
    IF low > MinLow THEN      //verificare che sia un MINIMO più alto
    MinLow = Low           //aggiornare la variabile
    ENDIF
    SELL AT MinLow - 2 STOP       //aggiornare l'ordine di STOP ad ogni candela
    ENDIF
    IF ShortOnMarket THEN        //per gli SHORT
    IF high < MaxHigh THEN    //verificare che sia un MASSIMO più basso
    MaxHigh = high         //aggiornare la variabile
    ENDIF
    EXITSHORT AT MaxHigh + 2 STOP //aggiornare l'ordine di STOP ad ogni candela
    ENDIF

    Ma non riesco a codificare l’entrata in posizione.

    Vi ringrazio e Vi saluto cordialmente.

    #66309 quote
    R05
    Participant
    Veteran

    Vi allego un esempio

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

Strategia 1 ora


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
R05 @r05 Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by R05
7 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 03/25/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...