Detect Date of High/Low in a month

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #196849 quote
    robocop
    Participant
    Average

    good morning, in an indicator that runs in a monthly Timeframe, is possible to know the date on which the Max and Min of that month occurred?

    #196855 quote
    Nicolas
    Keymaster
    Master

    The below code finds and plots in the middle of the chart the monthly high low dates:

    defparam drawonlastbaronly=true 
    
    timeframe(monthly)
    if openmonth<>openmonth[1] then 
    hh=high
    ll=low
    endif
    hh=max(hh,high)
    ll=min(ll,low)
    timeframe(default)
    
    if hh<>hh[1] then
    hhdate=(date/10000)
    endif
    if ll<>ll[1] then
    lldate=(date/10000)
    endif
    drawtext("Monthly high date: #hhdate#",0,0)anchor(middle,xshift,yshift)
    drawtext("Monthly low date: #lldate#",0,-30)anchor(middle,xshift,yshift)
    
    return hh,ll
    #196863 quote
    robocop
    Participant
    Average

    Thank Nicholas, but your code is not exactly what i need.

    Think you are in a monthly graph and you asked to print over the candlestick the date and the price of the max and of the min: how you can detect the two date?

    #196870 quote
    Nicolas
    Keymaster
    Master

    No you can’t do that on a monthly timeframe, we have to zoom in an inferior timeframe like I did in the posted code.

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

Detect Date of High/Low in a month


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
robocop @robocop Participant
Summary

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

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