graphic help with drawarrow with conditions

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #82145 quote
    fredericlebre
    Participant
    Junior

    hi,

    please, could you help me to undersand where is my mistake ?

    i would like to draw an arrow on my graph only when low(3)>low(2) and low(1)>low(2) on price and stochastic at the same time. see attached graph, it works fine in the first graph, but why does it work too on sevond graph ?

     

    here is the code :

    // initialisation variables
    
    finprix=0
    finsto=0
    posfinprix=0
    posfinsto=0
    
    // Calcul des pics de fin
    
    if ( (low[3]>low[2]) and (low[1]>low[2]) and (Stochastic[14,3](close[3])>Stochastic[14,3](close[2])) and (Stochastic[14,3](close[1])>Stochastic[14,3](close[2])) ) then
    finprix=low[2]
    finsto=Stochastic[14,3](close[2])
    posfinprix=barindex[2]
    posfinsto=barindex[2]
    endif
    
    if finprix>0 and finsto>0 and posfinsto>0 then
    DRAWARROWUP(posfinprix,finprix)coloured(255,10,10,255)
    endif
    
    return
    Capture-d’écran-2018-10-06-à-14.26.14.png Capture-d’écran-2018-10-06-à-14.26.14.png Capture-d’écran-2018-10-06-à-14.26.28.png Capture-d’écran-2018-10-06-à-14.26.28.png
    #82240 quote
    Nicolas
    Keymaster
    Master

    I moved your topic in the right section of the programming forum.

    Please use the insert code button, each time you want to post code in a forum message.

    Could you explain why the arrow should not be triggered in the second image? If it does, it is obviously because your conditions are true.

    Some coding tips: to refer to a previous value, you should use this syntax:

    Stochastic[14,3](close)[3]>Stochastic[14,3](close)[2]
    #169984 quote
    Timothy
    Participant
    New

    Is it possible to adjust the size of “drawarrow” in pro builder?

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

graphic help with drawarrow with conditions


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 1 voice, and was last updated by Timothy
4 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/06/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...