Manchester NH
Experience: Advanced
Platform: Thinkorswim
Broker: TD Ameritrade
Trading: Small Caps
Posts: 90 since Feb 2014
Thanks Given: 31
Thanks Received: 55
|
I got it all figured out! The second I posted this I I figured it out, I had a brain fart, ill leave it up for other people to use if they wish, its is still not perfect and rings when ever its seems to want but it is getting closer ill keep it updated as I work on it
I'm setting up an indicator to work off of sounds alerts for easy use. My only problem I am having trouble defining a variable for it and not sure where to go with it. Here's what I have so far and I have made this work on other indicators but this is an upper indicator so I'm not sure if it will work the same. There area in red is what I need help with defining the change from when HMA > HMA[1] changes to HMA < HMA[1]. Thanks for the help
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"));
def SELL = HMA < HMA[1] ;
def BUY = HMA > HMA[1] ;
alert(SELL, "SELL", Alert.BAR, Sound.Ding);
alert(BUY, "BUY", Alert.BAR, Sound.Ring);
|