Hey! I would like to turn the default thinkorswim Hull moving average into a custom strategy. Whenever the color of the hull moving average slope changes its color from up / down I’d like the strategy to open / close an order only on the close of the candle / bar. In addition I would like an alert to pop up whenever all of the conditions are met. I'm not much of a coder myself so hopefully this isn't too complicated...
Here is the default thinkorswim HullMovingAvg code:
Here is the default thinkorswim HullMovingAvg code:
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2008-2020
#
input price = close;
input length = 20;
input displace = 0;
plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace];
HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));