draw an arrow only once

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #216904 quote
    AlexMarlier
    Participant
    Average

    Hi guys,

    i have coded an indicator which uses arrow and the code makes drawn the arrow couple of times when it is triggered.

    i want just to have the arrow drawn once. how to make it ?

    thanks !

    #216908 quote
    PeterSt
    Participant
    Master

    I think that this will solve your issue. If not, please post a screenshot of it ?

    DefParam DrawOnLastBarOnly = true   // Put on the first line.
    #216919 quote
    Nicolas
    Keymaster
    Master

    Please don’t double post.

    If your code plots multiple times the arrow, it is because your conditions are still fulfilled!

    Without reading your code, there are multiple ways to handle that, but first try by checking if your conditions wasn’t true before the first placement of the arrow:

    conditions = close>average[20] and rsi[14] crosses over 50
    
    if conditions and not conditions[1] then 
     drawarrow(barindex,low)
    endif 
    
    return
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

draw an arrow only once


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/28/2023
Status: Active
Attachments: No files
Logo Logo
Loading...