This is a discussion on AllPivots within the Trading tools forums, part of the Trading Forum category; Originally Posted by FHTrading Good morning to all Hi igor. Check to see in the image please. The first is ...
Just a question about AllPivots 3.8 600+ : How can we skip sunday data ? Thank you.
Hi airquest,
There's a code from kalenzo which looks like this;
I didn't yet modify it on Igorad's allpivots but just an idea.PHP Code:
if(DayOfWeek() == 1)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,1)) == 5)
{
yesterday_close = rates[1][4];
yesterday_high = rates[1][3];
yesterday_low = rates[1][2];
}
else
{
for(int d = 5;d>=0;d--)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,d)) == 5)
{
yesterday_close = rates[d][4];
yesterday_high = rates[d][3];
yesterday_low = rates[d][2];
}
Follow my official trading theregulartrader blog
Thanks for the help, but sorry I couldn't do it myself. I see this in Igorad's code
I'm just trying to add an option so that I can add a MondayShift to take account that pivottime is not on sunday but on friday. It's a bit complicated for me, as I'm not an expert, especially with Time function. Tried to change shift to shift-1 but didn't work...Code:if(TimeDayOfWeek(pivottime[shift]) == 0) { datetime dtime = pivottime[shift]; int day = 0; while(day != 1) { dtime += 60*60; day = TimeDayOfWeek(dtime); } pivottime[shift] = dtime; }
I think - Igorad may do it ...
Premium Trading Forum: subscription, public discussion and latest news
Trading Forum wiki || MQL5 channel for the forum
Trading blogs || My blog
Hi airquest,
Please check out the fixed AllPivots indicator according to your suggestions.
Attachment 8224
Regards,
Igor
Bookmarks