NexusFi: Find Your Edge


Home Menu

 





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


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one bobbakerr with 3 posts (0 thanks)
    2. looks_two Big Mike with 3 posts (3 thanks)
    3. looks_3 vegasfoster with 2 posts (1 thanks)
    4. looks_4 bretter with 2 posts (0 thanks)
    1. trending_up 6,612 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 12 posts
    2. attach_file 1 attachments




 
Search this Thread

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

(login for full post details)
  #11 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,233 since Jun 2009
Thanks Given: 33,105
Thanks Received: 101,350


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.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


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


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:

Can you help answer these questions
from other members on NexusFi?
News alerts
Traders Hideout
Request for MACD with option to use different MAs for fa …
NinjaTrader
Volume profile TradeStation
EasyLanguage Programming
Wicked Renko Bars
Traders Hideout
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
37 thanks
Deaddogs Stock Trading
27 thanks
GFIs1 1 DAX trade per day journal
26 thanks
Supertradersams Thread Journal on NQ/MNQ
24 thanks
Leaving CFD trading and learning futures
11 thanks

(login for full post details)
  #12 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


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

True.

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

Reply With Quote
(login for full post details)
  #13 (permalink)
 bretter 
Austin, TX
 
Experience: Advanced
Platform: Tradestation
Posts: 16 since Sep 2010
Thanks Given: 5
Thanks Received: 12


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:
 
Code
Switch Var1
Begin
   Case True: Code...
   Case False: Code...
End;
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
Click image for larger version

Name:	Switch.JPG
Views:	140
Size:	62.9 KB
ID:	44231  
Reply With Quote





Last Updated on July 22, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts