var0 = XAverage( Close, Length ) ;
if Close crosses over var0[10] then
Does this code above mean that the Close can cross over the EMA at any moment during the last 10 bars?
Thanks
"Crosses over" question with EMA
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: "Crosses over" question with EMA
the square bracket [10] is a bar reference.var0 = XAverage( Close, Length ) ;
if Close crosses over var0[10] then
Does this code above mean that the Close can cross over the EMA at any moment during the last 10 bars?
Thanks
in this case, it is referring to the bar that is 10 bars ago.
var0[10] refers to the value of var0 at the close of a specific bar,
and that bar is the 10th bar prior to the current bar.