TS/MC DoubleMA indicator - EasyLanguage Programming | futures.io
futures io futures trading


TS/MC DoubleMA indicator
Started: by ptcm Views / Replies:3,180 / 10
Last Reply: Attachments:1

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


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, and we will never resell your private information.

-- Big Mike

Reply
 1  
 
Thread Tools Search this Thread
 

TS/MC DoubleMA indicator

  #1 (permalink)
Elite Member
Taiwan
 
Futures Experience: Intermediate
Platform: TradeStation
 
Posts: 40 since Jun 2010
Thanks: 6 given, 11 received

TS/MC DoubleMA indicator

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....

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,804 since Jun 2009
Thanks: 29,097 given, 81,382 received


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(Cma1), 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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,804 since Jun 2009
Thanks: 29,097 given, 81,382 received

Here, I went ahead and made it for you.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


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 futures.io (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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Attached Files
Register to download File Type: pla BMT DoubleMA.pla (40.3 KB, 82 views)
Reply With Quote
The following 5 users say Thank You to Big Mike for this post:
 
  #5 (permalink)
Elite Member
Taiwan
 
Futures Experience: Intermediate
Platform: TradeStation
 
Posts: 40 since Jun 2010
Thanks: 6 given, 11 received

DoubleMA

Futures Edge on FIO

What value do you place on the webinars on FIO?

 
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 ?

Reply With Quote
 
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,804 since Jun 2009
Thanks: 29,097 given, 81,382 received


ptcm View Post
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 futures.io (formerly BMT).

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #7 (permalink)
Elite Member
Taiwan
 
Futures Experience: Intermediate
Platform: TradeStation
 
Posts: 40 since Jun 2010
Thanks: 6 given, 11 received

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 ?

Reply With Quote
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,804 since Jun 2009
Thanks: 29,097 given, 81,382 received


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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,804 since Jun 2009
Thanks: 29,097 given, 81,382 received


Big Mike View Post
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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #10 (permalink)
Khellian
Solana Beach, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus -Rythmic
Favorite Futures: CL
 
khellian's Avatar
 
Posts: 7 since Feb 2010
Thanks: 20 given, 2 received

Error Compiling Fuctions


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

Reply With Quote

Reply



futures io > > > > > TS/MC DoubleMA indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only

FIO Video Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

April

Process above all else w/Anthony Crudele @ Futures Radio Show

Elite only

Machine Learning - Quantitative Trading w/Martin Froehler @ Quantiacs

Elite only

Market Dynamics w/Peter Davies @ Jigsaw Trading

Elite only

Ask Me Anything w/Patrick Rooney @ Trading Technologies

Apr 18

Ask Me Anything w/FuturesTrader71

Apr 19

Machine Learning w/Kris Longmore

Elite only

Market Analysis w/Dave Forss

Apr 25

Introducing iSystems with Stage 5 Trading

Apr 27
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
TS/MC: VWAP with standard deviation indicator. marcovth TradeStation 8 November 2nd, 2014 01:29 PM
TS / MC : Basic Indicator Help? Micardo EasyLanguage Programming 2 February 27th, 2011 11:30 AM
MC/TS : Better screen plot shapes NW27 EasyLanguage Programming 1 January 6th, 2011 11:46 PM
MC / TS : Using Subcharts in studies NW27 EasyLanguage Programming 15 January 6th, 2011 11:41 PM
Different results for the same codes running in ts and mc? yoyo2000 NinjaTrader 3 July 16th, 2010 04:14 AM


All times are GMT -4. The time now is 03:49 PM.

no new posts
Page generated 2017-03-28 in 0.12 seconds with 20 queries on phoenix via your IP 54.197.74.137