TS Sdema Stocastic

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13711 quote
    Conte Caimano
    Participant
    Master

    ciao Nicolas,

    volevo pubblicare un nuovo trading system basato sulla ricerca delle cuspidi di una media di media filtrata dall’istruzione “Stocastic”.

    L’ho testata su varie valute con buoni risultati allego come esempio il test su EurCad.

    DEFPARAM NoCashUpdate = True
    // ---------------------------------------------------------------------
    // Sdema Stocastico
    // -------------------------- VARIABILI
    // GGEma1 = 9
    // GGEma2 = 9
    // K = 17
    // D = 3
    // Ottimizzare GGema1 e GGema2: da 3 a 30 con passo 3
    // Ottimizzare K e D: da 3 a 30 con passo 3
    // ---------------------------------------------------------------------
    // --- calcola Lotti per Valute
    Lotti = 1
    // --- calcola Lotti per Azioni
    //Lotti = 2000 / Close
    // ---------------------------------------------------------------------
    Prezzo = TypicalPrice
    
    Alfa1 = 2/(GGema1 + 1)
    Alfa2 = 2/(GGema2 + 1)
    
    IF BarIndex=0 THEN
    Ema1 = Prezzo
    Ema2 = Prezzo
    Sdema = 2 * Prezzo - Prezzo
    ELSE
    Ema1 = Ema1[1] * ( 1 - Alfa1) + Prezzo * Alfa1
    Ema2 = Ema2[1] * ( 1 - Alfa2) + Ema1 * Alfa2
    Sdema = 2 * Ema1 - Ema2
    ENDIF
    
    SdemaStocastico = Stochastic[K,D](Sdema)
    // ---------------------------------------------------------------------
    // -------------------------- Verifica TREND
    Long = (SdemaStocastico[2] > SdemaStocastico[1]) AND (SdemaStocastico[1] < SdemaStocastico[0]) AND (SdemaStocastico[0] > SdemaStocastico[2])
    Short = (SdemaStocastico[2] < SdemaStocastico[1]) AND (SdemaStocastico[1] > SdemaStocastico[0]) AND (SdemaStocastico[0] < SdemaStocastico[2])
    // ---------------------------------------------------------------------
    // Condizioni per entrare su posizioni long
    IF NOT LongOnMarket AND Long THEN
    BUY Lotti CONTRACTS AT MARKET NEXTBAROPEN
    ENDIF
    
    // Condizioni per entrare su posizioni short
    IF NOT ShortOnMarket AND Short  THEN
    SELLSHORT Lotti CONTRACTS AT MARKET NEXTBAROPEN
    ENDIF
    
    // Stop e target:
    // ---------------------------------------------------------------------

    Non sono sicuro di utilizzare bene l’istruzione  Stochastic[K,D], nell'ottimizzazione il valori di K vanno da 3 a 30 con passo 3 e stessa cosa per la variabile D. 

    la variabile D  non deve avere i valori d 1, 3 o 5 obbligatoriamente vero? (questo valori sono indicati  http://www.prorealcode.com/documentation/stochastic/)

    Hai qualche suggerimento per migliorare il trading system ?

    #13728 quote
    Nicolas
    Keymaster
    Master

    Questa definizione dell’oscillatore stocastico provenire da Investopedia:

    BREAKING DOWN ‘Stochastic Oscillator’

    The stochastic oscillator is calculated using the following formula:

    %K = 100(C – L14)/(H14 – L14)

    Where:

    C = the most recent closing price

    L14 = the low of the 14 previous trading sessions

    H14 = the highest price traded during the same 14-day period

    %K= the current market rate for the currency pair

    %D = 3-period moving average of %K

    Read more: Stochastic Oscillator Definition | Investopedia http://www.investopedia.com/terms/s/stochasticoscillator.asp#ixzz4LLMQg1p2


    Circa la vostra strategia, questa è una cosa molto importante in che vanno mercati. Oscillatore stocastico mostrerà aree di ipercomprato e ipervenduto, calcolati dai confini storici di prezzo. Così, mentre il mercato è compreso, è ovvio che i suoi limiti superiore e inferiore sono già noti, che non è la stessa in trend di mercato. Un’idea potrebbe essere quella di autorizzare il solo segnali di acquisto quando si è rilevato di essere in un mercato con un trend rialzista e viceversa. Questo potrebbe dare più efficienza con questo tipo di strategia ‘mean reversion’.

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

TS Sdema Stocastic


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
9 years, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/25/2016
Status: Active
Attachments: No files
Logo Logo
Loading...