Holt EMA

# EasyLanguage Programming

Created November 28th 2010 by cbritton
Updated December 1st 2010 by cbritton
 looks_onecbritton with 2 posts (4 thanks)looks_twotradersheldon with 2 posts (1 thanks) looks_3Big Mike with 1 posts (0 thanks)

 trending_up5,527 viewsthumb_up5 thanks given forum5 repliesattach_file2 attachments

 Welcome to futures io.

# Holt EMA

Atlanta, Georgia

Platform: NT
Broker/Data: DDT
Favorite Futures: ZN, ZB

Posts: 224 since Mar 2010

Holt EMA

Port to EL with color.

Code
 ```input: price(close), gmma(40), alpha(20); vars: mygamma(gmma), myalpha(alpha), b(0); if alpha > 1 then myalpha = 2.0/(alpha+1.0) else myalpha = alpha; if gmma > 1 then mygamma = 2.0/(gmma+1) else mygamma = gmma; If CurrentBar = 1 then begin value1 = price; b = 0.0; end else begin value1 = (1-myalpha)*(value1[1] + b[1]) + myalpha*price; b = (1-mygamma)*b[1] + mygamma*(value1 - value1[1]); end; Plot1( value1, "Rising" ); Plot2( value1, "Falling" ); Plot3( value1, "Neutral" ); Plot4( value1, "HoltEMA", iff(value1=value1[1], GetPlotColor(3), iff(value1>value1[1], GetPlotColor(1), GetPlotColor(2)))); NoPlot(1); NoPlot(2); NoPlot(3);```
Enjoy,
-C

 “Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Attached Thumbnails

 The following 4 users say Thank You to cbritton for this post:

Can you help answer these questions
from other members on futures io?
 What variable is used for TS(transaction size) under Times and Sales?ThinkOrSwim Transferring IRA - Block accounts with NinjatraderReviews of Brokers and Data Feeds UWT AlternativeStocks and ETFs Eurhythmic RSI - A Smoothed Double RSIEasyLanguage Programming Plot line has gaps/disconnected on intraday chartsThinkOrSwim

in the last 7 days on futures io
 ES futures Spoo-nalysis SP500/SPX350 thanks Recession? Depression? Bailout!173 thanks Coronavirus COVID-19168 thanks Is Orderflow An Outdated Concept?164 thanks Gold Futures (GC) main discussion52 thanks

 November 30th, 2010, 08:44 AM #3 (permalink) Elite Member Western Maryland   Trading Experience: Intermediate Platform: Multicharts Broker/Data: Vision Financial (Direct)/ CQG, Rithmic Favorite Futures: Gold, Euro, ES   Posts: 39 since Sep 2010 Thanks: 20 given, 49 received Does someone have the easylanguage/powerlanguage for the collectiveMA indicator? I need this for my Multicharts. Sheldon

Platform: My own custom solution
Favorite Futures: SPX, Emini Futures

Posts: 48,227 since Jun 2009

 Does someone have the easylanguage/powerlanguage for the collectiveMA indicator? I need this for my Multicharts. Sheldon

and also this is not an Elite thread, and that indicator is Elite only.

Post here:

And if someone else hasn't done it already, I have, I just need to dig it up.

Mike

 November 30th, 2010, 08:50 AM #5 (permalink) Elite Member Western Maryland   Trading Experience: Intermediate Platform: Multicharts Broker/Data: Vision Financial (Direct)/ CQG, Rithmic Favorite Futures: Gold, Euro, ES   Posts: 39 since Sep 2010 Thanks: 20 given, 49 received Thank you!
 The following user says Thank You to tradersheldon for this post:

Atlanta, Georgia

Platform: NT
Broker/Data: DDT
Favorite Futures: ZN, ZB

Posts: 224 since Mar 2010

Here's a revised version of this indicator. I split out the algorithm into a function so you can call it directly from another indicator. Also, I added two angle values (in degrees) to the indicator to give a visual cue to the slope of the line. See the attached chart.

The function:

Code
 ```input: price(NumericSeries), gmma(NumericSimple), alpha(NumericSimple); vars: mygamma(gmma), myalpha(alpha), b(0); if alpha > 1 then myalpha = 2.0/(alpha+1.0) else myalpha = alpha; if gmma > 1 then mygamma = 2.0/(gmma+1) else mygamma = gmma; If CurrentBar = 1 then begin value1 = price; b = 0.0; end else begin value1 = (1-myalpha)*(value1[1] + b[1]) + myalpha*price; b = (1-mygamma)*b[1] + mygamma*(value1 - value1[1]); end; HoltEMA = value1;```
The indicator:

Code
 ```input: price(close), gmma(40), alpha(20), angle1(30), angle2(60); vars: mygamma(gmma), myalpha(alpha), b(0), slope(0), debug(1); value1 = HoltEMA(price, gmma, alpha); slope = (arctangent((value1-(value1[1]+value1[2])/2)/1.5/(minmove/pricescale))); condition1 = value1 > value1[1]; condition2 = slope >= angle2; condition3 = slope >= angle1; condition4 = slope <= -1*angle2; condition5 = slope <= -1*angle1; Plot1( value1, "FastRising" ); Plot2( value1, "Rising" ); Plot3( value1, "Neutral" ); Plot4( value1, "Falling" ); Plot5( value1, "FastFalling" ); value2 = iff(condition2, GetPlotColor(1), iff(condition3, GetPlotColor(2), GetPlotColor(3))); value3 = iff(condition4, GetPlotColor(5), iff(condition5, GetPlotColor(4), GetPlotColor(3))); if debug = 1 then begin #beginCmtryOrAlert CommentaryCL(" slope: ", slope); #End; end; Plot6( value1, "HoltEMA", iff(value1 > value1[1], value2, value3)); NoPlot(1); NoPlot(2); NoPlot(3); NoPlot(4); NoPlot(5);```

 “Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Attached Thumbnails

 futures io > Holt EMA

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

Right now

Right now

## Social Media Predictive Data for Traders w/Joe Gits @ SMA [and Lime Brokerage]

Apr 9

 Similar Threads Thread Thread Starter Forum Replies Last Post perryg NinjaTrader 7 January 19th, 2012 08:45 AM websouth The Elite Circle 2 February 19th, 2011 10:08 PM trs3042 NinjaTrader 5 January 13th, 2011 02:28 PM Zoethecus NinjaTrader 2 October 5th, 2010 06:11 PM emini_Holy_Grail Traders Hideout 1 February 22nd, 2010 12:04 PM