Bonjour stratégie Heikin ashi ne respect pas la règle

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #178782 quote
    denis aig
    Participant
    Average

    Bourjour, je commence à travailler sur une stratégie mais ça commence mal.

    sur du 100 ticks.

    pour un long, entré sur un cul plat sortie sur close < open.

    pour un short, entré sur un cul plat sortie sur close > open.

    xClose = (Open+High+Low+Close)/4
    if(barindex>2) then
    xOpen = (xOpen[1] + xClose[1])/2
    endif
    // long
    a5 = xClose>xOpen AND low > xOpen
    if a5 AND Not LongOnMarket then
    BUY 1 SHARE AT MARKET
    endif
    // out long
    b1 = xClose<xOpen
    IF b1 THEN
    SELL AT MARKET
    ENDIF
    
    // short
    c5 = xClose<xOpen AND high < xOpen
    if  c5 AND Not ShortOnMarket then
    SELLSHORT 1 SHARE AT MARKET
    endif
    // out short
    d1 = xClose>xOpen
    IF d1 THEN
    exitshort AT MARKET
    ENDIF

    Un problème dans le code ?

    merci pour vos réponses.

    probleme-backtest-1.png probleme-backtest-1.png
    #178784 quote
    denis aig
    Participant
    Average

    Je recharge le backtest et les sorties sont changées, vraiment je ne comprend pas.

    probleme-backtest-2.png probleme-backtest-2.png
    #178791 quote
    Nicolas
    Keymaster
    Master

    Pour la définition des bougies heikin ashi “cul plat”, voir ce sujet: https://www.prorealcode.com/topic/bougies-heiken-ashi/#post-168435

    je pense en effet qu’il y a un hic à ce niveau.

    Pour mémoire, le code est lu à fin de bougie et les ordres sont lancés à l’ouverture suivante, donc lorsque tu écris “pas de sortie”, en fait si, mais sur la bougie qui suit (à son Open).

    #178828 quote
    denis aig
    Participant
    Average

    Merci pour votre réponse Nicolas.

    oui je sais l’entrée se fait à l’open de la bougie suivante mais regardez sur le graphique posté la sortie ne se fait pas du tout.

    #178835 quote
    Nicolas
    Keymaster
    Master

    Je n’ai pas réussi à reproduire, selon moi tout fonctionne correctement pour les sorties (voir image jointe).

    Lorsqu’il est écrit “2”, cela signifie qu’il y a une entrée et une sortie dans le même chandelier.

    heikin-ashi-strategy.png heikin-ashi-strategy.png
    #178893 quote
    denis aig
    Participant
    Average

    Merci Nicolas, aujourd’hui il me donne les bonnes entrées et sorties

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

Bonjour stratégie Heikin ashi ne respect pas la règle


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
denis aig @denis-aig Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by denis aig
4 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/30/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...