Coder un ordre stop qui reste valable sur plusieurs barres

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #121368 quote
    midelmidel
    Participant
    Senior

    Bonjour,

    J’ai ce code sur une stratégie 1 minute qui s’annule après la bougie suivante, si pas exécuté. Or, je voudrais que ces ordres restent effectifs sur les 5 bougies suivantes. Comment coder cela ?

    if cond1  and cond2 then
    buy 1 contract at prix stop
    
    elsif cond3 and cond4 then
    sellshort1 contract at prix stop
    
    endif

     

    #121372 quote
    NicolasNicolas
    Keymaster
    Legend

    Enregistrer le BARINDEX et faire une condition basée sur une soustraction avec celui courant :

    if cond1  and cond2 then
     buybar = barindex
    elsif cond3 and cond4 then
     sellbar = barindex
    endif
    
    if barindex-buybar<=5 then 
     buy 1 contract at prix stop
    endif 
    
    if barindex-sellbar<=5 then 
     sellshort1 contract at prix stop
    endif
Viewing 2 posts - 1 through 2 (of 2 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

Coder un ordre stop qui reste valable sur plusieurs barres


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
midel @midel Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
6 years, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/06/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...