Hi
I have written a MTF signal with daily and 60 min data.
I have defined the trend from the daily chart as:
if (DayEma[0] > DayEma[1]) then
trend = 1
else if (DayEma[0] < DayEma[1]) then
trend = -1
else trend = 0;
However, this only works on the first bar of the new day, all other times the DayEma[0] = DayEma[1].
Is there a way to reference the previous day's data without having to resort to looking at session times?
Help with referencing previous indicator values on MTF sigs
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Help with referencing previous indicator values on MTF s
Dear Chillie,
You should add a condition like:
var: prevDayEma(0);
if date <> date[1] then
prevDayEma = DayEma[1];
And then make a comparison with this variable.
You should add a condition like:
var: prevDayEma(0);
if date <> date[1] then
prevDayEma = DayEma[1];
And then make a comparison with this variable.
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times