Quick defining of variable question HMA - ThinkOrSwim Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming

Quick defining of variable question HMA
Started:May 1st, 2014 (12:10 PM) by eclipsemf Views / Replies:326 / 0
Last Reply:May 1st, 2014 (12:10 PM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Quick defining of variable question HMA

Old May 1st, 2014, 12:10 PM   #1 (permalink)
Elite Member
Manchester NH
Futures Experience: Intermediate
Platform: Thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: /ES
Posts: 86 since Feb 2014
Thanks: 28 given, 55 received

Quick defining of variable question HMA

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);

Last edited by eclipsemf; May 1st, 2014 at 12:22 PM.
Reply With Quote


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming > Quick defining of variable question HMA

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question - Daily Open damnpenguins EasyLanguage Programming 4 March 5th, 2014 04:39 PM
Quick Question From Non-NinjaTrader User furytrader NinjaTrader 3 October 8th, 2013 01:05 PM
Quick ninjascript error and question. jtradr NinjaTrader Programming 2 February 16th, 2011 08:25 PM
Quick COBC NinjaTrader Question Fat Tails NinjaTrader Programming 6 December 6th, 2010 12:29 PM
Quick ADXVMA question... BigDog Traders Hideout 6 December 3rd, 2009 09:07 AM

All times are GMT -4. The time now is 09:17 AM.

Copyright © 2016 by futures.io. 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.
no new posts

Page generated 2016-10-27 in 0.06 seconds with 19 queries on phoenix via your IP