sum of all highs from yesterday in MT4 language?

 

Hello

Basically I want to have the following operation translated into MQL4:

double sumofhighs = the sum of all M15 highs of the previous trading day (i.e. the M15 high of 00:00 + the M15 high of 00:15 + the M15 high of 00:30 + etc.)

I assume it is done with ArrayCopyRates or something similar but I'd like to know how exactly. Thanx in advance.

-Yojimbo

 
i think u can find it in here
 
qjol:
i think u can find it in here

^^ ..|..
 
Yojimbo:

Hello

Basically I want to have the following operation translated into MQL4:

double sumofhighs = the sum of all M15 highs of the previous trading day (i.e. the M15 high of 00:00 + the M15 high of 00:15 + the M15 high of 00:30 + etc.)

This gives you midnight: https://www.mql5.com/en/forum/135849 subtract 24 hours gives you midnight the day before ( you will need to compensate for weekends, etc ) start from there and use a while for a for loop to count forward through the bars and sum the

iHigh(NULL, PERIOD_M15, LoopIndex) values.

 
Yojimbo:

^^ ..|..
yeh yeh keep sitting like that and all of us will do your dirty work
 

I guess you wan to get average high of High Value of TF M15,


try this:

datetime backdate = iTime(Symbol(),PERIOD_D1,0);
datetime backdate2 = iTime(Symbol(),PERIOD_D1,1);

int bar = iBarShift(Symbol(),PERIOD_M15,backdate);
int bar2 = iBarShift(Symbol(),PERIOD_M15,backdate2);
double sumofhigh = 0;

for (int i=bar;i<bar2;i++){
sumofhigh = sumofhigh+iHigh(Symbol(),PERIOD_M15,i);
}

double avg = NormalizeDouble(sumofhigh/(bar2-bar),Digits);

ObjectCreate("hl",OBJ_HLINE,0,0,avg);


rgrds

nbf

 

thank you very much nbf28 and raptorUK for your help

@gjol: I just needed someone to show me how to put the poorly translated, theoretical Russian Mumbo Jumbo called MQL4 book, tutorial or whatever into actual practice without wasting 1000 hours of my life re-reading the ABC of C++ trying to reinvent the wheel before realizing that none of it will ever get me closer to what I want. I learn by doing. I am very well familiar with all the codes - not that hard considering the fact that there are only just a handful - but without a template to work on or someone to show me how I can make those well known codes do what I want them to do, all the theoretical knowledge of MQL4 book is useless. To me anyway. Trust me, if I was able to do the dirty work myself I would do it. Only to avoid support-weary bs comments like "omg use the search function / read the FAQ / tutorial" or what not. In all honesty, if using the search function or reading a FAQ or a poorly translated, practice-void Russian Mumbo Jumbo called MQL4 tutorial takes me 240 hours to get the necessary information while posting a question in a forum gets me there in 24 hours why on earth would I choose to do the former? If you don't want to help, don't do it ^^ ..|..

 

Доброго времени суток уважаемые форумчане!

Меня зовут Герман, мне 23 года, я являюсь трейдером компании "Инстафорекс"

Помогите в поиске нужного скрипта! Скрипт нужен для сетки отложенных ордеров.

Reason: