Skip to content

Instantly share code, notes, and snippets.

@trepidity
Created February 7, 2021 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trepidity/051d2232e267773e2a975ceb77ba14fc to your computer and use it in GitHub Desktop.
Save trepidity/051d2232e267773e2a975ceb77ba14fc to your computer and use it in GitHub Desktop.
Thinkorswim HullMovingAvg
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below
input price = close;
input length = 20;
input WithinBars = 1;
def hma = HullMovingAvg(price,length);
def TriglableBull = hma[1]<hma[2] and hma>hma[1];
def TriglableBear = hma[1]>hma[2]and hma < hma[1];
def trigger = TriglableBear or TriglableBull;
addlabel(yes,if triglableBear then "bear" else if TriglableBull then "Bull" else " ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment