Simple M.A. Summing Code - Won't compile in MC (Page 2) - EasyLanguage Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming

Simple M.A. Summing Code - Won't compile in MC
Started:August 27th, 2010 (11:40 PM) by bobbakerr Views / Replies:3,453 / 12
Last Reply:July 22nd, 2011 (08:57 AM) Attachments:1

Welcome to

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

Thread Tools Search this Thread

Simple M.A. Summing Code - Won't compile in MC

Old July 21st, 2011, 07:08 PM   #11 (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,447 since Jun 2009
Thanks: 28,848 given, 79,605 received

bretter View Post
EDIT: It turns out that MC does not support the "Switch" statement in the code. I have used Switch instead of If..Then to speed up the code in TS, but it looks like MC does not have that capability! Ouch!

Actually, yes it does support switch/case statements.


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.
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
The following user says Thank You to Big Mike for this post:

Old July 22nd, 2011, 02:41 AM   #12 (permalink)
The Netherlands
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: -
Jura's Avatar
Posts: 766 since Apr 2010
Thanks: 2,347 given, 643 received

Big Mike View Post
Actually, yes it does support switch/case statements.


See for example here:
MultiCharts: Trading Software for Automated Trading and Backtesting • View topic - Function to print the Time Scale in use
MultiCharts: Trading Software for Automated Trading and Backtesting • View topic - Learning SWITCH / CASE

Reply With Quote

Old July 22nd, 2011, 08:57 AM   #13 (permalink)
Elite Member
Austin, TX
Futures Experience: Advanced
Platform: Tradestation
Posts: 16 since Sep 2010
Thanks: 5 given, 12 received

Missing Switch Statement?

Perhaps I spoke too soon on supporting Switch statements. I will go back and try some more when I get a chance. In my particular case, I was using the following:
Switch Var1
   Case True: Code...
   Case False: Code...
In TS, it compiles and works fine. In MC, when I try to compile the indicator, I get the cryptic error:
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)

When I change the case statement to If..Then, it compiles and works fine.

Also in the MC help file, there is no Switch statement listed - see picture.

So, does MC not like Switch statements using boolean variables? And why do you think it is not listed in the help file (Case is not there either)?

Attached Thumbnails
Simple M.A. Summing Code - Won't compile in MC-switch.jpg  
Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > Simple M.A. Summing Code - Won't compile in MC

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need simple code for StochRSI please TraderTom NinjaTrader Programming 5 May 6th, 2014 05:36 PM
MC: Simple strategy code problem / Easy Language true EasyLanguage Programming 4 December 19th, 2010 08:48 AM
Simple 30M Bar Strategy Won't Go vegasfoster NinjaTrader Programming 3 October 23rd, 2010 07:31 PM
How to code a Simple Moving Average? Fat Tails NinjaTrader Programming 5 October 20th, 2010 08:04 PM
Missing something very simple on my code sharp2be NinjaTrader Programming 5 May 22nd, 2010 10:40 PM

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

Copyright © 2016 by 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

Page generated 2016-10-28 in 0.07 seconds with 20 queries on phoenix via your IP