NexusFi: Find Your Edge


Home Menu

 





Hull-DNA (Easylanguage)


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one esam_jir with 1 posts (0 thanks)
    2. looks_two JVentura with 1 posts (2 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 6,741 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)

  #1 (permalink)
 
JVentura's Avatar
 JVentura 
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.

Exiting:
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)
//
inputs:
Price (close),
HullFast(13),
HullSlow(34),
HullCenter(55),
CenterUpColor(blue),
CenterDnColor(Red);
Variables:
SlowHull(0),
FastHull(0),
CenterMA(0),
CenterColor(Black),
HullMACD(0),
Contango(Darkgray),
var1(0);

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

//Center Line Calculation and Coloring
CenterMA= AverageFC(Price, HullCenter);
var1=AvgTrueRange(Hullslow);
CenterColor=darkgray;
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
Contango=darkgray;

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

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

Attached Thumbnails
Click image for larger version

Name:	JA-Hull-DNA.png
Views:	593
Size:	190.9 KB
ID:	28389  
Attached Files
Elite Membership required to download: JA-Hull-DNA.pla
Follow me on Twitter Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
 
  #3 (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,469 since Jun 2009
Thanks Given: 33,249
Thanks Received: 101,669


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

 
Code
                            
var1 MyFunction(ampnearsmoothingfarsmoothingangle);


PlotPaintBar(HLOC"bar"GetPlotColor(7));

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

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

Plot5(var1"Rising");
Plot6(var1"Falling");
Plot7(var1"Neutral");
Plot8(var1"RisingLC");
Plot9(var1"FallingHC");

NoPlot(5);
NoPlot(6);
NoPlot(7);
NoPlot(8);
NoPlot(9); 
Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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




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