comment assimiler un breakeven different par strategie ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #160575 quote
    magiclil
    Participant
    Average

    Bonjour Nicolas,

    Mon bot a 5 stratégies “differentes” pour prendre position en achat.

    J’aimerais configurer un break-even different par strategies.

    exemple avec 2 stratagies differentes :

    if L1 and Ltime and not onmarket then
    buy nlot contract at market
    SET STOP pLOSS 25
    SET TARGET pPROFIT 75
    endif
    
    if L2 and Ltime and not onmarket then
    buy nlot contract at market
    SET STOP pLOSS 20
    SET TARGET pPROFIT 60
    endif
    
    longbreakeven = 1
    longbreakevenstart = 40
    longbreakevenstep = 15
    
    IF longbreakeven = 1 AND LONGONMARKET AND close - tradeprice(1) >= longbreakevenstart THEN
    longBE = tradeprice(1) + longbreakevenstep
    ENDIF
    IF longBE > 0 THEN
    SELL AT longBE STOP
    ENDIF
    IF NOT ONMARKET THEN
    longBE = 0
    ENDIF

    Ce breakeven va s’activer de la meme facon pour les 2 strategies differentes et j’aimerais en configurer un different pour chacun des 2 stratégies.
    Je pourrais ainsi faire de meme pour les 5 stratégies differentes.

    Merci

    #160734 quote
    magiclil
    Participant
    Average

    une idée les gens?

    #160793 quote
    Nicolas
    Keymaster
    Master

    Si la stratégie ne permet qu’à une seule de tes stratégies de fonctionner à la fois, alors tu peux tagger quelle stratégie est en cours en renseignant une variable au moment où tu passes ton ordre:

    if L1 and Ltime and not onmarket then
     buy nlot contract at market
     SET STOP pLOSS 25
     SET TARGET pPROFIT 75
     strategie = 1
    endif
    
    if L2 and Ltime and not onmarket then
     buy nlot contract at market
     SET STOP pLOSS 20
     SET TARGET pPROFIT 60
     strategie = 2
    endif
    
    
    longbreakeven = 1
    
    if strategie=1 then 
     longbreakevenstart = 40
     longbreakevenstep = 15
    elsif strategie = 2 then 
     longbreakevenstart = 20
     longbreakevenstep = 5
    elsif strategie = 3 then 
     // etc....
    endif
    
    magiclil thanked this post
    #160804 quote
    magiclil
    Participant
    Average

    génial ! merci encore Nicolas.

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

comment assimiler un breakeven different par strategie ?


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
magiclil @magiclil Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by magiclil
5 years, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/07/2021
Status: Active
Attachments: No files
Logo Logo
Loading...