Simple M.A. Summing Code - Won't compile in MC - EasyLanguage Programming | futures io social day trading
futures io futures trading


Simple M.A. Summing Code - Won't compile in MC
Updated: Views / Replies:3,982 / 12
Created: by bobbakerr Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 1  
 
Thread Tools Search this Thread
 

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

  #1 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received

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

I read where Big Mike liked using 6 common Moving Averages and then summing them to plot just 1 combined moving average. I wrote some simple code for it, but MC won't compile it. I get the error message:

errLine 13, errColumn 0, errLineEnd 13, errColumnEnd 0
causal study: (Function)


Here is my code:

inputs: Price(Close),L1(9),L2(34),L3(100),L4(20);
variables: s1(0),s2(0),s3(0),s4(0),s5(0),s6(0),SumAll(0);

s1=AverageFC(Price,L1);
s2=AverageFC(Price,L2);
s3=AverageFC(Price,L3);
s4=XAverage(Price,L4);
s5=XAverage(Price,L2);
S6=Xaverage(Price,L3);

SumAll=(s1+s2+s3+s4+s5+s6)/6

if SumAll>0 then begin
Plot1(SumAll,"All",White,default,1);
end;


What have I done wrong? Thanks for any help.

-- Bob

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)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


I don't use mc (yet), but do you need a semi-colon after SumAll=(s1+s2+s3+s4+s5+s6)/6;

Reply With Quote
The following user says Thank You to vegasfoster for this post:
 
  #4 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received

Thank you, vegasfoster. I originally had that in, but in messing around with the code it somehow got left out.

But it still won't compile. I now get the error message:

errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function).

Reply With Quote
 
  #5 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Sorry, not sure.

Reply With Quote
 
  #6 (permalink)
Elite Member
Canada
 
Futures Experience: Beginner
Platform: Multichart
 
Posts: 43 since Feb 2010
Thanks: 7 given, 27 received


bobbakerr View Post
I read where Big Mike liked using 6 common Moving Averages and then summing them to plot just 1 combined moving average. I wrote some simple code for it, but MC won't compile it. I get the error message:

errLine 13, errColumn 0, errLineEnd 13, errColumnEnd 0
causal study: (Function)


Here is my code:

inputs: Price(Close),L1(9),L2(34),L3(100),L4(20);
variables: s1(0),s2(0),s3(0),s4(0),s5(0),s6(0),SumAll(0);

s1=AverageFC(Price,L1);
s2=AverageFC(Price,L2);
s3=AverageFC(Price,L3);
s4=XAverage(Price,L4);
s5=XAverage(Price,L2);
S6=Xaverage(Price,L3);

SumAll=(s1+s2+s3+s4+s5+s6)/6

if SumAll>0 then begin
Plot1(SumAll,"All",White,default,1);
end;


What have I done wrong? Thanks for any help.

-- Bob

 
Code
inputs:Price(Close),L1(9),L2(34),L3(100),L4(20);
variables:s1(0),s2(0),s3(0),s4(0),s5(0),s6(0),SumAll(0);
s1=AverageFC(Price,L1);
s2=AverageFC(Price,L2);
s3=AverageFC(Price,L3);
s4=XAverage(Price,L4);
s5=XAverage(Price,L2);
S6=Xaverage(Price,L3);
SumAll=(s1+s2+s3+s4+s5+s6)/6;
if SumAll>0 then begin
Plot1(SumAll,"All",White,default,1);
end;
It should work I try it and it is working

phil

Reply With Quote
The following 2 users say Thank You to philloo for this post:
 
  #7 (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: 46,238 since Jun 2009
Thanks: 29,350 given, 83,221 received


philloo View Post
 
Code
inputs:Price(Close),L1(9),L2(34),L3(100),L4(20);
variables:s1(0),s2(0),s3(0),s4(0),s5(0),s6(0),SumAll(0);
s1=AverageFC(Price,L1);
s2=AverageFC(Price,L2);
s3=AverageFC(Price,L3);
s4=XAverage(Price,L4);
s5=XAverage(Price,L2);
S6=Xaverage(Price,L3);
SumAll=(s1+s2+s3+s4+s5+s6)/6;
if SumAll>0 then begin
Plot1(SumAll,"All",White,default,1);
end;
It should work I try it and it is working

phil

Works fine for me as well.

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
The following user says Thank You to Big Mike for this post:
 
  #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: 46,238 since Jun 2009
Thanks: 29,350 given, 83,221 received


bobbakerr View Post

errLine 13, errColumn 0, errLineEnd 13, errColumnEnd 0
causal study: (Function)

You seem to have created it as a Function. It should be an indicator.

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
The following user says Thank You to Big Mike for this post:
 
  #9 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received

Thanks philloo and Big Mike. Mike, I clicked on 'New', checked the 'Indicator' box, pasted the code in, compiled it, and it worked. Thanks for your help.

Reply With Quote
 
  #10 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: Tradestation
 
Posts: 16 since Sep 2010
Thanks: 5 given, 12 received

Causal study not compile


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!

Brett

Old below:
I have another code set that works great in TS, but transfer over to MC and I get the compile error - Causal study: (Function).
I have reinstalled... no work.
I have reloaded with making sure Indicator is checked... no work.
I have tried commenting all of the different lines and compiling... no work.
Any ideas?


Last edited by bretter; July 21st, 2011 at 01:27 AM.
Reply With Quote

Reply



futures io > > > > > 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)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

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


All times are GMT -4. The time now is 07:32 AM.

Copyright © 2017 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
Page generated 2017-12-13 in 0.18 seconds with 20 queries on phoenix via your IP 54.196.182.102