Help, Tradestation code cannot compile in MC - EasyLanguage Programming | futures io social day trading
futures io futures trading


Help, Tradestation code cannot compile in MC
Updated: Views / Replies:1,287 / 7
Created: by mwkl2011 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
 
Thread Tools Search this Thread
 

Help, Tradestation code cannot compile in MC

  #1 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Beginner
Platform: TWS, seeking an autotrade platform
Favorite Futures: ES
 
mwkl2011's Avatar
 
Posts: 3 since Jul 2012
Thanks: 4 given, 0 received

Help, Tradestation code cannot compile in MC

I got a TS RC Beginner strategy and want to do the back test in MC but it just won't compile in MC.
Do I need to make some code conversion?
If yes where can I find like conversion table?
The TS code are as follows, thanks

Inputs:
PriceES(Close of Data1),
PriceNDQ(Close of Data2);
Vars: StopLoss(12), Stop_Width(0), Stop_Price(0);
Vars: StartTimeMins(0), EndTimeMins(0), LastTradeMins(0), Tmins(0);
if CurrentBar=1 then
begin
StartTimeMins = TimeToMinutes(Sess1StartTime)+40; //09:10
LastTradeMins = TimeToMinutes(Sess1EndTime)-25; //14:50
EndTimeMins = TimeToMinutes(Sess1EndTime)-15; //15:00
end;
Tmins = TimeToMinutes (Time);
Vars: ESYDC(0), NDQYDC(0), Started(FALSE);
Vars: ESLevel(0), NDQLevel(0);
if Date<>Date[1] then
begin
ESYDC = PriceES[1];
NDQYDC = PriceNDQ[1];
Started = TRUE;
end;
if Started then
begin
ESLevel = Close-ESYDC;
NDQLevel = PriceNDQ-NDQYDC;
end;
Vars: Priority(false), NDQ(0), NoTrade(false);
Vars: Trade1(false), Trade3(false), Trade4(false), Trade5(false);
Vars: Trade6(false), Trade8(false), Trade9(false), Trade10(false);
if Date<>Date[1] then
begin
Priority = false;
NoTrade = false;
Trade1 = false;
Trade3 = false;
Trade4 = false;
Trade5 = false;
Trade6 = false;
Trade8 = false;
Trade9 = false;
Trade10 = false;
end;
if Tmins = StartTimeMins then
begin
{condition 1}
if ESLevel >= 0 and ESLevel < 10 and NDQLevel >= 0 and NDQLevel
< 10 and NDQLevel >= ESLevel then Trade1 = true
{condition 2}
else if ESLevel >= 0 and ESLevel < 10 and NDQLevel >= 0 and
NDQLevel < 10 and ESLevel > NDQLevel then NoTrade = true
{condition 3}
else if ESLevel < 0 and ESLevel > -10 and NDQLevel < 0 and
NDQLevel > -10 and NDQLevel <= ESLevel then Trade3 = true
{condition 4}
else if ESLevel < 0 and ESLevel > -10 and NDQLevel < 0 and
NDQLevel > -10 and ESLevel < NDQLevel then
begin
Sell Short(“Short 4”)this bar on close;
Priority = true;
Stop_Width = StopLoss;
end
{condition 5}
else if ESLevel >= 0 and ESLevel < 10 and NDQLevel < 0 and
NDQLevel > -10 then Trade5 = true
{condition 6}
else if ESLevel < 0 and ESLevel > -10 and NDQLevel >= 0 and
NDQLevel < 10 then Trade6 = true
{condition 7}
else if ESLevel < 0 and ESLevel > -10 and NDQLevel <= -10 then
NoTrade = true
{condition 8}
else if ESLevel >= 0 and ESLevel < 10 and NDQLevel >= 10 then
begin
NDQ = NDQLevel;
Trade8 = true;
End
{condition 9}
else if ESLevel <= -10 and NDQLevel <= -10 then
begin
NDQ = NDQLevel;
Trade9 = true;
End
{condition 10}
else if ESLevel >= 10 and NDQLevel >= 10 then
begin
NDQ = NDQLevel;
Trade10 = true;
end;
end;
if Tmins >= StartTimeMins and Tmins <= LastTradeMins and
Priority = false then
begin
{condition 1}
if NDQLevel <= -13 and Trade1 then
begin
Sell Short(“Short 1”)this bar on close;
Trade1 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 2 = No Trade}
{condition 3}
if NDQLevel <= -13 and Trade3 then
begin
Sell Short(“Short 3”)this bar on close;
Trade3 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 5}
if ESLevel >= 2 and NDQLevel >= 13 and Trade5 then
begin
Buy(“Long 5”)this bar on close;
Trade5 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 6}
if ESLevel <= -2 and NDQLevel <= -13 and Trade6 then
begin
Sell Short(“Short 6”)this bar on close;
Trade6 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 7 = No Trade}
{condition 8}
if NDQLevel-NDQ >= 10 and Trade8 then
begin
Buy(“Long 8”)this bar on close;
Trade8 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 9}
if NDQ-NDQLevel >= 10 and Trade9 then
begin
Sell Short(“Short 9”)this bar on close;
Trade9 = false;
Priority = true;
Stop_Width = StopLoss;
end;
{condition 10}
if NDQLevel-NDQ >= 10 and Trade10 then
begin
Buy(“Long 10”)this bar on close;
Trade10 = false;
Priority = true;
Stop_Width = StopLoss;
end;
end;
if MarketPosition = 1 then
begin
Stop_Price = EntryPrice - Stop_Width;
Sell (“L-Exit”) next bar Stop_Price Stop;
end;
if MarketPosition = -1 then
begin
Stop_Price = EntryPrice + Stop_Width;
buy to cover (“S-Exit”) next bar Stop_Price
Stop;
end;
if Tmins >= EndTimeMins then
begin
Sell(“Long Close”) this bar on close;
Buy to Cover(“Short Close”) this bar on close;
end;

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)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received


don't just say "won't compile in MC.".

why?
what was the error message?

please copy and paste it here.



ps. learn to use code tag.

Reply With Quote
The following 3 users say Thank You to Bimi for this post:
 
  #4 (permalink)
Elite Member
Colorado
 
Futures Experience: Advanced
Platform: MultiCharts
Broker/Data: IB & Iqfeed
Favorite Futures: ES , CL
 
sptrader's Avatar
 
Posts: 533 since Apr 2010
Thanks: 1,080 given, 668 received

try this- attachment..
the problem was with the formatting around the strings "short-1" etc and "Long-1" etc..

Attached Files
Register to download File Type: pla _MC TS Code.pla (12.1 KB, 14 views)
Reply With Quote
The following 2 users say Thank You to sptrader for this post:
 
  #5 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Beginner
Platform: TWS, seeking an autotrade platform
Favorite Futures: ES
 
mwkl2011's Avatar
 
Posts: 3 since Jul 2012
Thanks: 4 given, 0 received

Thank you Sp & Bimi.

SPtarder, you file work, I can compile it now, thanks.

Bimi, what do you mean by 'learn to use code tag'?
When I compile the file an error message shown:

------ Compiled with error(s): ------
incorrect input type
errLine 2, errColumn 8, errLineEnd 2, errColumnEnd 22
causal study: (Function)

and it seems point to the first sentence "PriceES(Close of Data1)," so I tried to change it but to no avail.
Sorry I'm a newbie at the very beginning to try to use it (without programing background). Thanks both of you.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Beginner
Platform: TWS, seeking an autotrade platform
Favorite Futures: ES
 
mwkl2011's Avatar
 
Posts: 3 since Jul 2012
Thanks: 4 given, 0 received

A question arise here,

Inputs:
PriceES(Close of Data1),
PriceNDQ(Close of data2);

if I change it to

Inputs:
PriceES(CloseD of Data1),
PriceNDQ(CloseD of data2);

or

Inputs:
PriceES(prevClose of Data1),
PriceNDQ(prevClose of data2);

what's the difference between the above cases?
Thanks.

Reply With Quote
 
  #7 (permalink)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received


mwkl2011 View Post
Thank you Sp & Bimi.

SPtarder, you file work, I can compile it now, thanks.

Bimi, what do you mean by 'learn to use code tag'?
When I compile the file an error message shown:

------ Compiled with error(s): ------
incorrect input type
errLine 2, errColumn 8, errLineEnd 2, errColumnEnd 22
causal study: (Function)

and it seems point to the first sentence "PriceES(Close of Data1)," so I tried to change it but to no avail.
Sorry I'm a newbie at the very beginning to try to use it (without programing background). Thanks both of you.

no problem, we all started as a beginner.

it is important to include error messages when asking for help, so that people do not have to do the investigation from square one.

code tag is the
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
icon at the top of the message window.

tagged codes look like this:

 
Code
Inputs:
PriceES(Close of Data1),
PriceNDQ(Close of data2);


Last edited by Bimi; July 20th, 2012 at 03:46 PM.
Reply With Quote
The following user says Thank You to Bimi for this post:
 
  #8 (permalink)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received


mwkl2011 View Post
A question arise here,

 
Code
Inputs:
PriceES(Close of Data1),
PriceNDQ(Close of data2);
refers to the close of each bar.

 
Code
Inputs:
PriceES(CloseD of Data1),
PriceNDQ(CloseD of data2);
refers to the close of each day on an intraday chart.
closeD will scan the whole day and pick out the closing price of the day.

 
Code
Inputs:
PriceES(prevClose of Data1),
PriceNDQ(prevClose of data2);
don't know about this one.

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

Reply



futures io > > > > > Help, Tradestation code cannot compile in MC

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
compile help TS eld for MC aczk MultiCharts 1 June 12th, 2012 11:40 PM
Tradestation to MC transition... RM99 MultiCharts 10 July 23rd, 2011 06:35 AM
Simple M.A. Summing Code - Won't compile in MC bobbakerr EasyLanguage Programming 12 July 22nd, 2011 09:57 AM
Tradestation Vs Ninja Vs Cqg Vs Matlab Vs MC David111 The Elite Circle 3 March 5th, 2011 12:22 PM
Code a T3 indicator for TradeStation daveste99 EasyLanguage Programming 5 September 14th, 2010 03:09 PM


All times are GMT -4. The time now is 06:45 PM.

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-16 in 0.13 seconds with 20 queries on phoenix via your IP 54.145.16.43