Connect 3 lows

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #101553 quote
    MerryArter
    Participant
    New

    Hi guy’s !

    I’m able to connect with a segment 2 lows between them by zigzag. Here’s the code :

    zz = zigzag[2](low)
    creux = zz[0]>zz[1]and zz[1]<zz[2]
    b=zz[1]
    
    if creux then
    oldbar=barindex-1
    Price = low[1]
    DRAWARROWUP(oldbar, b-0.1)
    DRAWSEGMENT(oldbar, Price[0], oldbar[1], Price[1])
    endif
    return
    

     

    But now I search to connect 3 lows together with a segment (by zigzag). So if the segment between the lows 1 and 2 and the segment between the lows 2 and 3 have pretty much the same angle then we draw a line connecting the 3 lows.

    How can I do this check ? :/

    Graph.jpg Graph.jpg
    #101573 quote
    Nicolas
    Keymaster
    Master

    Without data arrays, a rough idea is to measure the rate of change (slope) between 2 lows (divide the price distance by the bars quantity between them). If the next slope is in the same range of value (to be defined), then the 2 extreme lows should be aligned.

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

Connect 3 lows


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
MerryArter @merryarter Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
6 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/27/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...