Test du Range important pour ne pas prendre position

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #206289 quote
    trading2trading2
    Participant
    Junior
    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // INIT 
    BigRange = 0        // Est ce comme ceci ???
    
    // *********************************     Indicateurs   ***************************************//
    //Stop Suiveur Baissier
    c1=highest[3](high)+1/3*AverageTrueRange[20](close)
    StopSuiveurBaissier=lowest[10](c1)
    // Bande de Bollinger Inferieure
    BollInf20 = Average[20](close)-2*std[20](close)
    
    //******     Conditions pour OUVRIR une position Short   ******************* //
    HA = close < BollInf20
    
    
    // -----------   TEST DU BIG RANGE -------------- //
    
    IF   (Open - Close ) > 50   AND HA  THEN
    BigRange = 1
    ENDIF
    //----------------------------------------------//
    
    
    // Conditions pour FERMER une position Short
    FermShort = Close CROSSES OVER StopSuiveurBaissier
    
    
     // ******     OUVERTURE POSITION SHORT ************* //
    
    //IF HA AND NOT BigRange and Not SHORTONMARKET THEN
    IF HA AND NOT BigRange AND  NOT SHORTONMARKET THEN
    SELLSHORT 1 SHARES AT MARKET
    ENDIF
    
    // ******     FERMETURE  POSITION SHORT ************* //
    
    
    IF FermShort AND SHORTONMARKET THEN
    EXITSHORT AT MARKET
    ENDIF

    Bonjour à tous,
    Je souhaiterai ne pas du tout prendre de position Short si sur la 1er bougie qui respecte les conditions d’ouverture il y a un range important. soit [(ouverture – cloture ) > 50 points] . Y compris durant les bougies d’apres qui respectent les conditions d’ouverture .
    J’utilise un Flag BigRange qui passe à 1 pour empecher de prendre une position et je souhaiterai que ce Flag re passe à 0 lorsque les conditions ( theorique dans ce cas) de fermeture sont presentes de manière à pouvoir ouvrir une positions quand les conditions seront de nouveau présente .
    J’ai crée le flag mais cela fait juste décaler d’1 barre la bougie d’ouverture et je ne sais pas comment passer ce falg à O quand le close croise à la hausse le Stop suiveur baissier . Je ne sais pas non plus comment initialiser la variable BigRange.
    Ci attaché graphes expliquant ce que je souhaite faire.
    Si je ne suis pas clair n’hesitez pas à me le dire.
    Vous remerciant à l’avance pour votre aide

    SANS-le-test-du-Big-Range.png SANS-le-test-du-Big-Range.png Avec-test-du-BigRange-et-ce-que-je-souhaite.png Avec-test-du-BigRange-et-ce-que-je-souhaite.png
    #206780 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Bjr, a priori, tu peux modifier la ligne 5 en:

    once bigrange=0

    pour que ce soit initialisé seulement, pas remis à remis à chaque bougie,

    et ajouter juste après la ligne 27:

    if fermshort then
      bigrange=0
    endif

    pour que ce soit remis à zéro quand fermshort est vrai

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

Test du Range important pour ne pas prendre position


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
trading2 @trading2 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JC_BywanJC_Bywan
3 years, 10 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 12/24/2022
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...