TP sur Bollinger Middle

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #119724 quote
    juju333
    Participant
    Average

    Bonjour,

    J’ai honte de demander de l’aide sur ce sujet, j’arrive à faire ce genre de choses tout seul normalement, mais là je ne comprends pas pourquoi ça ne fonctionne pas !

    Voir sur le schéma ci-joint et le code ci-dessous, très simple :

    Admettons que j’entre short sur la bougie rouge qui suit la blanche qui a cloturé au-dessus de la Bollinger supérieure, je cherche tout simplement à définir mon tp auto sur la Bollinger middle (soit la MM20), et mon SL équivalent à 2 fois ce TP (je sais, RR pas beau, mais c’est pour l’exemple). Je fais donc la différence entre tradeprice et MM20 pour avoir mon TP en points, que je multiplie par 2 pour avoir mon SL en points. Proorder se comporte comme si mon TP n’était jamais atteint.

    Je précise que je suis sur le forex, alors j’ai essayé avec *pipsize, *pointsize, mais sans succès. Un grand merci pour votre aide, ça doit être très facile pour la plupart d’entre vous ^^

    bollUp = BollingerUp[20](Close)
    bollDown = BollingerDown[20] (Close)
    bollMid = Average[20](Close)
    
    signalShort = Close < bollUp 
    signalLong = Close > bollDown 
    
    //achat
    IF signalLong THEN
    BUY 1 CONTRACT AT MARKET
    TPlong = (bollMid - tradeprice) * pipsize
    set STOP pLOSS 2*TPLong
    set TARGET pPROFIT TPlong
    ENDIF
    
    //vente
    IF signalShort THEN
    SELLSHORT 1 CONTRACT AT MARKET
    TPshort = (tradeprice - bollMid) *pipsize
    set STOP pLOSS 2*TPshort
    set TARGET pPROFIT TPshort
    ENDIF
    BOL_TP.png BOL_TP.png
    #119727 quote
    fifi743
    Participant
    Master
    bollUp = BollingerUp[20](Close)
    bollDown = BollingerDown[20] (Close)
    bollMid = Average[20](Close)
     
    signalShort = Close < bollUp 
    signalLong = Close > bollDown 
     
    //achat
    IF signalLong THEN
    BUY 1 CONTRACT AT MARKET
    TPlong = (bollMid - tradeprice)/ pipsize
    set STOP pLOSS 2*TPLong
    set TARGET pPROFIT TPlong
    ENDIF
     
    //vente
    IF signalShort THEN
    SELLSHORT 1 CONTRACT AT MARKET
    TPshort = (tradeprice - bollMid) /pipsize
    set STOP pLOSS 2*TPshort
    set TARGET pPROFIT TPshort
    ENDIF

    bonjour,
    essayer comme ecrit si dessus
    quand tu additionne de nombre a virgule . pour avoir un nombre entier tu les divises par pointsize

    Nicolas thanked this post
    #119740 quote
    juju333
    Participant
    Average

    Merci fifi pour ton regard mais non ça ne change rien… Toujours pas de TP ni de SL exécuté.

    #119742 quote
    fifi743
    Participant
    Master

    je test

    #119743 quote
    fifi743
    Participant
    Master

    j’ai pas testé mais

    change tradeprice par close

    #119744 quote
    fifi743
    Participant
    Master

    j’ai testé sur Nasdaq 5 minute et ça marche

    #119746 quote
    juju333
    Participant
    Average

    Merci pour ton aide je regarderai demain matin !

    #119750 quote
    juju333
    Participant
    Average
    Merci pour ton aide fifi, en effet avec le close et en gérant mieux l’ordre des instructions ça marche ! Voici le code, une fois qu’on a défini ce qui déclenche le signal long ou short :
    // ACHAT
    IF not onmarket AND signalLong THEN
    SLlong = (Average[20] - Close) * 2.5 / pipsize
    TPlong = (Average[20] - Close) / pipsize
    BUY 1 CONTRACT AT MARKET
    set STOP pLOSS SLlong
    set TARGET pPROFIT TPlong
    ENDIF
    
    // vente
    IF not onmarket AND signalShort THEN
    TPshort = (Close - Average[20]) / pipsize
    SLshort = (Close - Average[20]) * 2.5 / pipsize
    SELLSHORT 1 CONTRACT AT MARKET
    set STOP pLOSS SLshort
    set TARGET pPROFIT TPshort
    ENDIF
    
    fifi743 thanked this post
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

TP sur Bollinger Middle


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
juju333 @juju333 Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by juju333
6 years ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/16/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...