Hello,
this will plot current day and y'day Last ATP ,
Hope this helps
Thank you
DayChange = Day() != Ref(Day(), -1);
AvgTradePrice = Null;
CurDayBars = 0;
CurDayCloseSum = 0;
C1= C;//Avg
for (i = 0; i < BarCount; i++)
{
if (DayChange)
{
CurDayCloseSum = C1;
CurDayBars = 1;
}
else
{
CurDayCloseSum = CurDayCloseSum + C1;
CurDayBars++;
}
AvgTradePrice = CurDayCloseSum / CurDayBars;
}
Plot(C,"",47,128);
Plot(AvgTradePrice, "AvgTradePrice", 3, 1);
PPC1 = ValueWhen( DayChange == True, Ref(AvgTradePrice, -1), 1);
Plot(PPC1, "Yday Last ATP", colorSkyblue, styleDots|styleNoLine|styleNoRescale );
Plot(DayChange,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
this will plot current day and y'day Last ATP ,
Hope this helps
Thank you
DayChange = Day() != Ref(Day(), -1);
AvgTradePrice = Null;
CurDayBars = 0;
CurDayCloseSum = 0;
C1= C;//Avg
for (i = 0; i < BarCount; i++)
{
if (DayChange)
{
CurDayCloseSum = C1;
CurDayBars = 1;
}
else
{
CurDayCloseSum = CurDayCloseSum + C1;
CurDayBars++;
}
AvgTradePrice = CurDayCloseSum / CurDayBars;
}
Plot(C,"",47,128);
Plot(AvgTradePrice, "AvgTradePrice", 3, 1);
PPC1 = ValueWhen( DayChange == True, Ref(AvgTradePrice, -1), 1);
Plot(PPC1, "Yday Last ATP", colorSkyblue, styleDots|styleNoLine|styleNoRescale );
Plot(DayChange,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
Last edited: