NexusFi: Find Your Edge

Home Menu


Hull-DNA (Easylanguage)

Discussion in EasyLanguage Programming

      Top Posters
    1. looks_one Big Mike with 1 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 esam_jir with 1 posts (0 thanks)
    4. looks_4 JVentura with 1 posts (2 thanks)
    1. trending_up 6,693 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 2 attachments

Search this Thread

Hull-DNA (Easylanguage)

(login for full post details)
  #1 (permalink)
JVentura's Avatar
Ventura, California, United St
Experience: Intermediate
Platform: Multicharts
Broker: Open E Cry (OEC)
Trading: RLM, 6E
Posts: 20 since Oct 2010
Thanks Given: 38
Thanks Received: 16

Hi, I have been working on various systems trying to teach myself Easylanguage and reading a bunch of all your posts which is helping a ton; Thanks!
I am a trend follower and don't need to pick tops and bottoms but I want that chunk out of the middle of trend in the safest and most efficient method I can come up with.
So with all that in mind I keep coming back to moving averages of one type or another to clean and smooth but as you know they can lag pretty bad at times.
So I came up with a three moving average system as follows:
Using the Hull Moving averages (for speed) and a simple moving averages as a zero line for overall trend:

Center-line (Zero):
So the Simple MA(Zero Line) is color coded to indicate the location of the closing price via color I have also added an Average True Range cushion around it so when the price gets close to the line you can clearly see it.
A blue dot indicates the closing price is above the slower simple MA and red indicates it's below, if the center line is gray the MA is within the ATR(Middle MA value).

Moving Average (Oscillations/MACD)
The other two moving averages are the Hull Moving averages, In order to have it oscillate I just subtract the hullslowMA from the hullfastMA (MACD).
The coloring of the lines however is as follows if the lines are in contango (i.e. in a rising market fast is on the top, slow is on the bottom and the baseline value is below them) it goes all blue indicating a buy.

I'm still working on a more sound exit strategy I don't believe this system protects enough for the exit side. I am looking at some sort of trailing stop wanting the market to exit the trade

Help: Is it possible in easylanguange to plot a paintbar into window#1, I would like to do it when the MACD crosses over the zeroline.

Like I said I am new to this so if there are best practices to coding what I have done here I would appreciate any feedback...thanks.

---My code---
// Using the Hull Moving average as the fast and slow, went to a standard moving average for the long term (zero line)
Price (close),

SlowHull=_HMA(Price, HullSlow);
FastHull=_HMA(Price, HullFast);

//Center Line Calculation and Coloring
CenterMA= AverageFC(Price, HullCenter);
If close < (CenterMA - var1) then Centercolor = CenterdnColor;
If close > (CenterMA + var1) then Centercolor = CenterUpColor;

If Close = CenterMA then Centercolor = Yellow;
// Calculate Fast and Slow around Centerline
HullMACD= FastHull-SlowHull;

//Contango Using this to define and mark trend when all MA's are H->L in order

If Slowhull<FastHull and Slowhull>CenterMA then Contango=blue;
If Slowhull>Fasthull and slowhull<CenterMA then Contango=Red;

//If Condition1 then PlotPB( High, Low, Open, Close, "Contango", Yellow ) ;
//Would really like to figure out how to plot a Paintbar into Window #1 when HullMACD crosses Centerline

Plot1 (HullMACD,"HullCross", Contango);
Plot2 (HullMACD, "", Contango) ;
Plot3(0,"HullCenter", CenterColor);

Attached Thumbnails
Click image for larger version

Name:	JA-Hull-DNA.png
Views:	589
Size:	190.9 KB
ID:	28389  
Attached Files
Register to download File Type: pla JA-Hull-DNA.pla (7.0 KB, 99 views)
Follow me on Twitter Started this thread Reply With Quote
The following 2 users say Thank You to JVentura for this post:

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
Futures Close-Out Policy
NT7 Indicator Script Troubleshooting - Camarilla Pivots
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Battlestations: Show us your trading desks!
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
25 thanks

(login for full post details)
  #3 (permalink)
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368

Here is an example of painting paintbars. Re-work for your use.

var1 MyFunction(ampnearsmoothingfarsmoothingangle);


var1 and H then PlotPaintBar(HLCO"bar"GetPlotColor(5));
var1 and L then PlotPaintBar(HLCO"bar"GetPlotColor(8));
var1 and L then PlotPaintBar(HLOC"bar"GetPlotColor(6));
var1 and H then PlotPaintBar(HLOC"bar"GetPlotColor(9));

var1 and var1 var1[1then PlotPaintBar(HLOC"bar"GetPlotColor(7));
var1 and var1 var1[1then PlotPaintBar(HLOC"bar"GetPlotColor(7));



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

Quick Links: Change your Username or Register as a Vendor

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive 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

Last Updated on January 13, 2011

© 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