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
ThatStarWarsGirl
8 hours agoTSWG LIVE: Discussing STAR WARS News with Special Guest Star Wars Theory!
985 watching -
2:42:40
Laura Loomer
6 hours agoEP162: LIVE: President Trump Addresses The Nation
52.1K26 -
1:32:05
Adam Does Movies
11 hours ago $4.99 earnedRob Reiner Films + Movie News + AMA - Live!
32.1K1 -
47:57
Professor Nez
10 hours ago🚨LIVE NOW: President Trump Addresses the Nation from the Oval Office
32.3K33 -
28:17
The White House
7 hours agoPresident Trump Delivers an Address to the Nation
79.4K130 -
4:44:53
Drew Hernandez
23 hours agoTRUMP ADDRESSES THE NATION & BONGINO ANNOUNCES FBI DEPARTURE?
59.4K22 -
2:37:30
Badlands Media
17 hours agoBadlands Media Special Coverage - MY FELLOW AMERICANS the Alpha Warrior Show & Redpill Project
66.1K33 -
22:54
Jasmin Laine
12 hours agoMedia MELTS DOWN as Poilievre Surges—Ottawa Loses Control of the Narrative
31.1K17 -
59:50
BonginoReport
9 hours agoDan Bongino Is Leaving The FBI - Nightly Scroll w/ Hayley Caronia (Ep.199)
292K260 -
1:14:51
Kim Iversen
10 hours agoSTILL SHADY: Candace Meets With Erika — She Was Right
170K260