Condizione verificatasoi n candele prima

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #60694 quote
    traderwin
    Participant
    Average

    Ciao Roberto Grazie.

    Vorrei che la strategia funzionasse proprio con le candele heikin-ashi

    #61577 quote
    robertogozzi
    Moderator
    Master

    L’ultima versione su cui ho lavorato è questa, provata su GbpUsd, TF 30 minuti. Tuttavia, come si vede dalla foto, dopo essere entrato LONG non è uscito in SL alla candela delle 10:00 del 3 Gennaio 2018, pur avendo settato lo Stop Loss (alla riga 20) a 1.35790:

    //PRC_Doji Heikin Ashi | screener
    //10.01.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    DEFPARAM CumulateOrders = false
    DEFPARAM PreLoadBars    = 0
    ONCE StopLossBuy  = 0
    ONCE StopLossSell = 0
    // --- parameters
    DojiSize = 5 //x% percent of body size compared to the complete range of the candlestick
    // ---
    GRAPH StopLossBuy
    GRAPH StopLossSell
    GRAPH data
    GRAPH LongOnMarket
    GRAPH LongOnMarket[1]
    
    IF LongOnMarket[1] THEN                           //Setta lo SL dopo l'entrata LONG
    IF StopLossBuy THEN
    SET STOP LOSS StopLossBuy
    ENDIF
    StopLossBuy  = 0
    StopLossSell = 0
    ENDIF
    
    IF ShortOnMarket[1] THEN                          //Setta lo SL dopo l'entrata SHORT
    IF StopLossSell THEN
    SET STOP LOSS StopLossSell
    ENDIF
    StopLossBuy  = 0
    StopLossSell = 0
    ENDIF
    
    //if barindex>1 then
    haclose=(open+close+low+high)/4
    haopen=(haopen[1]+haclose[1])/2
    xHigh = Max(haOpen, haClose)
    xLow = Min(haOpen, haClose)
    hahigh = Max(High,xHigh)
    halow = Min(Low,xLow)
    IF Not OnMarket THEN
    data=abs(haopen - haclose) <= ((hahigh - halow) * DojiSize/100)
    IF data THEN
    StopLossBuy  = low  - (10 * pipsize)
    StopLossSell = high + (10 * pipsize)
    ENDIF
    ELSE
    data = 0
    ENDIF
    //ENDIF
    
    IF data OR (StopLossBuy AND StopLossSell) THEN
    PrezzoBuy  = high + (10 * pipsize)
    IF PrezzoBuy > close THEN
    BUY       1 contracts AT StopLossSell STOP
    ELSE
    BUY       1 contracts AT StopLossSell LIMIT
    ENDIF
    PrezzoSell = low  - (10 * pipsize)
    IF PrezzoSell < close THEN
    SELLSHORT 1 contracts AT StopLossBuy  STOP
    ELSE
    SELLSHORT 1 contracts AT StopLossBuy  LIMIT
    ENDIF
    ENDIF
    //GRAPH StopLossBuy
    //GRAPH StopLossSell
    //GRAPH data
    //GRAPH LongOnMarket
    //GRAPH LongOnMarket[1]

    sembra che la riga 20 NON venga eseguita e non capisco perché.

    Spero che Nicolas possa aiutarci.

    #62976 quote
    traderwin
    Participant
    Average

    Grazie Roberto. visto ora

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Condizione verificatasoi n candele prima


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
traderwin @traderwin Participant
Summary

This topic contains 17 replies,
has 3 voices, and was last updated by traderwin
7 years, 11 months ago.

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