NexusFi: Find Your Edge


Home Menu

 





Holt EMA


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one tradersheldon with 2 posts (1 thanks)
    2. looks_two cbritton with 2 posts (4 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 7,440 views
    2. thumb_up 5 thanks given
    3. group 1 followers
    1. forum 5 posts
    2. attach_file 2 attachments




 
Search this Thread

Holt EMA

  #1 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256

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
Click image for larger version

Name:	holtema.png
Views:	472
Size:	52.2 KB
ID:	26269  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 tradersheldon 
Western Maryland
 
Experience: Intermediate
Platform: Multicharts
Broker: Vision Financial (Direct)/ CQG, Rithmic
Trading: Gold, Euro, ES
Posts: 39 since Sep 2010
Thanks Given: 20
Thanks Received: 50


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

Reply With Quote
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662


tradersheldon View Post
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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 tradersheldon 
Western Maryland
 
Experience: Intermediate
Platform: Multicharts
Broker: Vision Financial (Direct)/ CQG, Rithmic
Trading: Gold, Euro, ES
Posts: 39 since Sep 2010
Thanks Given: 20
Thanks Received: 50

Thank you!

Reply With Quote
Thanked by:
  #6 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256

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
Click image for larger version

Name:	holt_rino.png
Views:	362
Size:	48.1 KB
ID:	26394  
Started this thread Reply With Quote




Last Updated on December 1, 2010


© 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