[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 26

 
Goalkeeper писал(а) >>

I'm trying this and it's not quite working... what am I doing wrong, eh?

>> for starters, one place for a month, another place for a day...

 
Figar0 >> :

For a start, one place for a month, another for a day...

here we go... I'm trying my hardest to understand the language, but if you don't have a hacker background, where else should you go? This thread is for people like me... or am I wrong?

 
Goalkeeper писал(а) >>

here we go... I'm trying my best to understand the language, but if you don't have hacker education, where else should you knock? This thread is for people like me... or am I mistaken?

datetime d0 = StrToTime(Year()+".01.01");
int newyear = iBarShift(NULL,PERIOD_MN1, d0);
volotil_05 = MathAbs((High[iHighest(NULL,PERIOD_D1,MODE_HIGH,365, newyear)] - Low[iLowest(NULL,PERIOD_D1,MODE_LOW,365, newyear)] /Point); // from beginning of year

Where to poke?) Look for the shift on a monthly timeframe, and use it on a daily timeframe... You seemed quite prepared to me, so I didn't quite poke, sorry)

 
Figar0 >> :

Where's the cooler way to poke?) Look for an offset on a monthly TF and use it on a daily TF... You seemed quite prepared to me, so I didn't really poke, sorry)

thanks for messing with me...

but it still doesn't work... When I switch from one timeframe to another, the volotil_05 value changes too.

There must be some other way to do it... I'll figure out how to do it...

p.s. I'm all yours, but I'm not that "fully qualified"... :(

 
Goalkeeper писал(а) >>

Thank you for messing with me...

but it still doesn't work... Switching from one timeframe to another changes the volotil_05 value as well.

There must be some other way to do it... i'll figure out how to do it...

p.s. I'm all for "you", but I'm not that much of a "complete beginner"... :(

That's how it works:

datetime d0 = StrToTime(Year()+".01.01");
int newyear = iBarShift(NULL,PERIOD_D1, TimeCurrent());
double volotil_05 = (iHigh(NULL, PERIOD_D1,iHighest(NULL,PERIOD_D1,MODE_HIGH,365, newyear)) - iLow(NULL,PERIOD_D1,iLowest(NULL,PERIOD_D1,MODE_LOW,365, newyear))) /Point;
Print ("Period = ", Period(), "M, Volotil = ", volotil_05);
Comment ("Period = ", Period(), "M, Volotil = ", volotil_05);
You did not understand much about constructions like High[iHighest...., High[...] is just a reference to current TF, that's why iHigh(...) with explicit indication of TF should be used. By the way, MathAbs are also unnecessary there
 
Figar0 >> :

You did not understand much about constructions like High[iHighest...., High[...] is just a reference to current TF, that's why iHigh(...) with explicit indication of TF should be used. By the way, MathAbs are also unnecessary there

My brain must be boiling by Friday evening... Thanks again... I will try to figure it out, but this time it'll happen on Monday...

Have a nice weekend...

 
Gentlemen... i have this question.... Which line should I change the MACD to show on m1... H1 timeframe and at the same time not to wait for new bars from every bar occurring on m1... https://forum.mql4.com/ru/19319
 
The standard recogniser for the new bar is like this:
   static datetime New_Time=0;                  // Время текущего бара   
   New_Bar=false;                               // Нового бара нет   
   if( New_Time!=Time[0])                        // Сравниваем время     
   {       
   New_Time=Time[0];                            // Теперь время такое      
   New_Bar=true;                                // Поймался новый бар     
   }
Are there others?
 
Novice >> :
The standard recogniser for the new bar is: Are there others?

There was a big topic recently, but couldn't find one. It 's not bad here either.

 
granit77 >> :

There was a big topic recently, but I couldn't find it. It's not bad here either.

>> Thank you!