Close
Skip to content

Tutorial 41 – Using conditions and conditions within If…Then statements

Welcome to Markplex tutorial 41 in this collection of tutorials designed to help you learn TradeStation EasyLanguage programming skills. EasyLanguage is a programming language that was developed for the TradeStation trading platform that can be used to write programs to help in the technical analysis and trading of foreign exchange, commodities (e.g. the S&P e-mini), options and stocks. Please join our email mailing list if you have not already done so and we will let you know when we release new tutorials or programs.

This is a beginner level video tutorial designed to demonstrate when you might decide to set a condition outside of an If…then construct and when you would want to set a condition within an If..Then construct.

If you want to try the program yourself the code is as follows:

// Using conditions or if…then
Var: HiYestC1( FALSE ),
HiYestC2( FALSE );
// New day – rest HiYestC2 to FALSE
If D <> D[1] then HiYestC2 = FALSE;

HiYestC1 = H > CloseD(1) and L < CloseD(1);
If HiYestC1 then Plot1( L-0.0001, “Condition”, Yellow);

If H > CloseD(1) and L < CloseD(1) then HiYestC2 = TRUE;
If HiYestC2 = TRUE then Plot2( L-0.0003, “IFThen”, Red);

This is a beginner level tutorial that uses a simple show-me to demonstrate the programming techniques.

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.

Tutorial 41 Video – Conditions set inside and outside of If..Then statements

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