Tutorial 193 | Activity Bars | TradeStation EasyLanguage tutorials and programs
Tutorial 193 takes another look at TradeStation ActivityBars (see also Markplex tutorial 133: https://markplex.com/free-tutorials/tutorial-133-displaying-trade-at-bid-and-ask-data-using-activitybars/.)
Activity bars allow the user to analyze a bar ("activity bar") smaller than the current bar. In this tutorial the 'big' bars are set to daily, with the analysis being made on one minute bars ("activity bars").
Specifically the tutorial analyzes the Commodity Channel Index (CCI) effectively applied to the smaller interval (one minute bars) and looks for "zero rejections" i.e. the CCI get close (or slightly crosses the zero line, depending on the inputs we use, but then moves back in the same directions it came from.
Tutorial 193 also looks for divergence between price and the CCI.
In either case, if an incidence of a zero rejection or a potential divergence occurs, an activity bars is drawn for the price range in which it occurred.
The tutorial includes two methods:
LegacyColorFromColObject: takes the name of a color and converts it into an integer which can be used in the AB_AddCellRange statement.
NewBar: this method is called for each activity bar. Most of the functionality is concerned with looking for divergences and zero rejections. If found AB_AddCellRange adds an activity bar. The method includes functionality to get a label value from a string. It also get the color value from a TokenList containing specific names of colors from the Color class.
See the tutorial page: https://markplex.com/free-tutorials/tutorial-193-activitybar-study-showing-cci-zero-rejection-and-divergence/
7
views
Quick-tip 86 | Basic TradeStation RadarScreen screener | EasyLanguage tutorials and programs
Quick-tip 86 demonstrates a simple indicator for TradeStation Radarscreen that has 3 columns: 3 input columns and one column that displays “buy” or “sell” depending on the price of the last trade.
The user inputs a “top” price, a “bottom” price and an adjustment amount (input: Near).
A further column displays "BUY" or "SELL" depending on the last price and the user inputs.
17
views
Tutorial 192 | Anchored VWAP (estimated)
Tutorial 192 demonstrates how to create an Anchored Volume Weighted Average Price (estimated) indicator.
The Volume Weighted Average Price or VWAP is calculated by summing the volume multiplied by price, summing the volume and then dividing the former by the latter. This is an estimated value because the calculation is assuming that all the volume occurs at the ‘price’, by default this is set to the average price for the bar. The ‘anchored’ means that the line is calculated from the bar that was clicked (compared to being calculated from the beginning of the day, or the start of a new session).
The tutorial program can be downloaded for free by Gold Pass members at the tutorial page (make sure you are logged in):
https://markplex.com/free-tutorials/tutorial-192-anchored-vwap-estimated/
If you are interested in Gold Pass visit: https://markplex.com/markplex-membership/ for the details.
5
views
Tutorial 191 | Information panel based on daily data
Tutorial 191 demonstrates how to create a program to display a panel of information about another symbol.
https://markplex.com/free-tutorials/tutorial-191-information-panel-based-on-daily-data/
The information displayed includes the symbol name, closing price, daily volume and the Relative Strength Index (RSI) calculated using daily data from a Price Series Provider (PSP). In the example shown above, the indicator is applied 5 times as part of a ‘study group.’
The program uses the PSP to provide the data for a symbol different from the charted symbol. The tutorial also demonstrates a way of calculating the RSI value using this PSP data.
Technical Lessons
Technically, the tutorial program 91 is based around a price series provider (PSP). Because we are interested in daily information about a symbol, the PSP is the simplest way of achieving this. The PSP and an associated event were originally created using the toolbox and then the code copied from the ‘designer generated code.’ The calculation is similar to the standard RSI function, however care needs to be taken about the calculation that occurs at the end of each PSP bar.
The tutorial program also demonstrates how to create a label using 'Composite Formatting' and how to keep it stationary relative to the chart frame.
3
views
Quick-tip 85 | Average daily volume on non daily bar type
I was asked how to show a daily average on a non daily interval for RadarScreen. For example, you might have a 5 minute bar interval but you want to show the average of volume for the last 5 days.
This quick-tip demonstrates how this can be achieved using the TradeStation price series provider.
See the quick tip page here: https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-85-average-daily-volume-on-non-daily-bar-type/
Gold Pass members can download the program for free on the quick-tip page (above).
1
view
Quick-tip 84 | Setting default inputs
In quick-tip 84 I discuss setting default inputs.
It is important to know that for a program applied to a chart, the inputs in the code of the program and those being used by the program at the moment (the ‘applied inputs’ ) are not necessarily the same. For example, if you apply a strategy and then optimize it, the applied inputs are likely to change from the default inputs in the program.
https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-84-changing-default-inputs/
4
views
Tutorial 190 | Markplex Centered Moving Average Envelope | EasyLanguage tutorials and programs
Tutorial 190 (based on tutorial 174) demonstrates how to write Markplex’s version of the Centered Moving Average (CMA) Envelope using TradeStation EasyLanguage. A centered moving average is placed at the center of the time period it is averaging rather than the end of it. This positions the moving average values at their central positions in time.
A disadvantage of the CMA is that because the values are displaced there are a number of bars at the end of the chart where there are not a sufficient number of future bars to calculate the average.
This tutorial demonstrates one approach to estimating the average for the last bars by replacing “missing” bars with the price of the last bar and then re-calculating and re-plotting the last few bars whenever the close is updated. The earliest bar of the estimate remains on the chart after a new bar develops.
See the tutorial page for more information and downloads: https://markplex.com/free-tutorials/tutorial-190-markplex-centered-moving-average-envelope/
6
views
Tutorial 189 | Find most recent bar with low greater than current high
Tutorial 189 takes the high of the last completed bar and searches back in time for the most recent bar where the low of that bar is greater than the high of the last completed bar.
The bar that meets this criteria is then plotted over using PlotPB or alternatively is highlighted by drawing trendlines between its high and low and open and close.
https://markplex.com/free-tutorials/tutorial-189-find-most-recent-bar-with-low-greater-than-current-high/
9
views
EasyLanguage quick-tip 82 | 'selecting' bars using a drawing tool
TradeStation EasyLanguage Quick-tip 82 uses a paint bar study to detect when the user has drawn a rectangle on the chart to 'select' bars. It plots the consecutive bars indicated by the rectangle and calculates the high and low values of the range. These values are added to the chart as text objects.
The quick-tip uses the same technique used in tutorial 188 to select bars. This quick-tip does not do the volume analysis.
See https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-82-selecting-bars-using-a-paintbar-study/
19
views
TradeStation EasyLanguage quick-tip 81
TradeStation EasyLanguage Quick-tip 81 shows how to find and plot the high and low of the last three 5 minute bars, every three bars. The quick-tip also mentions the need to adjust the number of 5 minute bars if you want to have it lining up with 15 minute bars.
https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-81-find-and-plot-the-high-low-of-last-3-5-minute-bars/
9
views
TradeStation EasyLanguage quick-tip 80 | How to change a color 'hard-coded' in a program
EasyLanguage legacy color reserved words: Black, Blue, Cyan, Green, Magenta, Red, Yellow, White, DarkBlue, DarkCyan, DarkGreen, DarkMagenta, DarkRed, DarkBrown, DarkGray, LightGray,
You might also be interested in QuickTip 33 which demonstrates a method to allow the use of colors from the color class in the Plot statement.
https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-80-how-to-change-a-color-hard-coded-in-a-program/
8
views
EasyLanguage Quick-tip 79 | How to use tutorial 114 to draw stochastic zones
TradeStation EasyLanguage Quick-tip 79 shows how to set up a chart using the tutorial 114 program to create colored bands on a standard stochastics indicator.
See https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-79-how-to-use-tutorial-114-to-draw-stochastic-zones/
3
views
TradeStation EasyLanguage tutorial 188 | Volume profile for user selected bars
Tutorial 188 is a new TradeStation EasyLanguage tutorial from Markplex that demonstrates how to select a number of bars using the drawing tool. It then paints the bars selected and analyzes and draws the volume profile.
https://markplex.com/free-tutorials/tutorial-188-volume-profile-for-user-selected-bars/
8
views
TradeStation EasyLanguage Tutorial 187 | Draw text labels anchored to the right of the chart
Tutorial 187 for TradeStation EasyLanguage, demonstrates how to create a simple program to create text anchored to the right hand side of the chart at ten specified price levels.
https://markplex.com/free-tutorials/tutorial-187-draw-text-labels-anchored-to-the-right-of-the-chart/
7
views
Quick-Tip 78 | Indicator plot formatting options
Quick-tip 78 demonstrates three different ways of formatting indicator plots.
Using the ‘customize study’ after the indictor has been applied to the chart
With the indicator open in the development environment, right click and select properties
Coding the plot statement
The quick-tip also explains how to make some of the settings the default settings.
3
views
Tutorial 186 | Inside and outside bar high and low lines | Part 3: Function using Drawing Objects
This first tutorial 186 function checks for inside bars and outside bars and then draws the high and the low of the pattern until either line is breached by price. The other line continues to be drawn (i.e. if the price goes below the low line, it is stopped but the high line continues to be drawn.)
The lines are drawn using drawing objects (as opposed to the legacy drawing tools.)
See the program page here: https://markplex.com/free-tutorials/tutorial-186-inside-and-outside-bar-lines/
2
views
Tutorial 186 | Inside and outside bar high and low lines | TradeStation EasyLanguage
The tutorial 186 indicator from @markplex checks for inside bars and outside bars and then plots the high and the low of the pattern until either line is breached by price. The other line continues to be plotted (i.e if the price goes below the low line, it is stopped but the high line continues to be drawn.)
An 'inside bar' is a two-bar pattern in which the inside bar is smaller and within the high to low range of the previous bar, i.e. the high is lower than the previous bar’s high, and the low is higher than the previous bar’s low.
An 'outside bar' where the bar needs to have a higher high and a lower low than the previous candlestick. When the current bar has a higher high and a low low it is completely ‘outside' the previous candlestick.
Visit the tutorial page here: https://markplex.com/free-tutorials/tutorial-186-inside-and-outside-bar-lines/
13
views
Tutorial 186 | Inside and outside bar high and low lines | Part 2 using legacy drawing tools
This first tutorial 186 function checks for inside bars and outside bars and then draws the high and the low of the pattern until either line is breached by price. The other line continues to be drawn (i.e if the price goes below the low line, it is stopped but the high line continues to be drawn.)
The lines are drawn using the legacy drawing tools.
See the program page here: https://markplex.com/free-tutorials/tutorial-186-inside-and-outside-bar-lines/
2
views
Quick-tip 77 | Printing programs and avoiding unwanted word-wrap
You may have noticed that when you print a program you sometimes get long lines of code split into multiple lines in order to fit on the paper (depending on the font size you use and the size of paper etc). This can make the program difficult to read.
This quick-tip demonstrates how to print a program to a PDF file while avoiding word-wraps (depending on the size of the line of code being printed.)
The quick-tip uses software from https://www.cutepdf.com/index.htm.
https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quicktip-77-printing-a-pdf-of-a-program-without-word-wrap/
1
view
QuickTip 76 | Painting the minute bar on a 10 second bar chart | TradeStation EasyLanguage
QuickTip 76 is a paintbar study designed to 'paint' the minute bar on a 10 second bar chart. It uses two different approaches:
1) Since the Time or T statement represents time in an HHMM format it does not store seconds. This means that we can detect the minute bar when T Not Equal toT[1], i.e. time this bar is different from time last bar (ignoring seconds).
2) The second approach used the DateTime class to give the second in the time. When the seconds are zero it means that the current bar is a minute bar.
https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quicktip-76-painting-the-minute-bar-on-a-10-second-chart/
1
view
Program 84 | Support and Resistance Lines based on Pivots in a TradeStation PSP
Program84-HorizLine creates horizontal support and resistance lines based on the record of levels of previous pivots. The program is similar to program 55 but instead of looking for pivots in the bars of the current chart, it uses a price series provider to search for pivots in a different bar interval. The idea behind the program is that if pivots have occurred at a specific level before, then that price level may have some significance, especially if they have occurred at the same level (or near to the same level) on several occasions before.
The program is designed for minute based charts (1, 2, 3, 5, 15 minute etc) with the price series provider having a greater interval. For example, it could be applied to 5 minute bars of @YM and use a 60 minute price series provider. It was written in TradeStation 10. The start time of the PSP is set to the time of the chart (after maxbarsback). Obviously, the more data you load the greater number of pivots will be found.
For download and more information: https://markplex.com/program-84-support-and-resistance-lines-based-on-pivots-in-psp/
4
views
EasyLanguage Tutorial 185 | Changing the TradeStation DataTip when hovering over drawing objects
Tutorial 185 is built around a TradeStation EasyLanguage PaintBar study (_Tutorial185-Paintbar) that analyzes a chart searching for rectangles that have been drawn by the user using the chart drawing tools. The program modifees the datatips dialog to add the values of the number of bars in the rectangle and the price difference between the upper price and lower prices in the rectangle. These values are only displayed when hovering over bars that are encompassed by the rectangle. The same techniques could be modified and used with other drawing objects to display other values.
The paintbar study includes a method called PlotVals( ). This method goes through the rectangles on the chart and extracts the information that needs to be plotted. It stores it in Appstorage with the key values being the number of each bar within the rectangle being analyzed. The method then throws and exception which causes the program and the data to be reloaded. The method runs when a rectangle drawing object is created or clicked. The method uses another Method (DTtoBN) to convert Datetime values to Barnumber.
In this program the exception is thrown using a macro called using Runcommand. This requires that the ‘Enable runcommand EasyLanguage keyword…’ check box is selected in the format-analysis dialog box. See Quicktip 53 for information about using RunCommand and this macro: https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-53-how-to-modify-tutorial-116-to-reload-the-data-at-intervals/
For every bar on the chart the program checks to see whether there is a value stored in AppStorage for that bar, if so the number of bars in the rectangle and the price difference between the top and bottom of the rectangle are parsed using a TokenList and then plotted.
Appstorage
==========
AppStorage is a Dictionary of name-value pairs that is persistent when an analysis technique is re-verified, has its
inputs modified, or re-runs for another reason (such as when it is disabled by the user temporarily, and then enabled again). This means that when the exception is thrown the values persist in the Appstorage and can be plotted.
Values that are stored in AppStorage are saved when the workspace is saved.
More information can be found about Appstorage in Tutorial 119. See https://markplex.com/free-tutorials/tutorial-119-storing-chart-data-appstorage/
For more information about this tutorial, visit: https://markplex.com/free-tutorials/tutorial-185-changing-the-tradestation-datatip-when-hovering-over-drawing-objects/
14
views
TradeStation EasyLanguge Tutorial 184 | SuperTrend strategy framework and indicator
Tutorial 184 is based on the Markplex SuperTrend indicator which is a stop and reverse (SAR) indicator that trails price action (See the original indicator here: https://markplex.com/free-tutorials/tutorial-173-markplex-supertrend/ )
This implementation calculates the Average True Range (ATR) of the average price using the exponential moving average. A user input multiple of the ATR is added to or subtracted from the average price to give Upper and Lwr respectively, depending on the direction. Direction is determined by the Close of a bar relative to the value of the SuperTrend, Upper and Lwr.
There are many different interpretations of the so-called SuperTrend indicator. In this Markplex version the SuperTrend value is also tightened (i.e. moved closer to price) by using an acceleration factor which increases incrementally each bar by user input: AFStep up to a a maximum value of user input: MaxAF.
In addition a 'Supertrend' stop is calulated (SupTrendExit). The value of this is set to the value of SupTrend when direction changes and is then calculated using:
SupTrendExit = MaxList( SupTrendExit, L - ( ( L - SupTrendExit ) * ( 1 - AFExit ) ) )
when Dir = 1, otherwise by:
SupTrendExit = MinList( SupTrendExit, H + ( SupTrendExit - H ) * ( 1 - AFExit ) )
A buy market order is generated when Dir changes from -1 to 1, provided that LongFilter1, LongFilter2 and LongFilter3 each evaluate to true and the program is not currently in a trade. A sell short market order is generated when Dir changes from 1 to -1, provide that ShortFilter1, ShortFilter2 and ShortFilter3 each evaluate to true and the program is not currently in a trade.
When in a long position and the close crosses under SupTrendExit a market order to exit the trade next bar is generated provided the trade has been in the trade more than the user input: MinBarsNTrade number of bars. Similarly, when in a short position and the close goes above SupTrendExit a market order to exit the trade next bar is generated provided the trade has been in the trade more than the user input: MinBarsNTrade number of bars. The user could experiment with replacing this functionality will other types of stop, for example a trailing stop.
The tutorial gives an example of LongFilter1 and ShortFilter1 using an implementation of the Moving Average Gap Ratio. If this is used, the user will need to change the strategies' "Maximum Number of Bars Study will reference" to be equal to the value of SlowLength. The user can experiment with replacing this filter with their own as the strategy tends to get 'whipsawed' in non-trending markets.
For more details go to: https://markplex.com/free-tutorials/tutorial-184-supertrend-strategy-framework-and-indicator/
12
views
QuickTip 75 | Difference between Condition1 = C > O; and If C > O then Condition1 = TRUE;
Quicktip 75 uses a TradeStation EasyLanguage show-me study to demonstrate the difference between:
Condition1 = Close > Open;
//and
If Close > Open then Condition2 = TRUE;
With the first expression (Condition1 = Close > Open;) if close is greater than open (i.e an up bar) the expression evaluates to true and Condition1 is set to TRUE, hence, in our simple example a show me dot is plotted at the high of the bar. If Close is less than or equal to open (i.e a down bar or Doji) then the expression, Close > Open evaluates to FALSE, Condition1 is set to False and the show-me dot is not plotted.
With the second expression, If Close > Open then Condition2 = TRUE; if the close is greater than the open (an ‘up’ bar) then Condition2 is set to true and a show-me dot is plotted at the low of the bar. If on a subsequent bar the close is less than or equal to open (i.e a down bar or Doji) then no change is made to Condition2. Hence once there has been an up bar Condition2 is set to true and remains true for all future bars and a show-me dot would be plotted at the low of these bars. This second expression acts as a sort of ‘ratchet.’
The third example is similar to the second in that if a bar is an ‘up’ bar then Condition3 is set to true, however if the bar becomes or is a down bar or Doji Condition3 is set to false. Therefore the first and third expressions give similar results.
13
views
QuickTip 74 | Finding the highest pivot on a chart | TradeStation EasyLanguage tutorials
Quicktip 74 demonstrates a TradeStation EasyLanguage show-me study that finds the highest pivot on a chart. The quicktip analyses each bar to check whether it is a high pivot and then checks whether this newly found pivot price is higher than the highest pivot price found so far. This value is plotted each bar.
Quicktip 74 is related to tutorial 182 except that it looks for highest pivot on the chart. Tutorial 182 calculates the pivot with the highest value WITHIN a user input number of bars of the current bar (user input: LookbackBars). (N.B. This is different from finding the highest pivot value on the chart.) Each time a pivot is found it is plotted. In tutorial 182 the bar number and the price level are stored in a dictionary.
For more information about this quick-tip see: https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quicktip-74-finding-the-highest-pivot-on-a-chart/
For more information about tutorial 182 see: https://markplex.com/tutorial-182-highest-pivot-within-user-input-number-of-bars/
20
views