nth candle marking

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

    Hi, am trying to create an indicator which marks nth candle (usually 20th, 50th and 200th candle) with an arrow.

    So far, tried DRAWARROWDOWN(barindex -20, close) and DRAWARROWDOWN(20, close) but mixed results….former marks all candles while latter marks all except last 20.

     

    Please help

    #162002 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    If BarIndex is, say, 780, the first one will mark the 20th candle before the current one, while the latter will mark just one candle, the 760th candle before the current one (barindex 20) not ALL candles.

    Of course it depends where you use those instructions, whether inside a loop or not.

    You could mark all candles on the tens boundary, you could write:

    DRAWARROWDOWN((barindex mod 10) = 0, close)
    #162063 quote
    VonasiVonasi
    Moderator
    Master

    If you add:

    defparam drawonlastbaronly = true

    to the top of your indicator then it will only draw the arrow at the n’th candle from the last one on the chart.

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

nth candle marking


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
kaq52 @kaq52 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/19/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...