// Code to view result with two decimal only
DefParam DrawOnLastBarOnly = true
Period = (20)
ATR = (AverageTrueRange[Period])
DrawText("ATR(#period#) → #atr#",barindex-20,0.0,SansSerif,Standard,15)
return
Bonjour, comment modifier le code pour ne visualiser que 2 décimales avec cet exemple très simple ?
merci bien
Le langage PRT ne prend pas en charge la troncature, vous pouvez seulement arrondir un nombre à deux décimales (multipliez-le par 100, puis arrondissez-le, puis divisez-le par 100), mais vous verrez toujours les 0.
// Code to view result with two decimal only
DefParam DrawOnLastBarOnly = true
Period = (20)
ATR = (AverageTrueRange[Period])
ATRnd = round(atr*100)/100 // rounded because no troncation
DrawText("ATR(#period#) → #ATRnd#",barindex-20,0.0,SansSerif,Standard,15)
return
merci bien roberto