Although the TradeStation investment package includes a wide selection of trading indicators referred to as analysis techniques, lots of people who make use of TradeStation develop the desire to add or customize their own indicators by means of technical TradeStation code. This document will show the best way to establish a straightforward indicator that shows the current trading volume as well as changes the visible indication of that volume to green when the price closes up.
The most effective way for you to establish a brand-new indicator is to look for an existing indicator which in turn to a degree addresses certain requirements after which you can modify it again even further. For this situation, the Volume indicator that is provided with TradeStation offers a sufficient starting point.
To begin working with TradeStation coding, first open the Volume indicator with the EasyLanguage editor. EasyLanguage is going to be coding language that TradeStation employs. Start with right-clicking on any kind of chart, after which you can opt for Insert Analysis Technique from your pop-up menu. From the dialog box which in turn presents itself, select the Indicator tab, after which you can scroll down to discover the Volume indicator in the listing. Click once over the Volume indicator line to highlight this, after which you can select the Edit EasyLanguage tab underneath the listing box. Any EasyLanguage editor will open with the coding for your Volume indicator all set for any kind of editing.
EasyLanguage code is divided in to three areas. The first block specifies the Inputs. All these inputs are only allowed to be modified through formatting the indicator just after it has been put into your TradeStation table. Following Inputs tend to be the Variables. These initialize once the indicator first launches during the session, plus their values tend to be customized by using coding. After these 2 blocks is the specific code which in turn executes. This is exactly what really needs to be customized for our scenario.
First look for the following series of code:
Plot1( Volume Value, “Volume” ) ;
Sections of code which in turn start with Plot1, Plot2, and so forth, create graphic elements for instance bars and lines on a chart. When it comes to your Volume indicator, this specific section of code plots the value connected with the existing volume for the bar, VolumeValue. This particular value is additionally given the title “Volume” which permits an end user to spot and then modify the style of any plot in the Format Analysis Technique dialog box. However, a user can only change the default widths, colors, and then styles of the plots. To complete our example, code must be modified.
Position the cursor after the line previously mentioned and press Enter on the keyboard to generate a brand-new line. So now enter in the subsequent line of code:
If Close > Open then SetPlotColor(1, Green);
Be sure to add the semicolon at the end of the line, or the code will not verify.
The line just added is actually a conditional statement that says, in simple terminology, if the closing price (Close) of the existing bar is more than the starting price (Open) of the current bar then you should change the plot color (SetPlotColor) of the Plot1 element to Green (1,Green).
Now click the F3 key or alternatively press the Verify tab to compile your code.
Congrats. Your Volume indicator finally plots as being green if price closes on top of the open, and you’ve put together your first TradeStation indicator.
Without doubt, if you want to acquire additional info relating to TradeStation trading, there certainly is a really amazing resource available at Customized Trading that can certainly meet your needs, no matter what they might be at this time. Please make sure to look for more information, now!