Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated October 6, 2016
Top Posters
looks_one
Big Mike
with 5 posts (5 thanks)
looks_two
ptcm
with 3 posts (0 thanks)
looks_3
khellian
with 2 posts (0 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
8,108 views
thumb_up
5 thanks given
group
2 followers
forum
10 posts
attach_file
1 attachments
August 6th, 2010, 06:22 AM
Taiwan
Experience: Intermediate
Platform: MC
Posts: 77 since Jun 2010
Thanks Given: 8
Thanks Received: 17
Hello everyone,
I am trying to write the TS/MC codes for a doubleMA (pls see below, the same one big mike has on the August 28, 2009 video)
Big Mike's Trading Blog: videos
Does anyone have any idea on that ?
Basically, I want the MA to be blue if >20ma and red if <20ma.
many thanks....
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
August 6th, 2010, 06:38 AM
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,719 since Jun 2009
Thanks Given: 33,450
Thanks Received: 102,340
The main difference with doing it in EasyLanguage is MultiCharts (or TradeStation) doesn't have a drop-down menu system to select enums, so it is less user friendly for situations where you have a lot of settings.
But the NT version of DoubleMA is really quite convoluted, it can be written very simply:
Code
vars :
doublema ( 0 );
doublema = Average ( XAverage ( C , ma1 ), ma2 );
In English it simply means Average (SMA ) of the XAverage (EMA).
Plotting different colors for rising or falling is not hard. I'm sure I've listed examples already on the forum in this section.
You'll want to use a switch () to give the indicator options of defining what type of MA to use, like case 0 = sma, case 1 = ema, case 2 = zerolagema, etc etc.
Mike
August 6th, 2010, 06:54 AM
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,719 since Jun 2009
Thanks Given: 33,450
Thanks Received: 102,340
Here, I went ahead and made it for you.
[img]https://nexusfi.com/v/rrxmfp.png[/img]
[img]https://nexusfi.com/v/a3ksy4.png[/img]
[img]https://nexusfi.com/v/tkmne3.png[/img]
Attached is the MultiCharts .pla. Below is the EasyLanguage code.
Code
// 6 August 2010
// Big Mike Trading
// www.bigmiketrading.com
// Note: Comment out the moving averages you don't have, or visit nexusfi.com (formerly BMT) to get them
inputs:
ma1type ( 0 ),
ma2type ( 0 ),
ma1length ( 100 ),
ma2length ( 20 );
vars:
ma2series ( 0 ),
dma ( 0 );
switch ma2type begin
default : ma2series = Average(C, ma2length);
case 0 : ma2series = Average(C, ma2length);
case 1 : ma2series = XAverage(C, ma2length);
case 2 : ma2series = WAverage(C, ma2length);
case 3 : ma2series = ADXVMA(C, ma2length);
case 4 : ma2series = jtHMA(C, ma2length);
case 5 : ma2series = PMA(C, ma2length, 0, 1);
case 6 : ma2series = ZeroLagEMA(C, ma2length);
case 7 : ma2series = ZeroLagWMA(C, ma2length);
end;
switch ma1type begin
default : dma = Average(ma2series, ma1length);
case 0 : dma = Average(ma2series, ma1length);
case 1 : dma = XAverage(ma2series, ma1length);
case 2 : dma = WAverage(ma2series, ma1length);
case 3 : dma = ADXVMA(ma2series, ma1length);
case 4 : dma = jtHMA(ma2series, ma1length);
case 5 : dma = PMA(ma2series, ma1length, 0, 1);
case 6 : dma = ZeroLagEMA(ma2series, ma1length);
case 7 : dma = ZeroLagWMA(ma2series, ma1length);
end;
Plot1( dma, "Rising" );
Plot2( dma, "Falling" );
Plot3( dma, "Neutral" );
Plot4( dma, "DoubleMA", iff(dma=dma[1], GetPlotColor(3), iff(dma>dma[1], GetPlotColor(1), GetPlotColor(2))) ) ;
NoPlot(1);
NoPlot(2);
NoPlot(3);
Mike
Attached Files
Elite Membership required to download: BMT DoubleMA.pla
August 7th, 2010, 10:41 AM
Taiwan
Experience: Intermediate
Platform: MC
Posts: 77 since Jun 2010
Thanks Given: 8
Thanks Received: 17
Hello BM,
thanks a lot for your quick response. I was trying to compile the code, but I got stuck at
"case 3 : ma2series = ADXVMA (C, ma2length);"
any idea why ? is ADXVMA a proprietary function ?
August 7th, 2010, 05:14 PM
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,719 since Jun 2009
Thanks Given: 33,450
Thanks Received: 102,340
ptcm
Hello BM,
thanks a lot for your quick response. I was trying to compile the code, but I got stuck at
"case 3 : ma2series =
ADXVMA (C, ma2length);"
any idea why ? is ADXVMA a proprietary function ?
Yes, please read the top section of the code, you will see I said to comment out the ones you do not have, or you can use the search feature and find them on NexusFi (formerly BMT ).
Mike
October 10th, 2010, 01:27 PM
Taiwan
Experience: Intermediate
Platform: MC
Posts: 77 since Jun 2010
Thanks Given: 8
Thanks Received: 17
I am getting error on this line when compiling.
"Plot4( dma, "DoubleMA", iff(dma=dma[1], GetPlotColor(3), iff(dma>dma[1], GetPlotColor(1), GetPlotColor(2))) ;"
------ Compiled with error(s): ------
syntax error, unexpected ';', expecting ')'
errLine 99, errColumn 108, errLineEnd 99, errColumnEnd 108
why is that ? Can anyone help please ?
October 10th, 2010, 01:36 PM
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,719 since Jun 2009
Thanks Given: 33,450
Thanks Received: 102,340
ptcm
I am getting error on this line when compiling.
"Plot4( dma, "DoubleMA", iff(dma=dma[1], GetPlotColor(3), iff(dma>dma[1], GetPlotColor(1), GetPlotColor(2))) ;"
------ Compiled with error(s): ------
syntax error, unexpected ';', expecting ')'
errLine 99, errColumn 108, errLineEnd 99, errColumnEnd 108
why is that ? Can anyone help please ?
At first glance, looks like you are missing one ) at the end of the sentence before the semicolon, like the error says "Expecting ')' not ';'".
Add another ) after GetPlotColor(2) and before ;
Mike
October 10th, 2010, 01:38 PM
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,719 since Jun 2009
Thanks Given: 33,450
Thanks Received: 102,340
Big Mike
At first glance, looks like you are missing one ) at the end of the sentence before the semicolon, like the error says
"Expecting ')' not ';'".
Add another ) after GetPlotColor(2) and before ;
Mike
I looked again at the code I posted, for some reason one of the parenthesis-semicolon was converted to a smilie, so when you cut/pasted it broke it probably. I fixed it now.
Mike
October 6th, 2016, 02:49 PM
Rio Rancho, NM
Experience: Intermediate
Platform: NinjaTrader
Broker: Ninja
Trading: CL , NQ
Posts: 18 since Feb 2010
Thanks Given: 30
Thanks Received: 4
I'm moving over to MC64 Release Version 9.1 from NT so was glad to see this port. I downloaded the indicator and all the functions associated with it but when I attempted to compile the functions there was a compile error:
--------------------------------
06.10.16 11:43:55
------ Build started: ------
Study: "ZeroLagEMA" (Function)
Please wait ....
------ Compiled with error(s): ------
Compile error
line 0, column 0
---------------------------------
(Line 0, Column 0) threw me I must admit. As I'm new to EasyLanguage I would greatly appreciate any thoughts or suggestions.
Thanks
Last Updated on October 6, 2016