Register Login
Overview    May 26, 2013
 
Sessions  | Optimize | Create Custom Portfolios | Translating Systems | Automatic Exchange Rate Conversion  | Realistic Forex Analysis | Trading Plan Overview | Walk–Forward Testing Overview | TradersStudio Professional New Features
 
Show as single page

 

Translating Systems

Translate  

 

 

The TradersStudio® Professional Migration Tool allows you to use existing TradeStation® EasyLanguage code into TradersStudio. This tool translates EasyLanguage code into TradersStudio Basic™, in some rare cases you may have to make small changes to translated code. It translates Systems and Functions, but not Indicators, Paintbars and ShowMe. In most cases, you will be able to take existing EasyLanguage code, using this tool, and run it in TradersStudio without any changes. The migration tool in TradersStudio® Professional is really two tools (a) one for translating code from TradeStation 2000i or lower and (b) other for translating TradeStation 8.X code the online version. TradeStation changed many keywords we have resolved this conflict by developing two different translators.

 

In the rest of this section, we will use the TradeStation 2000i translator. Let's look at a system written in TradeStation EasyLanguage code:

 

{Classic intermarket divergence system
Can go long, short or both and handles both positive and negative intermarket relationships}
Inputs: MkLen(10),InterLen(10),Relate(0),LSB(0);
Vars: MarkInd(0),InterInd(0);
MarkInd=Close-Average(Close,MkLen);
InterInd=Close of data2-Average(Close of data2,InterLen);
If Relate=0 then begin
If InterInd<0 and MarkInd<0 and LSB>=0 then buy at open;
If InterInd>0 and MarkInd>0 and LSB<=0 then sell at open;
If InterInd<0 and MarkInd<0 and LSB=-1 then exitshort at open;
If InterInd>0 and MarkInd>0 and LSB=1 then exitlong at open;
end;
If Relate<>0 then begin
If InterInd>0 and MarkInd<0 and LSB>=0 then buy at open;
If InterInd<0 and MarkInd>0 and LSB<=0 then sell at open;
If InterInd>0 and MarkInd<0 and LSB=-1 then exitshort at open;
If InterInd<0 and MarkInd>0 and LSB=1 then exitlong at open;
end;

 

This code is for an intermarket system that trades using two data streams.

 

Bonds would be in ‘data 1’ and the Commodity Research Bureau Index or silver would be in ‘data 2’. The first parameter to set is the length of the moving average for the market that you are trading and the second parameter is to set the length of the moving average for the intermarket.

(a) If ‘Relate is zero’, the markets are negatively correlated. An example would be silver or the Commodity Research Bureau Index.

(b) If ‘Relate is 1,’ the markets are positively correlated. Another example would be trading the 10-Year Note with the Eurodollars as the intermarket.

 

The next parameter in the system is ‘LSB’ which stands for long, short or both. This is a very simple system, but it is a classic example of TradeStation coding.

 

In the TradersStudio Migration Tool, select the "Translate SYSTEM" radio button because you are translating a system. For the system name, enter "IntermarketTool":

 

 

Translate 1

 

 

Click 'Next', to continue. A new dialog box will appear. Paste the TradeStation EasyLanguage code into the text box that is provided and then click on Next to continue:

 

Translate 2

 

 

In TradeStation, all variables are of the same type and past values can be accessed. This is true for variables like those used in the index of a ‘for loop’. This is unnecessary and wastes memory resources. In TradersStudio, you can decide which variables need to be BarArrays. Since, BarArrays store past values, memory resources are saved and execution of the code is much faster. There are two variables in this piece of code and the TradersStudio Migration Tool will ask which variable needs to be a BarArray. Since neither of them need to access past values, it is not necessary to select any of them as BarArrays:

 

Translate 3

 

Click on OK to continue.  In this step, if you ever have any doubt, select all of the variables to be BarArrays. It will use more memory and make the code process slower, but it will always produce the correct answers.  The code will be translated and displayed:

Translate 4 

The average TradeStation function has two parameters in EasyLanguage, but in the translated code it has three parameters with the third being the length and the offset, which is zero.  The ‘buy’ and ‘sell’ signals are translated.   

There are several ways to take this code and use it in TradersStudio Pro. (a) The first way is to click the ‘Save all the functions to files’ button. You can locate the directory to save the code. (b) Other way is you can also save the file directly to TradersStudio Pro. Click on the ‘Save to TradersStudio’ button, the code will be saved into the Editor.

 

Click on the ‘ExitTranslator’ button to exit the TradersStudio Migration Tool.

 

The migration tool can even translate functions. In addition it can also detect dependent functions and automatically ask for the code for these dependent functions as part of the translation process.


Create Custom Portfolios | Page 4 of 9 | Automatic Exchange Rate Conversion
IMPORTANT NOTICE

If you have updated your browser/windows version, you may have issues with seeing some of the menu items. We are in the process of fixing this bug, but in the meantime please follow these directions below.

It is related to the Compatibility View.
 
Please go to your brower menu to: Tools and click on Compatibility View.

Type TradersStudio.com into the box provided and click add to sites you've added to Compatibility view,  make this change and the website  will show up properly on your PC once you refresh the page. Thank you.

 TradersStudio, Inc. ® Copyright 2004-2013 All Rights Reserved   Terms Of Use  Privacy Statement