Double MA and Triple MA Script - futures io
futures io futures trading



Double MA and Triple MA Script


Discussion in NinjaTrader

Updated by RJay
      Top Posters
    1. looks_one Sadboybh with 3 posts (0 thanks)
    2. looks_two cory with 2 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,090 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 8 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

Double MA and Triple MA Script

(login for full post details)
  #1 (permalink)
Bahrain
 
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received

Hi guys,
I am trying to make a script that consists of 2 original SMA indicators , I tried so many ways to duplicate the original but it didn't work out for me..

I would highly appreciate it if someone can tell me how to make a double or triple version of the original SMA.

one more thing: Can I set the value of one SMA to CalculateOnBarClose = false, and the other one to CalculateOnBarClose = true !!!

Thanks...

Reply With Quote

Can you help answer these questions
from other members on futures io?
SC parameter optimization
Sierra Chart
Is TradeStation for me?
TradeStation
Range bar differences in Tradestation vs. TOS
TradeStation
Do You Have A PlayBooks/What Form Does It Take?
Traders Hideout
Macros for flatten and reverse
TradeStation
 
 
(login for full post details)
  #3 (permalink)
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,000 since Jun 2009
Thanks: 831 given, 7,837 received


is this NT7? just specify MA of MA of MA you don't need any script.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,067 since Jun 2009
Thanks: 31,674 given, 95,176 received


Sadboybh View Post
I would highly appreciate it if someone can tell me how to make a double or triple version of the original SMA.

 
Code
                            
#init

private double dsma;

#onbarupdate
dsma SMA(SMA(Close20), 100); 
Will give you a double sma.


Quoting 
one more thing: Can I set the value of one SMA to CalculateOnBarClose = false, and the other one to CalculateOnBarClose = true !!!

No.

Mike

We're here to help -- just ask

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #5 (permalink)
Bahrain
 
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received


Big Mike View Post
 
Code
                            
#init
private double dsma;

#onbarupdate
dsma SMA(SMA(Close20), 100); 
Will give you a double sma.



No.

Mike

thank you mike,
but if i set the previous code, how will i be able to customize each plots characteristics, for example if i wanna add a condition that changes the 20SMA color when it crosses above the 100SMA !!

if both SMAs has one defined variable which is private double dsma, how will i be able to change each SMA's separately ? what's the unique definition for the 20SMA ? and whats is for the 100SMA ?

thanks in advance

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Bahrain
 
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received

plus it keeps on telling me that cannot convert ninjatrader.type.indicator.SMA to double !!!!


any other thoughts bro ?

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,067 since Jun 2009
Thanks: 31,674 given, 95,176 received


Sadboybh View Post
plus it keeps on telling me that cannot convert ninjatrader.type.indicator.SMA to double !!!!


any other thoughts bro ?

Type-o in my code. I haven't used NT in 18 months, give me a small break Add [0] to end to reference DataSeries.

 
Code
                            
dsma SMA(SMA(Close20), 100)[0]; 



Sadboybh View Post
thank you mike,
but if i set the previous code, how will i be able to customize each plots characteristics, for example if i wanna add a condition that changes the 20SMA color when it crosses above the 100SMA !!

if both SMAs has one defined variable which is private double dsma, how will i be able to change each SMA's separately ? what's the unique definition for the 20SMA ? and whats is for the 100SMA ?

thanks in advance

Try watching @sam028's basic intro webinar on NT programming which covers multi color plots:


And/or @shodson's NT webinar which gives you the basic building blocks of C#:


Or look at any one of the hundreds of indicators on futures.io (formerly BMT) that have multicolor plots and look at the code and learn. Try also buying some C# books to get you started.

Mike

We're here to help -- just ask

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #8 (permalink)
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,000 since Jun 2009
Thanks: 831 given, 7,837 received

or search for double or triple
https://futures.io/search/attachments/

Reply With Quote
 
(login for full post details)
  #9 (permalink)
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 686 since Jun 2009
Thanks: 746 given, 775 received

or just look at NT's TRIX indicator for code on building a triple MA.

Reply With Quote
The following user says Thank You to RJay for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Double MA and Triple MA Script


June 17, 2011


Upcoming Webinars and Events
     



Copyright © 2020 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