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
								TruthStream with Joe and Scott
5 days agoSovereign Codes & Cosmic Infrastructure,Ufo's, UAP's, Monads, Matrix Satellites, Interstellar Visitors, SYRONA #505
204 watching - 	
				
							LIVE
								Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
114 watching - 	
				
							5:55:11
								MattMorseTV
9 hours ago $83.35 earned🔴Trump's '60 Minutes' INTERVIEW + MUCH MORE.🔴
147K40 - 	
				
							2:02:36
								Badlands Media
14 hours agoBaseless Conspiracies Ep. 157: Jack the Ripper, the Crash & the Great Disclosure Countdown
28.4K20 - 	
				
							2:06:09
								Inverted World Live
10 hours agoMysterious Crash at Area 51 | Ep. 134
31K13 - 	
				
							2:48:59
								TimcastIRL
8 hours agoTrump Endorses Cuomo, Says NO COMMIE MAMDANI, Obama REFUSES To Endorse Mamdani | Timcast IRL
265K184 - 	
				
							5:51:16
								Drew Hernandez
1 day agoGOP CIVIL WAR: TUCKER CARLSON DERANGEMENT SYNDROME AT ALL TIME HIGH
52.6K41 - 	
				
							14:44
								Sponsored By Jesus Podcast
1 day agoYou Can't Serve God & MONEY | Is Money the Root of All Evil?
23.3K23 - 	
				
							2:47:28
								Barry Cunningham
12 hours agoYOU'VE BEEN MISINFORMED! GREED IS ACTUALLY GOOD! ESPECIALLY NOW! (AND MORE NEWS)
100K42 - 	
				
							7:18:24
								SpartakusLIVE
12 hours agoSNIPING in Battlefield 6 - REDSEC || Monday MOTIVATION to CONQUER the Week
57.1K6