Trading system SAR 23

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #166423 quote
    Gael
    Participant
    Average

    Salve,

    volevo chiedervi la realizzazione di queste due idee in trading system:

    1)

    • Buy alla comparsa di un segnale SAR sotto le candele
    • Sell alla comparsa di un segnale SAR sopra le candele
    • Trailling stop sul segnale SAR, e va a spostarsi alla comparsa del nuovo segnale.

    2)

    Il secondo trading system è simile al primo, solo che chiude il sistema al raggiungimento del 12 segnale SAR consecutivo.  Nel caso i segnali SAR dovessero essere inferiori a 12, il sistema chiude al segnale SAR inverso.

    Grazie mille in anticipo

    #166469 quote
    Nicolas
    Keymaster
    Master

    1 / questo sistema è molto semplice da creare con la creazione assistita, hai provato prima? Ad ogni modo, ecco qualcosa con cui puoi giocare:

    defparam cumulateorders=false 
    
    isar = SAR[0.02,0.02,0.2]
    
    if not longonmarket and close crosses over isar then 
    buy at market 
    sell at isar stop 
    endif 
    
    if not shortonmarket and close crosses under isar then 
    sellshort at market 
    exitshort at isar stop 
    endif 
    
    if longonmarket then 
    sell at isar stop
    endif 
    
    if shortonmarket then 
    exitshort at isar stop
    endif
    #166472 quote
    Nicolas
    Keymaster
    Master

    2 / quel sistema taglia gli ordini quando ISAR è 12 volte consecutive dello stesso colore:

    defparam cumulateorders=false 
    
    isar = SAR[0.02,0.02,0.2]
    
    if not longonmarket and close crosses over isar then 
    buy at market 
    endif 
    
    if not shortonmarket and close crosses under isar then 
    sellshort at market 
    endif 
    
    bcount = summation[12](close>isar)=12
    if bcount and longonmarket then 
    sell at market 
    endif 
    
    scount = summation[12](close<isar)=12
    if scount and shortonmarket then 
    exitshort at market 
    endif
    #166478 quote
    Gael
    Participant
    Average

    Ho provato prima, ma sono ancora un principiante e volevo avere conferma, comunque grazie mille.

    Buona giornata

    #166479 quote
    Gael
    Participant
    Average

    Scusa il disturbo, ma non riesco a metterlo in .itf

    #166484 quote
    Nicolas
    Keymaster
    Master

    Basta creare una nuova strategia e inserire il codice lì, è facile 🙂

    #166506 quote
    Gael
    Participant
    Average

    Mi da la riga 1,6,7,9 con il punto esclamativo se faccio: indicatori –> nuovo –> incolla

    #166508 quote
    MauroPro
    Participant
    Veteran

    Li devi copiare in una strategia non in un indicatore.

    Eccoli

    Sar-1.itf Sar-2.itf
    #166525 quote
    Gael
    Participant
    Average

    Grazie mille

    #166548 quote

    Ciao Gael

    Visto che sei alle prime armi per aiutarti ti ho creato delle piccole aggiunte che ti verranno utili con il proseguo della tua esperienza che farai nella programmazione.

    Ti ho aggiunto Target dinamico (con Atr ) e stop loss in percentuale e numero massimo di barre (oltre il sistema esce dalla posizione).

    Il tutto è stato distinto se sono operazioni Long o Short.

    Ciao

    Buona Fortuna

    defparam cumulateorders=false
    
    isarlong  = SAR[0.04,0.04,0.6]
    isarShort = SAR[0.07,0.07,0.1]
    if not longonmarket and close crosses over isarlong then
    buy at market
    sell at isarlong stop
    set target profit 10* averagetruerange[5](close)
    set Stop   %loss  1.8
    endif
    if longonmarket then
    sell at isarlong stop
    endif
    if not shortonmarket and close crosses under isarshort then
    sellshort at market
    exitshort at isarshort stop
    set target profit 8* averagetruerange[12](close)
    set Stop   %loss  1.2
    endif
    if shortonmarket then
    exitshort at isarshort stop
    endif
    // NUMERO BARRE OTTIMALI
    ONCE maxCandlesLongWithProfit = 17     // profitto long
    ONCE maxCandlesShortWithProfit = 10    // profitto short
    ONCE maxCandlesLongWithoutProfit = 12  // Limite long
    ONCE maxCandlesShortWithoutProfit = 9 // Limite short
    posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
    numberCandles = (BarIndex - TradeIndex)
    m1 = posProfit > 0 AND numberCandles >= maxCandlesLongWithProfit
    m2 = posProfit > 0 AND numberCandles >= maxCandlesShortWithProfit
    m3 = posProfit < 0 AND numberCandles >= maxCandlesLongWithoutProfit
    m4 = posProfit < 0 AND numberCandles >= maxCandlesShortWithoutProfit
    IF LONGONMARKET AND (m1 OR m3) THEN
    SELL AT MARKET
    ENDIF
    IF SHORTONMARKET AND (m2 OR m4) THEN
    EXITSHORT AT MARKET
    ENDIF
    robertogozzi and Boris thanked this post
    Sar-1-1.itf
    #166551 quote

    Questi sono i risultati con Dax 2 ore

    Sar1.jpg Sar1.jpg Sar1-b.jpg Sar1-b.jpg
    #168317 quote
    Gael
    Participant
    Average

    Grazie mille, sembra veramente molto interessante

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

Trading system SAR 23


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gael @gael Participant
Summary

This topic contains 11 replies,
has 5 voices, and was last updated by Gael
4 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/07/2021
Status: Active
Attachments: 5 files
Logo Logo
Loading...