Help creating a drawline indicator

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

    How would i go about creating a drawline that draws a line from the 20 period moving average 20 periods ago to the current moving average 20 periods. and have it update (re-draw the line) every new period. Without causing infite lines drawn issue?

    willi thanked this post
    #163039 quote
    robertogozzi
    Moderator
    Master

    There you go (not tested):

    Defparam DrawOnLastBarOnly = True
    MA20 = average[20,0](close)
    Drawsegment(Barindex[19],MA20[19],BarIndex,MA20)
    Return
    willi thanked this post
    #163052 quote
    RobinJK
    Participant
    Junior

    Thank you, very helpfull.
    haha i really complicated things.

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

Help creating a drawline indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
RobinJK @robinjk Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by RobinJK
4 years, 11 months ago.

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