Skip to content

Instantly share code, notes, and snippets.

@wesyoung
Created October 3, 2013 13:24
Show Gist options
  • Save wesyoung/6809776 to your computer and use it in GitHub Desktop.
Save wesyoung/6809776 to your computer and use it in GitHub Desktop.
tos-price-percentile
# Shah H. Development 2013
input length = 10;
input price = close;
input pricePercentUP = 5.0;
input pricePercentDOWN = -5.0;
def PercentChg = Round(100 * (price / price[length] - 1), 2);
AddLabel(1, Concat ("% Price Chng:", PercentChg ),if percentChg >= pricePercentUP then color.dark_green else if percentChg <= pricePercentDOWN then color.red else color.gray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment