Hello,
to see sma’s values on price axis, while still keeping only horizontal lines of latest value visible rather than history:
defparam DRAWONLASTBARONLY=true
sma20=Average[20](close)
sma50=Average[50](close)
sma200=Average[200](close)
DRAWHLINE(sma20)coloured(0,0,204) style(line,2)
//drawtext(sma20,barindex+15,sma20,sansserif,standard,15) coloured(0,0,204)
DRAWHLINE(sma50)coloured(204,0,0) style(line,2)
//drawtext(sma50,barindex+15,sma50,sansserif,standard,15) coloured(204,0,0)
DRAWHLINE(sma200)coloured(0,102,51) style(line,2)
//drawtext(sma200,barindex+15,sma200,sansserif,standard,15) coloured(0,102,51)
return sma20 coloured(0,0,0,0), sma50 coloured(0,0,0,0), sma200 coloured(0,0,0,0)