As far as I know, there is no (standard) PRT object available for this…
You can use Ivan’s indicator and set the number of days via the number of units used…
Additionally, you can have the indicator draw two extra lines for the start and end points…
//-------------------------------------------------------//
//PRC_CAGR and Growth rate
//version = 1
//22.03.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//-------------------------------------------------------//
//-----Inputs--------------------------------------------//
defparam drawonlastbaronly = true
FinValue = Close[0]
IniValue = close[barindex]
//-------------------------------------------------------//
//-----Calculate number of periods-----------------------//
tm = gettimeframe
if tm > 86400 then
period = barindex
else
if day <> day[1] then
period = 1+period
else
period = period
endif
endif
//-------------------------------------------------------//
//---Check timeframe for CAGR calculation----------------//
if tm = 2592000 then //monthly timeframe
n = 12
drawtext("Period: #period# months",-100,+60)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
elsif tm = 604800 then //weekly timeframe
n = 52
drawtext("Period: #period# weeks",-100,+60)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
elsif tm <=86400 then //Other timeframes (daily or less)
n = 252
drawtext("Period: #period# days",-100,+60)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
else
drawtext("Period: #period# bars",-100,+60)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
endif
//-------------------------------------------------------//
//-----CAGR and Growth Rate------------------------------//
if barindex < n then
CAGR = undefined
else
CAGR = round((POW((FinValue/IniValue),(n/period))-1)*100,2)
GR = round((FinValue / IniValue - 1) * 100,2)
endif
//-------------------------------------------------------//
//-----Plot----------------------------------------------//
if tm=2592000 or tm=604800 or tm<=86400 then
drawtext("Growth rate: #GR# %",-100,100)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
drawtext("CAGR: #CAGR# %",-100,+80)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
drawrectangle(-200,110,-10,50)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )fillcolor("blue",50)
else
drawtext("Growth rate: #GR# %",-100,100)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )
drawrectangle(-200,110,-10,50)anchor(BOTTOMRIGHT ,XSHIFT ,YSHIFT )fillcolor("blue",50)
endif
//-------------------------------------------------------//
DrawHLine(Close[0])
DrawHLine(Open[BarIndex])
return