Système de flag après prise de position

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #182111 quote
    AredrisAredris
    Participant
    New

    Bonjour !

    Bon, je vous explique mon problème. Après maintes recherche il semblerait que ce soit une question de “flag”…

    Je souhaite réaliser la condition suivante :

    Lorsque j’achète, j’affecte une valeur à X. Tant que X à cette valeur, il m’est impossible de reprendre une position. Dès que le marché remplit une certaine condition, la valeur de X revient à sa valeur initiale et mon robot peut de nouveau prendre position.

    J’ai essayé plusieurs manipulation mais sans succès. Si quelqu’un passe et veut bien me filer un coup de main, ça serait génial

    Merci et bonne journée 🙂

    #182129 quote
    NicolasNicolas
    Keymaster
    Legend

    Il faut donner à X une valeur lorsque tu achètes :

    if MaCondition and NOT LONGONMARKET and x = 0 then 
     X = 1 //ne changera plus tant que AutreCondition n'est pas testé 
     buy at market  
    endf
    
    if AutreCondition and LONGONMARKET then 
     X = 0 //reset du flag X
    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

Système de flag après prise de position


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Aredris @aredris Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 11/23/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...