I am using Renko bars and made a bubble at the end of every run with a modified total count. How do I add up all the total values of all the bubbles? upFinal and downFinal separated if possible. Thanks
15090[/ATTACH]']
To simplify my question... How do add the previous value and current value of a variable?
15090[/ATTACH]']
Code:
#
#RENKO COUNT
#
def upBar = close > close[1];
def downBar = close < close[1];
def upStart = downBar[1] and upBar;
def upCount = if upStart then 1 else if upBar then upCount[1] + 1 else double.nan;
def upStop = if upBar[1] and downBar then upCount[1] else double.nan;
def upFinal = upStop - 3;
AddChartBubble (upFinal[-1], high, upFinal[-1], color.green);
#def upSum = totalSum(upFinal);
#addlabel (yes, upSum, color.yellow);
def downStart = upBar[1] and downBar;
def downCount = if downStart then 1 else if downBar then downCount[1] + 1 else double.nan;
def downStop = if downBar[1] and upBar then downCount[1] else double.nan;
def downFinal = downStop - 3;
AddChartBubble (downFinal[-1], close, downFinal[-1], color.red);
To simplify my question... How do add the previous value and current value of a variable?
Attachments
Last edited: