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.
-
LIVE
Omar Elattar
1 hour agoGRANT CARDONE: “Will I Run for Governor?” | Trump EXPOSED | Bitcoin | $500 Billion Crisis!
253 watching -
46:48
Glenn Greenwald
4 hours agoGlenn Takes Your Questions On Gaza, USAID, and More | SYSTEM UPDATE #403
46.2K31 -
56:42
Candace Show Podcast
8 hours agoBecoming Brigitte: One Coincidence Too Many | Ep 3
117K136 -
3:14:38
Nerdrotic
8 hours ago $12.62 earnedDisney Plus's Complete FAILURE! Fantastic Four Trailer, MCU Phase 5 Reveal | Friday Night Tights 340
120K29 -
1:00:58
The StoneZONE with Roger Stone
3 hours agoWill RINOs Sink Robert F. Kennedy Jr.'s Confirmation? | The StoneZONE w/ Roger Stone
19.8K2 -
1:15:19
Edge of Wonder
5 hours agoReal Biochip Implants & Havana Syndrome Exposed: Interview With Jesse Beltran
17.9K2 -
1:00:12
Sarah Westall
5 hours ago10 Billion Trump Lawsuit against CBS 60 Minutes, Ukraine Bio-labs and more w/ John Mark Dougan
31K8 -
57:07
LFA TV
1 day agoThe ‘Dictator’ Who Downsizes Government | TRUMPET DAILY 2.7.25 7pm
30.8K6 -
1:43:23
2 MIKES LIVE
5 hours ago2 MIKES LIVE #177 Open Mike Friday and DOGE ball!
27K1 -
2:02:32
Revenge of the Cis
7 hours agoEpisode 1443: True Love
69.4K5