Sleep trading pendant 6 périodes

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #208872 quote
    barzag
    Participant
    New

    Bonjour, je suis à la recherche d’une fonction qui puisse stopper mon trading automatisé pour une durée de 9 périodes, soit 9*5 minutes.

    Mon objectif est d’arrêter temporairement le trading lorsqu’une position est clôturée, que ce soit avec un bénéfice ou une perte, pour une durée de 45 minutes avant de le relancer.

    Avez-vous une suggestion pour y parvenir ?

    #208897 quote
    Nicolas
    Keymaster
    Master

    On teste si on a été au marché dans la barre précédente et que nous n’y sommes plus, et si oui on enregistre le BARINDEX, qu’on utilisera dans une condition pour ouvrir une nouvelle position:

    if not onmarket and onmarket[1] then 
     bar = barindex
    endif 
    
    if CONDITIONSachats and barindex-bar>=9 then 
     // J'ACHETE !
    endif

    On peut aussi tester le temps avec un TIMESTAMP (en secondes, soit 45min * 60s = 2700s) :

    if not onmarket and onmarket[1] then 
     lasttime = timestamp
    endif 
    
    if CONDITIONSachats and timestamp-lasttime>=2700 then 
     // J'ACHETE !
    endif
    #209250 quote
    barzag
    Participant
    New

    Super merci 😉

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

Sleep trading pendant 6 périodes


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
barzag @barzag Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by barzag
3 years ago.

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