Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated July 22, 2011
Top Posters
looks_one
bobbakerr
with 3 posts (0 thanks)
looks_two
Big Mike
with 3 posts (3 thanks)
looks_3
vegasfoster
with 2 posts (1 thanks)
looks_4
bretter
with 2 posts (0 thanks)
trending_up
7,126 views
thumb_up
6 thanks given
group
3 followers
forum
12 posts
attach_file
1 attachments
August 27th, 2010, 11:40 PM
Riverdale, Idaho, USA
Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker: Optimus Futures, Rithmic Data, TradeStation
Trading: CL, ES
Posts: 115 since Aug 2010
Thanks Given: 241
Thanks Received: 51
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
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
August 27th, 2010, 11:46 PM
las vegas
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844
I don't use mc (yet), but do you need a semi-colon after SumAll=(s1+s2+s3+s4+s5+s6)/6;
August 27th, 2010, 11:52 PM
Riverdale, Idaho, USA
Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker: Optimus Futures, Rithmic Data, TradeStation
Trading: CL, ES
Posts: 115 since Aug 2010
Thanks Given: 241
Thanks Received: 51
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).
August 28th, 2010, 12:03 AM
las vegas
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844
Sorry, not sure.
August 28th, 2010, 12:09 AM
Canada
Experience: Beginner
Platform: Multichart
Posts: 43 since Feb 2010
Thanks Given: 7
Thanks Received: 27
bobbakerr
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
August 28th, 2010, 12:40 AM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,617 since Jun 2009
Thanks Given: 33,331
Thanks Received: 101,930
philloo
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
August 28th, 2010, 12:41 AM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,617 since Jun 2009
Thanks Given: 33,331
Thanks Received: 101,930
bobbakerr
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
August 28th, 2010, 10:00 AM
Riverdale, Idaho, USA
Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker: Optimus Futures, Rithmic Data, TradeStation
Trading: CL, ES
Posts: 115 since Aug 2010
Thanks Given: 241
Thanks Received: 51
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.
July 20th, 2011, 11:10 PM
Austin, TX
Experience: Advanced
Platform: Tradestation
Posts: 16 since Sep 2010
Thanks Given: 5
Thanks Received: 12
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 Updated on July 22, 2011