How to round a number that results from an equation?
I had chat GBT right this.
Im having trouble getting the "shares" result to be a round number
input length = 14;
def dailyAtr = reference ATR(length);
def atrDividedBy4 = dailyAtr / 4;
def result = round(10 / atrDividedBy4);
# Plotting the result of ATR / 4 as a chart label on the 1-minute chart
AddLabel(yes, "STOP: " + AsText(atrDividedBy4, NumberFormat.TWO_DECIMAL_PLACES), Color.GREEN);
AddLabel(yes, "SHARES: " + AsText(result), Color.CYAN);
I had chat GBT right this.
Im having trouble getting the "shares" result to be a round number
input length = 14;
def dailyAtr = reference ATR(length);
def atrDividedBy4 = dailyAtr / 4;
def result = round(10 / atrDividedBy4);
# Plotting the result of ATR / 4 as a chart label on the 1-minute chart
AddLabel(yes, "STOP: " + AsText(atrDividedBy4, NumberFormat.TWO_DECIMAL_PLACES), Color.GREEN);
AddLabel(yes, "SHARES: " + AsText(result), Color.CYAN);