TS magic trend custom

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #202298 quote
    robertogozzi
    Moderator
    Master

    Non ho nemmeno un’operazione fatta tra quelle che hai elencato. Evidentemente hai variato qualche parametro.

    Inviami il file ITF che hai usato (non il testo).

    #202300 quote
    romanelli4
    Participant
    Average

    Salve Roberto,

    mi spiace farti impazzire!

    ecco il codice testato su cfd US tech 100

    ONCE SegnaleLong    = 0
    ONCE SegnaleShort   = 0
    ONCE BullTrend      = 0
    ONCE BearTrend      = 0
    ONCE UltimaResist   = 0
    ONCE UltimoSupporto = 0
    //
    myMagicTrend = CALL "Magic Trend custom"[20, 14, 1, 5]
    mydownT      = CALL "Magic Trend downT"[20, 14, 1, 5]
    myupT        = CALL "Magic Trend upT"[20, 14, 1, 5]
    myResistenza = CALL "Resistenza"[1, 5]
    mySupporto   = CALL "Supporto"[1, 5]
    //
    IF BullTrend THEN
    BullTrend = myMagicTrend >= myMagicTrend[1]
    IF BullTrend THEN
    BearTrend = 0
    ENDIF
    ELSE
    BullTrend = myMagicTrend > myMagicTrend[1]
    IF BullTrend THEN
    BearTrend = 0
    ENDIF
    ENDIF
    //
    IF BearTrend THEN
    BearTrend = myMagicTrend <= myMagicTrend[1]
    IF BearTrend THEN
    BullTrend = 0
    ENDIF
    ELSE
    BearTrend = myMagicTrend < myMagicTrend[1]
    IF BearTrend THEN
    BullTrend = 0
    ENDIF
    ENDIF
    //
    IF BullTrend THEN
    UltimoSupporto = mySupporto
    ELSIF BearTrend THEN
    UltimaResist   = myResistenza
    ENDIF
    //
    ///TREND  LONG -----------------------------
    ONCE trendlong = 0
    IF StrategyProfit <> StrategyProfit[1]  THEN
    trendlong = 0
    ENDIF
    Medialong = myMagicTrend
    IF mydownT crosses under Medialong[1] OR longOnMarket  THEN
    trendlong = 0
    ENDIF
    IF trendlong = 0 THEN
    trendlong = myupT crosses over Medialong[1]
    ENDIF
    /////TREND SHORT------------------------------------------
    ONCE trendshort = 0
    IF StrategyProfit <> StrategyProfit[1]  THEN
    trendshort = 0
    ENDIF
    Media = myMagicTrend
    IF myupT crosses over Media[1] OR shortOnMarket  THEN
    trendshort = 0
    ENDIF
    IF trendshort = 0 THEN
    trendshort = mydownT crosses under Media[1]
    ENDIF
     
    IF  Not shortOnMarket and trendshort and myResistenza < UltimoSupporto THEN
    sellshort 1 CONTRACT AT market
    SET STOP LOSS 20
    set target profit 30
    ENDIF
     
    IF Not LongOnMarket and trendlong and mySupporto > UltimaResist THEN
    Buy       1 CONTRACT AT market
    SET STOP LOSS 20
    set target profit 30
    ENDIF
    //GRAPHONPRICE ULTIMOSUPPORTO
    //GRAPHONPRICE UltimaResist COLOURED (0,255,0)
    #202305 quote
    robertogozzi
    Moderator
    Master

    E’ lo stesso codice, ma i risultati sono diversi, ti allego una foto del 30 Settembre 2022 alle 21:11 e non c’è nessuna operazione aperta.

    Alle 20:57 non c’è niente, ma c’è quello corretto alle 20:54.

    Alle 20:42 non mi risulta nessuna operazione.

    Alle 20:29 non mi risulta nessuna operazione.

    Non so cosa dirti, a me funziona benissimo. Non ho idea del perché tu abbia tutte queste operazioni errate.

    Verifica che il codice del tuo backtest (file ITF) sia identico a quello che hai postato.

    #202317 quote
    romanelli4
    Participant
    Average

    mah !

    non capisco neanche io….

    potresti cortesemente inviarmi una schermata del ts sul Germany 40 cash(1€) e controllo le differenze

    grazie mille

    #202320 quote
    robertogozzi
    Moderator
    Master

    Eccolo allegato.

    #202386 quote
    romanelli4
    Participant
    Average

     

    HO TROVATO L’INGHIPPO!

    ONCE SegnaleLong = 0
    ONCE SegnaleShort = 0
    ONCE BullTrend = 0//HO MESSO 1 E FUNZIONA
    ONCE BearTrend = 0//HO MESSO 1 E FUNZIONA
    ONCE UltimaResist = 0
    ONCE UltimoSupporto = 0

    Anche se non ho capito a cosa servono

    ONCE SegnaleLong = 0
    ONCE SegnaleShort = 0

    dato che non lo ritrovo nel codice

    Grazie di tutto

    Max

    #202393 quote
    robertogozzi
    Moderator
    Master

    Le due variabili del segnale le avevo messe inizialmente, ma non ce n’era bisogno ed ho dimenticato di toglierle.
    La modifica che hai fatto non influisce (almeno sul mio codice), però se così funziona come desideri… bene!

Viewing 7 posts - 31 through 37 (of 37 total)
  • You must be logged in to reply to this topic.

TS magic trend custom


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
romanelli4 @romanelli4 Participant
Summary

This topic contains 36 replies,
has 3 voices, and was last updated by robertogozzi
3 years, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/14/2022
Status: Active
Attachments: 10 files
Logo Logo
Loading...