NexusFi: Find Your Edge


Home Menu

 





Quick defining of variable question HMA


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,279 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Quick defining of variable question HMA

  #1 (permalink)
 eclipsemf 
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);

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on May 1, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts