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.
-
10:31
Dr. Eric Berg
2 hours ago13 Foods You Should Never Buy Organic
27.4K13 -
15:10
SB Mowing
1 month agoShe had TEARS OF JOY on her face - An update on Beth
18.6K31 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
226 watching -
2:15:26
Nikko Ortiz
2 hours agoLIVE - Trying Rumble Studio!
169K4 -
9:30
Sugar Spun Run
5 hours ago $0.86 earnedBlack and White Cookies
83.6K1 -
2:45
SLS - Street League Skateboarding
4 days agoManny Santiago's 'THIS IS 40' Part
47.3K2 -
6:40
Homesteading Family
5 days agoNever Make Pie Crust From Scratch Again (Do THIS Instead)
39K5 -
44:20
Melissa K Norris
3 days ago $0.72 earnedThe Most Overlooked Way to Preserve Food for Months (No Freezer Needed) w/ Sam Knapp
28.2K1 -
23:00
Tony Jeffries
6 days agoThe Best & Worst Boxing Training Methods (Ranked by Olympic Boxer)
20.4K -
44:44
Scammer Payback
17 days agoCrazy Confrontation with Hacked Scammer Group
44.2K20