Premium Only Content
TradeStation EasyLanguage quick-tip 65 | Number of bars after cross
Quick-tip 65 demonstrates two simple of ways of finding and showing when a condition on the chart has occurred within a user input number of bars.
The quick-tip shows two ways that this can be programmed. The condition used to facilitate the demonstration is the cross of a fast moving average over a slow moving average.
Using a counter
This first technique is used in the TradeStation indicator: _Quick-tip65-Counter. In this program a counter indicator is incremented by one every bar. When the fast moving average crosses over a slow moving average the counter is reset to zero. The program draws an asterisk when the value of the counter is less than a user input value, i.e. when the cross had occurred less that that number of bars ago.
Setting a variable
In the second technique (_Quick-tip65-Condition) a variable is set to a value of 1 every time the fast moving average crosses over a slow moving average, otherwise is is set to zero. The summation function is used to check whether the sum of this variable over the user input number of bars is greater than zero. If so an asterisk is drawn on the chart.
In this example, the asterisks are displayed vertically.
-
58:18
Flyover Conservatives
23 hours agoThe Truth About Halloween that You DIDN’T Know - Holiday Special - Historian Bill Federer | FOC SPECIAL Show
20.5K1 -
3:10:46
Ellie_roe
4 hours agoEllie and Errys Halloween Spooktacular || Random Horror Games
5.01K -
50:27
Sarah Westall
5 hours agoBig Banks Caught Rigging Market, IMF tells World to “Buckle Up” w/ Andy Schectman
17.7K2 -
13:54
Degenerate Jay
12 hours ago5 Best Superhero Movies To Watch On Halloween
5.94K2 -
59:03
NAG Podcast
5 hours agoSarah Fields: BOLDTALK W/Angela Belcamino
8.78K4 -
1:21:41
Glenn Greenwald
8 hours agoGlenn Takes Your Questions: On the Argentina Bailout, Money in Politics, and More | SYSTEM UPDATE #541
69.6K38 -
3:10:08
Barry Cunningham
5 hours agoPRESIDENT TRUMP TO USE NUCLEAR OPTION? FOOD STAMPS END! | SHUTDOWN DAY 31
39.3K28 -
1:06:56
BonginoReport
13 hours agoThe Battle Between Good & Evil w/ Demonologist Rick Hansen - Hayley Caronia (Ep.168)
94.1K32 -
1:12:57
Kim Iversen
7 hours agoBill Gates Suddenly Says “Don’t Worry About Climate Change”?
85.3K60 -
1:05:12
Michael Franzese
7 hours agoI Waited 50 Years to Tell You What Happened on Halloween 1975
41.7K15