Detect Date of High/Low in a month

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #196849 quote
    robocoprobocop
    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
    NicolasNicolas
    Keymaster
    Legend

    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
    monthy-high-low-date.png monthy-high-low-date.png
    #196863 quote
    robocoprobocop
    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
    NicolasNicolas
    Keymaster
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 NicolasNicolas
4 years, 2 months ago.

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