Skip to content

Tutorial 27 | Creating a modified pivot function

Welcome to tutorial 27 in this series of tutorials to help you learn TradeStation EasyLanguage programming skills. The idea behind the series is that if you learn to program using TradeStation EasyLanguage, then you will have a skill that will enable you to try out trading ideas without the need to use a professional EasyLanguage programmer.

The purpose of this video tutorial is to demonstrate the programming techniques rather than to create a tradable indicator. This tutorial was created using TradeStation version 8.6 and works in all later versions including TradeStation version 10 and MultiCharts.

This video tutorial explains how to create a pivot function that looks for pivots where the prices of successive bars on either side of the pivot are higher, or the highs of successive bars are lower.

If you want the updated code for Tutorial 27 function it is available for  IMMEDIATE download for $19.95  by clicking the following ‘add to cart’ button. 

If you want the updated code for Tutorial 27 function it is available for  IMMEDIATE download for $19.95  by clicking the following ‘add to cart’ button. 

If you see any errors in this tutorial – or I have not made something clear, I would be most grateful if you could please let me know. You can e-mail me at: tutorials@markplex.com. Also, let me know if you have any ideas for new tutorials.

Example of how to call the function

{ Syntax to call the function:
_MarkplexPivot( Price, 	Length, LeftStrength, RightStrength, Instance, HiLo, oPivotPrice, oPivotBar  ); }

Vars:	oPivotPrice( 0 ), 
		oPivotBar( 0 );

// Plot low Markplex pivots with left strength of 3 and right strength of 2
If _MarkplexPivot( L, 3, 3, 2, 1, -1, oPivotPrice, oPivotBar ) = 1 then Plot1[3]( L[3] );

// Plot high Markplex pivots with left strength of 2 and right strength of 3
If _MarkplexPivot( H, 4, 2, 3, 1, 1, oPivotPrice, oPivotBar ) = 1 then Plot2[4]( H[4] );

This code should produce results similar to the following when applied to a minute chart.

T27

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, 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.