break even different selon la tranche horaire

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #215626 quote
    gerard66
    Participant
    New

    Bonjour Nicolas
    J utilise un robot DAX 15mn avec break even en 7/100 sur l ensemble du programme
    Est il possible d utiliser un BE different pour chaque tranche horaire

    Ex : pour 12h30 15h30 : BE de 1%
    Pour 15h30 17h30 BE de 0.7%

    Merci de ton aide
    cordialement

    //N1
    TradeTime = (OpenMonth >= 1 and OpenMonth <= 7) or (OpenMonth >= 10 and OpenMonth <= 12)
    TradingDay3 = Opendayofweek = 1 or Opendayofweek = 2 or Opendayofweek = 3 or Opendayofweek = 0 or Opendayofweek = 0
    CtimeAchat3 = time >= 123000 and time < 153000
    HautRange3 = highest[9](high)
    c7 = close > HautRange3[1]
    c8 = close[1] > HautRange3[2]
    c9 = average[55](close) > average[63](close) AND average[63](close) > average[91](close)
    if tradetime and tradingday3 then
    IF c7 and c8 and c9 and CtimeAchat3 and not onmarket THEN
    Buy n shares at market
    SET STOP %LOSS 0.40
    SET TARGET %PROFIT 1.4
    ENDIF
    endif
    
    ////////////////////////////////////////
    //N2
    TradeTime2 = (OpenMonth >= 1 and OpenMonth <= 7) or (OpenMonth >= 10 and OpenMonth <= 12)
    TradingDay5 = Opendayofweek = 1 or Opendayofweek = 2 or Opendayofweek = 0 or Opendayofweek = 0 or Opendayofweek = 5
    CtimeAchat5 = time >= 153000 and time < 173000
    HautRange5 = highest[9](high)
    c10 = close > HautRange5[1]
    c11 = close[1] > HautRange5[2]
    c12 = average[56](close) > average[67](close) AND average[67](close) > average[84](close)
    if tradetime and tradingday5 then
    IF c10 and c11 and c12 and CtimeAchat5 and not onmarket THEN
    Buy n shares at market
    SET STOP %LOSS 0.35
    SET TARGET %PROFIT 1
    ENDIF
    Endif
    
    // mise à breakeven
    if onmarket and positionperf>.7/100 then
    set stop breakeven
    endif
    #215715 quote
    Nicolas
    Keymaster
    Master

    Dans ton code, le breakeven est posé au point d’entrée, SET STOP BREAKEVEN ne modifie pas le prix où sera posé ton “point mort”. Tu l’actives quand ta position a fait 0.7% de gain.

    Si je comprends bien la question tu souhaites modifier le prix de ton point mort ? (breakeven).

    #215720 quote
    gerard66
    Participant
    New

    Ce que je souhaite est de pouvoir choisir un BE different en fonction du trade alors qu actuellement il n y a qu un seul BE de 0.7% par rapport au prix d entree sur l ensemble du programme

    dans mon exemple c est d avoir :

    un BE de 1% sur le trade N1 de 12h30< 15h30

    mais un BE different cad de 0.7% pour le trade N2 de 15h30 <17h30

    cordialement

    #215724 quote
    Nicolas
    Keymaster
    Master

    Je crois que tu n’as bien compris.

    actuellement il n y a qu un seul BE de 0.7% par rapport au prix d entree sur l ensemble du programme

    Actuellement dans ce code, le stoploss est posé au prix d’entrée dés que l’évolution du prix depuis celui-ci est de 0.7%. Dans tous les cas, si le prix revient contre toi, tu ne pourras ni perdre, ni gagner.

    Si tu veux mettre le stoploss à prix d’entrée + 0.7% c’est différent:

    // mise à breakeven
    if onmarket and positionperf>.7/100 then
     set stop price tradeprice+.7/100
    endif

    Ceci étant, il est possible que l’ordre se ferme immédiatement car ici on pose le stoploss à prix d’entrée +0.7% lorsque le prix a atteint cette performance, il faudrait donc autoriser ce déplacement plus loin. J’espère que je suis clair.

    #217149 quote
    RICOU
    Participant
    New

    Bonjour,

    j’ai une question de novice : Comment fonctionne un breakeven et quel en est son intérêt vs le stop loss?

    Par avance merci pour les réponses

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

break even different selon la tranche horaire


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
gerard66 @gerard66 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by RICOU
2 years, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/04/2023
Status: Active
Attachments: No files
Logo Logo
Loading...