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 aigdenis 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 aigdenis 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
    NicolasNicolas
    Keymaster
    Legend

    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 aigdenis 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
    NicolasNicolas
    Keymaster
    Legend

    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 aigdenis 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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 aigdenis aig
5 years ago.

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