Hi,
You can optionally use “BarsSince”, with this you can determine how many bars ago the different “crossings” took place…
|
MA20=Average[20](Close) CO=Close Crosses Over MA20 LastCO=BarsSince(CO) PreviousCO=BarsSince(CO,1) PreviousPrice=Close[PreviousCO] Return LastCO as "LastCO", PreviousCO as "PreviousCO" |
1 user thanked author for this post.