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.
-
1:04:39
Crypto Power Hour
10 hours agoState of Early Stage Crypto Investor Rob Good
13.6K7 -
1:24:24
LIVE WITH CHRIS'WORLD
17 hours agoTHE WAKE UP CALL - 12/17/2025 - Episode 27
4.22K -
27:51
ThinkStory
18 hours agoIT: WELCOME TO DERRY Season 1 Ending Explained!
4.91K -
5:29
Gamazda
12 hours ago $0.94 earnedMetallica - Nothing Else Matters (Live Piano in a Church)
4.26K3 -
2:50:56
The Confessionals
20 hours agoHe Killed a Monster (Then They Told Him to Stay Silent)
5.42K7 -
41:42
Brad Owen Poker
14 hours ago $0.31 earnedMy BIGGEST WIN EVER!! $50,000+ In DREAM Session!! Must See! BEST I’ve Ever Run! Poker Vlog Ep 360
4.02K -
17:53
The Illusion of Consensus
18 hours ago $0.39 earnedWhat Women REALLY Want in Public (It’s Not What You Think) | Geoffrey Miller
4.57K3 -
1:32:16
Uncommon Sense In Current Times
17 hours ago $0.32 earnedPolygyny Debate: The Biblical Case For and Against Plural Marriage | Uncommon Sense
8.27K1 -
LIVE
BEK TV
23 hours agoTrent Loos in the Morning - 12/17/2025
102 watching -
23:42
Athlete & Artist Show
4 days ago $0.41 earnedWorld Junior Invites & Snubs, NHL Threatens To Pull Out Of Olympics
6.19K