convert MACD_ZeroLag Ninja indicator to Multi Charts - futures io
futures io futures trading



convert MACD_ZeroLag Ninja indicator to Multi Charts


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one emini_Holy_Grail with 2 posts (0 thanks)
    2. looks_two cory with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 futuros with 1 posts (0 thanks)
    1. trending_up 3,537 views
    2. thumb_up 5 thanks given
    3. group 5 followers
    1. forum 7 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

convert MACD_ZeroLag Ninja indicator to Multi Charts

(login for full post details)
  #1 (permalink)
Dallas,TX
 
Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker: Zaner/Zen Fire
Trading: ES,6E,6B,GC,CL
 
Posts: 598 since Nov 2009
Thanks: 176 given, 120 received

Can anyone help to convert this Ninja indicator to Multi Charts
MACD_ZeroLag_Colors_BigMike_ctrlbrk.zip

View Download Details - Big Mike's Trading Forum

thks and appreciate it

I am not sure if there is a thread about conversions to Multi Charts

Started this thread Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
 
cbritton's Avatar
 
Posts: 224 since Mar 2010
Thanks: 152 given, 249 received


I have TS, so here's the code you can add to MC.

Zero Lag EMA function. Save it as "_ZeroLagEMA"

 
Code
{
Zero Lag EMA

from the NT version

            EMA ema1 = EMA(Input, Period);
            double difference = ema1[0] - EMA(ema1, Period)[0];
            ZLEMA.Set(ema1[0] + difference);
            
}
input: price(NumericSeries),
        period(NumericSimple);


Value1 = XAverage(price, period);
// diff
Value2 = value1[0] - XAverage(value1, period);
// zlema
Value3 = value1 + value2;

_ZeroLagEMA = value3;
ADXVMA function (also found elsewhere on futures.io (formerly BMT)). Save it as "ADXVMA".

 
Code
// Big Mike Trading https://futures.io
// April 17 2010
// Converted from NinjaTrader version, original author unknown
// Function

inputs:     
    Price (NumericSeries),
    Length (NumericSimple);

vars:
    TR(0),
    DI_Diff(0),
    DI_Sum(0),
    ma(0),
    pdm(0),
    mdm(0),
    pdi(0),
    mdi(0), 
    DI_Factor(0), 
    VI(0), 
    diff(0), 
    HHV(0), 
    LLV(0),
    WeightDM(Length), 
    WeightDI(Length), 
    WeightDX(Length),
    ChandeEMA(Length),
    out(0),
    j(0);

once ma=Price;    

if(Price>Price[1]) then pdm=Price-Price[1] else mdm=Price[1]-Price;//This array is not displayed.

pdm=((WeightDM-1)*pdm[1] + pdm)/WeightDM;//ema.
mdm=((WeightDM-1)*mdm[1] + mdm)/WeightDM;//ema.

TR=pdm+mdm;

if (TR>0) then begin    pdi=pdm/TR; mdi=mdm/TR; end
 else begin
    pdi=0;
    mdi=0;
end;

pdi=((WeightDI-1)*pdi[1] + pdi)/WeightDI;//ema.
mdi=((WeightDI-1)*mdi[1] + mdi)/WeightDI;//ema.
DI_Diff=pdi-mdi;
  
if (DI_Diff<0) then  DI_Diff= -DI_Diff;//Only positive momentum signals are used.

DI_Sum=pdi+mdi;
DI_Factor=0;//Zero case, DI_Diff will also be zero when DI_Sum is zero.

if (DI_Sum>0) then out=DI_Diff/DI_Sum else out=0;

out=((WeightDX-1)*out[1] + out)/WeightDX;
//HHV = highest(out, length+1);
//LLV = lowest(out, length+1);

if (out>out[1]) then begin HHV=out; LLV=out[1]; end 
 else begin
    HHV=out[1];
    LLV=out;
end;

for j = 1 to Length-1 begin    
    if(out[j+1]>HHV)then HHV=out[j+1];
    if(out[j+1]<LLV) then LLV=out[j+1];
end;

diff = HHV - LLV;
VI=0;

if (diff>0) then  VI=(out-LLV)/diff;
          
ma=((ChandeEMA-VI)*ma[1]+VI*Price)/ChandeEMA;//Chande VMA formula with ema built in.

ADXVMA = ma;
The indicator itself.

 
Code
{
MACD using the ZeroLag EMA function and ADXVMA function.
Converted from the NT version on BigMike's
}

input: price(close),
       fast(12),
       slow(26),
       smoothing(9),
       threshold(0),  // amount past zero line it needs to cross to trigger
       acceleration(1);  // 0.5, 1, 1.5, 2.0
vars:
    fastEMA(0),
    diff(0),
    macd1(0),
    macdAvg2(0),
    adxvma1(0),
    signal(0);
    
value1 = fast/acceleration; //
value2 = slow/acceleration; // 
fastEma = _ZeroLagEMA(price, value1) - _ZeroLagEMA(price, value2);

macdAvg2 = _ZeroLagEMA(fastEMA, smoothing);
adxvma1= ADXVMA(fastEMA, value1);
diff = fastEMA - macdAvg2;

Plot1(fastEMA, "MACD");
Plot2(macdAvg2, "Avg");
Plot8(0, "MACD_");
Plot3(diff, "Diff");  //histogram
Plot5(0, "MACD Up");
Plot6(0, "MACD Down");
Plot7(0, "MACD Neutral");

noPlot(5);
noPlot(6);
noPlot(7);

//todo - add alers on the threshold 
if fastEMA > adxvma1 and fastEMA > threshold then begin
    setPlotColor(8, getPlotcolor(5));
end else if fastEMA < adxvma1 and fastEMA < -threshold then begin
    setPlotColor(8, getPlotcolor(6));
end else begin
    setPlotColor(8, getPlotcolor(7));
end;
I did not add the alerts for the signals. If you want it, let me know and I'll add it. Also included a screen shot.

Regards,
-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:	zlmacd_cl.PNG
Views:	241
Size:	51.2 KB
ID:	53491  
Reply With Quote
The following 5 users say Thank You to cbritton for this post:
 
(login for full post details)
  #4 (permalink)
Dallas,TX
 
Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker: Zaner/Zen Fire
Trading: ES,6E,6B,GC,CL
 
Posts: 598 since Nov 2009
Thanks: 176 given, 120 received

cbritton
thks much and really appreciate it.
I will have to reinstall MC in another PC and will let you know about the alerts

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Weston, Florida, USA
 
Experience: Advanced
Platform: Ninja Trader
Trading: ES, CL, TF, 6E, GC
 
Posts: 47 since Oct 2010
Thanks: 47 given, 49 received

Hello big Mike,

Do you or anyone have changed the code for the indicator MACD zero lag colors for Ninja Trader 6.5 to Ninja trader 7.xx?? I've been looking for that indicator every where and couldn't find it.

Thanks,
Alan

Reply With Quote
 
(login for full post details)
  #6 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,029 since Jun 2009
Thanks: 845 given, 7,893 received

a quick search with 'MACD' yielded this

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Versailles, Yvelines France
 
 
Posts: 1 since Jan 2014
Thanks: 0 given, 0 received

Hello Big Mike!

This indicator looks great!
But, I am not able to correct the "Compile error" for both functions in MC:
for "_ZeroLagEMA":
------ Compiled with error(s): ------
Compile error
line 0, column 0

For "ADXVM":
------ Compiled with error(s): ------
Compile error
line 0, column 0

What the hell is it, please?

Thank you very much for your support!

Best regards.

Vinchente

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Vinchente,

maybe your errors are related to this: errLine_0,_errColumn_0,_errLineEnd_0,_errColumnEnd_0. In case this doesn't help you, you will likely have to contact Multicharts support via their chat.

Regards,
ABCTG


Vinchente View Post
Hello Big Mike!

This indicator looks great!
But, I am not able to correct the "Compile error" for both functions in MC:
for "_ZeroLagEMA":
------ Compiled with error(s): ------
Compile error
line 0, column 0

For "ADXVM":
------ Compiled with error(s): ------
Compile error
line 0, column 0

What the hell is it, please?

Thank you very much for your support!

Best regards.

Vinchente


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > convert MACD_ZeroLag Ninja indicator to Multi Charts


Last Updated on January 20, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@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