trader des stratégies différentes sur un meme algo x fois par jour

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

    Bonjour Nicolas,

    Pour rappel, ma stratégie est composé de plusieurs stratégies à l’achat avec des break even différents.

    J’aimerais désormais que le robot trade mes differentes stratégies x fois par jour.

    A titre d’exemple, j’aimerais que L1 puisse rentrer 1 fois par jour maximum sur 24h.
    L2 2 fois par jour.
    L3 1 fois par jour.

    ect…
    Une idée ? Merci beaucoup.

    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
    #161604 quote
    Nicolas
    Keymaster
    Master

    Idem que précédemment, utilise simplement une variable dans laquelle tu indiques que ta stratégie a déjà lancé un ordre et test si cette variable est supérieur à 0 ou pas. Il ne faudra pas oublier de remettre à zéro ces variables chaque jour.

    if intradaybarindex=0 then //le jour se lève, on reset nos stratégies
     trade1=0
     trade2=0
     //etc ..
    endif
    
    if L1 and Ltime and not onmarket and trade1=0 then //déjà tradé ??
     buy nlot contract at market
     SET STOP pLOSS 25
     SET TARGET pPROFIT 75
     strategie = 1
     trade1 = 1 //ordre exécuté aujourd'hui
    endif
     
    if L2 and Ltime and not onmarket and trade2=0 then //déjà tradé ??
     buy nlot contract at market
     SET STOP pLOSS 20
     SET TARGET pPROFIT 60
     strategie = 2
     trade2= 1 //ordre exécuté aujourd'hui
    endif
    magiclil thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

trader des stratégies différentes sur un meme algo x fois par jour


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
magiclil @magiclil Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
5 years ago.

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