zigzag support resistance

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #65275 quote
    Real Pro
    Participant
    Average

    Hello,

    I have searched the forums but cannot find what I need.  Please tell me if it exists somewhere already.

    I want horizontal support/resistance lines plotted from the zig/zag turning points.  I’d like them plotted up to the point that they are crossed by the closing price.

    I’d be much obliged if someone could help.  Cheers.

    #65276 quote
    Real Pro
    Participant
    Average

    I have the following, but you can see the line needs to continue until close>line, and it doesn’t do that.

    I’m sure it just needs a little tweak but I can’t figure out what it is.

     

    percentVariation = (i)
    
    ww = ZigZag[percentVariation](close)
    
    peak = ww<ww[1] and ww[1]>ww[2]
    trough = ww>ww[1] and ww[1]<ww[2]
    
    IF trough THEN
    support=low
    ENDIF
    
    IF peak THEN
    resistance=high
    ENDIF
    
    support=min(low,support)
    resistance=max(high,resistance)
    
    RETURN support as "support", resistance as "resistance"
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

zigzag support resistance


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Real Pro @real-pro Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Real Pro
7 years, 11 months ago.

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