draw an arrow only once

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #216904 quote
    AlexMarlierAlexMarlier
    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
    PeterStPeterSt
    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
    NicolasNicolas
    Keymaster
    Legend

    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.
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

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 NicolasNicolas
3 years, 3 months ago.

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