Déclenchement apres lap de temps fixe

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #183152 quote
    Fabriss
    Participant
    New

    Bonjour à tous,

    Je ne trouve pas ma solution sur la programmation de la vente de ma position.

    Je souhaiterais simplement qu’une position ouverte soit vendue automatiquement apres x bougies.

    Si une position s’ouvre automatiquement à 10h, elle se refermera automatiquement à 12h si je demande un temps de base de 4 bougies pour un timeframe 30mn.

    Un grand merci pour votre aide

    #183154 quote
    Pepsmile
    Participant
    Veteran

    Voilà :

    XbarOut = 4 // à mettre en variable
    
    CondFermerPositions = barindex-tradeindex >= XbarOut
    
    If OnMarket AND CondFermerPositions THEN
    SELL AT MARKET
    EXITSHORT AT MARKET
    ENDIF
    Fabriss thanked this post
    #183207 quote
    Nicolas
    Keymaster
    Master

    Soit une différence entre le BARINDEX courant et le TRADEINDEX, merci @Pepsmile !

    On aurait aussi pu faire une différence en temps avec l’instruction TIMESTAMP .

    #183301 quote
    Fabriss
    Participant
    New

    Merci beaucoup à tous les deux, c’est exactement ce que je cherchais. 🙂

    Passez une excellente journée

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

Déclenchement apres lap de temps fixe


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Fabriss @fabriss Participant
Summary

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

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