Ichimoku cloud

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #91914 quote
    Marco C.
    Participant
    New

    Ciao a tutti, sono nuovo su prorealcode, Mi sto cimentando da qualche mese sull’ichimoku per acquisti sull’azionario giornaliero e ho provato a fare un programmino ma non riesco a sfruttare le potenzialità di quest’indice. Vi posto il cod che è provato a scrivere (sono neofita sulla programmazione), qualcuno mi può dare una mano?

    Grazie

    Defparam cumulateorders = False
    
    MA200 = Average[200,0](close)
    
    TS = (highest[9](high)+lowest[9](low))/2 //Tenkan-Sen
    KS = (highest[26](high)+lowest[26](low))/2 //Kijun-Sen
    SA = (TS+KS)/2 //Senkou-Span A (projected 26 periods forward)
    SB = (highest[52](high)+lowest[52](low))/2 //Senkou-Span B (projected 26 periods forward)
    CH = CLOSE [1] //Chikou Span - prezzo attuale spostato indietro di 26 periodi
    
    If close > MA200 and close > max(SA[26],SB[26]) and SA > SB and SA > SA[26] and close > KS and CH>max(SA[26],SB[26]) THEN
    BUY 1 CASH AT MARKET
    ENDIF
    
    If close < MA200 and close < min(SA[26],SB[26]) and SA < SB and SA < SA[26] and close < KS and CH<min(SA[26],SB[26]) THEN
    SELLSHORT 1 CASH AT MARKET
    ENDIF
    #92167 quote
    Nicolas
    Keymaster
    Master

    Il tuo codice mi sembra giusto al momento della prima lettura, cosa vuoi fare esattamente? Qual è il problema con il codice?

    #92181 quote
    fifi743
    Participant
    Master

    ch=close

    Nicolas thanked this post
    #92367 quote
    Marco C.
    Participant
    New

    Il problema che riscontro è quello di acquisti sballati. Ho provato a simularlo sull’azionario italiano, ma parte con acquisti sballati all’inizio. Sono andato a modificarlo per aver un riscontro più veritiero, vi allego il codice che ho modificato. Diciamo che agisce in modo ottimale su tutte quelle azioni che hanno un trend (che è quello che fa ichimoku), trovando difficoltà su quelle azioni un po’ più ballerine. Ma, dato che non so il futuro, non vorrei avere un codice che simula bene nel passato quando c’è in atto un trend (che è ben visibile) e male nel caso di lateralizzazione futura facendo acquisti e vendite frenetiche.

    Spero di essermi spiegato

    Defparam cumulateorders = False
    
    MA200 = Average[200,0](close)
    
    TS = (highest[9](high)+lowest[9](low))/2 //Tenkan-Sen
    KS = (highest[26](high)+lowest[26](low))/2 //Kijun-Sen
    SA = (TS+KS)/2 //Senkou-Span A (projected 26 periods forward)
    SB = (highest[52](high)+lowest[52](low))/2 //Senkou-Span B (projected 26 periods forward)
    CH = CLOSE [26] //Chikou Span - prezzo attuale spostato indietro di 26 periodi
    
    
    
    If close > MA200 and close > min(SA[26],SB[26]) and close > KS and CH>SA[26] AND CH>SB[26] AND CH>KS AND CH>TS THEN
    BUY 100000 CASH AT MARKET TOMORROWOPEn
    endif
    If close < MA200 and close < min(SA[26],SB[26]) and SA < SB and SA < SA[26] and close < KS and CH<SA[26] AND CH<SB[26] AND CH<KS AND CH <TS THEN
    SELL 100000 CASH AT MARKET TOMORROWOPEN
    ENDIF
    
    If close < MA200 and close < min(SA[26],SB[26]) and SA < SB and SA < SA[26] and close < KS and CH<SA[26] AND CH<SB[26] AND CH<KS AND CH <TS THEN
    SELLSHORT 100000 CASH AT MARKET TOMORROWOPEN
    ENDIF
    If close > MA200 and close > min(SA[26],SB[26]) and close > KS and CH>SA[26] AND CH>SB[26] AND CH>KS AND CH>TS THEN
    exitshort 100000 CASH AT MARKET TOMORROWOPEN
    endif
    IF PositionPerf(1) > 0.1 THEN
    SET STOP %LOSS 10
    ENDIF
    
    
    
    
    #92369 quote
    Nicolas
    Keymaster
    Master

    ok, quindi il codice funziona correttamente, ma il tuo trend seguendo la strategia non è adatto per il comportamento non-trend del mercato .. beh questo è il problema comune a tutti e lo hai individuato, nessuno può prevedere il futuro .. 🙂

    #92380 quote
    Marco C.
    Participant
    New

    Si quello è vero. Però non riesco a migliorarlo sulle azioni che hanno movimenti più irregolari, non so se aggiungere altri indicatori che possono dare segnali operativi un pochino più sicuri.

    Cmq grazie per le risposte Nicolas.

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

Ichimoku cloud


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Marco C.
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 02/21/2019
Status: Active
Attachments: No files
Logo Logo
Loading...