indiquer la condition réalisée avec une flèche

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #230210 quote
    kats
    Participant
    Junior

    Bonjour,

    je souhaite mettre une flèche m’indiquant que la réalisations de la condition est remplie mais uniquement sur le chandelier sur laquelle elle se réalise.

    Cependant la condition est une condition de close supérieur ou inferieur à une autre close sur un indicateur calculé ce qui fait que la flèche se positionne sur la bougie concernée mais également sur toutes les autres bougies qui suivent tant que la condition est vraie.

    Voilà le code que j’utilise:

    if c1 and c3 then
    DRAWARROWUP (barindex,low-slippage)coloured(255,255,0)

    endif
    if c2 and c4 then
    DRAWARROWDOWN (barindex,high+slippage)coloured(255,255,0)
    endif

    Ma question : est il possible de limiter cette indication sur la seule bougie ou la condition se réalise et si oui comment?

     

    Merci d’avance

     

    cdlt

    #230217 quote
    JS
    Participant
    Senior

    Hi,

    You can try this:

    Once Up=0
    Once Down=0
    
    If C1 and C3 and Up=0 then
    DrawArrowUp(BarIndex,Low-Slippage)Coloured(0,255,0)
    Up=1
    Down=0
    EndIf
    
    If C2 and C4 and Down=0 then
    DrawArrowDown(BarIndex,High+Slippage)Coloured(255,0,0) 
    Down=1
    Up=0
    EndIf
    
    kats thanked this post
    #230218 quote
    Iván González
    Moderator
    Master

    Hi!
    You have to create a variable which change when conditions are met first time and this variable will change again when short conditions or exit conditions are met first time.

    // define your conditions
    c1 = close > close[1]
    c2 = high > high[1]
    longconditions = c1 and c2
    
    sh1 = close < close[1]
    sh2 = low < low[1]
    shortconditions = sh1 and sh2
    
    If longconditions and LngArrowOK = 0 THEN
    DRAWARROWUP(barindex, low-0.1*tr) coloured(0,255,0)
    LngArrowOK = 1
    SrtArrowOK = 0
    ELSif shortconditions and SrtArrowOK = 0 THEN
    DRAWARROWDOWN(barindex, high+0.1*tr) coloured(255,0,0)
    LngArrowOK = 0
    SrtArrowOK = 1
    ENDIF
     
    RETURN
    kats thanked this post
    #230226 quote
    kats
    Participant
    Junior

    Bonsoir

    tout d’abord merci pour ces réponses rapides.

    Par contre je n’ai pas compris le second message, est ce que je dois prendre le 1 ou le 2 pour répondre a ma demande svp

     

    Cdlt

    #230227 quote
    JS
    Participant
    Senior

    Hi Kats,

    The answers have crossed each other but basically say the same thing…

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

indiquer la condition réalisée avec une flèche


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
kats @kats Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by JS
1 year, 11 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 03/21/2024
Status: Active
Attachments: No files
Logo Logo
Loading...