Skip to content

Tutorial 164 | How to buy a specified number of ticks above the previous bar high

A Gold Pass member asked for a tutorial about how to create a TradeStation EasyLanguage program to buy at “buy 1 tick above the previous bar high.”

Tutorial 164 demonstrates how to achieve this in two different ways:

  1. An EasyLanguage strategy (_Tutorial164) that issues an order based on the value of the high of the previous bar, except on the last tick of the bar when it issues the order based on the high of this bar (the actual order is active the next bar).
  2. An indicator (_Tutorial164-OrderTicket) that uses the OrderTicket object to generate trades. The initial order ticket is sent once on the last tick of the bar and then on the last tick of each bar, provided its update event shows that it has been received (and not filled), it is updated and replaced using the new high value of the current bar.  In this indicator (_Tutorial164-OrderTicket) the price is actually set to 20 ticks above the high of the previous bar, rather than 1 tick as in the first program.
Use the programs demonstrated in this tutorial on your simulated accounts only.

The demonstration programs from the tutorial are available free to Gold Pass members. For others, who do not wish to re-type the tutorials, they can be downloaded for a modest price.

Bear in mind that if an buy stop order has been issued the previous bar based on its high and the next bar opens at a value higher than this level, then it will attempt to enter at the opening price.
The strategy program applied to an @ES chart
When the indicator is first applied to a chart.

 

A replacement order

The code examples are provided free to Gold Pass members below and others are welcome to transcribe the code from the tutorial video or download the programs for a nominal fee, below.

In order for _Tutorial164-OrderTicket to be able to send order tickets “Enable order placement objects” must be clicked in the Format- General tab.

Tutorial 164 video

Download the tutorial 164 strategy and indicator (_Tutorial164 and _Tutorial164-Order-Ticket)

If you want to save yourself some typing the tutorial 164 programs, they are available for immediate download for $24.95 by clicking the following button. You can pay using PayPal or credit card. The program works with TradeStation 9.5, and TradeStation 10 but _Tutorial164-Order-Ticket is not compatible with MultiCharts.

The studies are unprotected, in other words, you will be able to see, modify and experiment with the tutorial’s code.

Gold Pass area

This content is for members only.

THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, TRADING APPS, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.