Average Highest Lowest indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #116317 quote
    Sever
    Participant
    Average
    //Average value of Highest Close and Lowest Close
    
    ONCE HighestClose = Close[0]
    ONCE HighestMirrorClose = MirrorClose[0]
    
    // Calulate the highest close value
    IF Close >= Close[1] THEN
    IF Close >= HighestClose THEN
    HighestClose = Close
    ENDIF
    ENDIF
    
    // Calculate the difference between the highest close value and close
    DifHighestClose = HighestClose - Close
    
    // Mirror this difference in the highest close value
    MirrorClose = HighestClose + DifHighestClose
    
    // Calculate the highest mirror close value
    
    IF MirrorClose >= MirrorClose[1] THEN
    IF MirrorClose >= HighestMirrorClose THEN
    HighestMirrorClose = MirrorClose
    ENDIF
    ENDIF
    
    // Mirror or rotate the highest mirror close value in/with the highest close value
    LowestClose = HighestClose - (HighestMirrorClose - HighestClose )
    
    // Average of highest close and lowest close
    MidHighestLowest = (HighestClose + LowestClose) / 2
    
    DRAWTEXT("O", barindex, close)coloured(0,0,0)
    
    IF Close[0] >= MidHighestLowest THEN
    r=0
    g=0
    b=255
    ELSE
    r=255
    g=0
    b=0
    ENDIF
    
    RETURN Close coloured(r,g,b), MidHighestLowest
    15785822608lcp4.png 15785822608lcp4.png 15785822608lcp4-1.png 15785822608lcp4-1.png
    #116368 quote
    Nicolas
    Keymaster
    Master

    Thank you Sever, that visually interesting. I moved your post into the forum to discuss about, could you explain a bit how do you calculate that middle line and how you are using it? It seems to be the middle line of highest/lowest Close but for the whole data available on the chart?

    #116391 quote
    Sever
    Participant
    Average

    Yes Nicolas, it is the middle line of the highest close and lowest close for the whole data on the chart.

    You can use it as buy or sell border, gives also a good long term impression of the price range .

    It is most interessant if a price is moving in a range, so you have a good view of the market fluctuations.

    If you want you can adapt the code by setting a percentage above or beneath  the middle line as buy or stop limit.

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

Average Highest Lowest indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Sever @sever Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Sever
6 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/10/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...