[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 294

 
laveosa:

fully download history.... this will help, reinstalling the terminal may help with the window.... and set setings to defolt
tell me what do you mean "rewind the history" where and how do you set no defolt &
 
gheka: hello kind and advanced people!!! can anyone give me a hint?

and hello to you, too, literate man. !!!!!!! if you don't mind.

What is today? What you have today, your broker may have tomorrow (or yesterday) - different timezones ... OK, no lecturing. You can try it that way:

if(TimeYear(t)== Year() && TimeDayOfYear(t)== DayOfYear())


In general, there are a few comments on the code: (1) use of variable t in comparison without pre-initialization (we may get a logic error at any moment), (2) why has the comparison for "today" been taken out of loop, (3) no break operator in loop (why do we need to look through all orders, we need at least one order, which has been closed today).

 

I have a question about the strategy tester in MT4, what is the reason for the empty alerts to appear in the log during testing?

2013.04.18 00:22:19     2010.03.22 17:30  sova EURUSD,M30: Alert: 

2013.04.18 00:22:19     2010.03.22 17:31  sova EURUSD,M30: Alert: 

2013.04.18 00:22:19     2010.03.22 17:31  sova EURUSD,M30: Alert:  

and what could this mean?

 
gheka:

hello kind and advanced people!!!

I really need your help!!! help me add the code instead of " ######## == today "

Basically we need to get from the history list if any order was closed today, i.e. there will be a bunch of orders of the same magician, but closed on different days,

and the function return true or false if today's order is closed

I would be very grateful

https://www.mql5.com/ru/forum/107476/page53#111201
 
GaryKa:

and hello to you, too, literate man. !!!!!!! if you don't mind.

What is today? What you have today, your broker may have tomorrow (or yesterday) - different timezones ... OK, no lecturing. You can try it that way:

if(TimeYear(t)== Year() && TimeDayOfYear(t)== DayOfYear())


In general, there are a few comments on the code: (1) use variable t in comparison without pre-initialization (we may get a logical error at any moment), (2) why is comparison for "today" taken out of loop, (3) no break operator in loop (why do we need to look through all orders, we need at least one order that was closed today).


thanks a lot
 

I really did, I must have looked like shit)) - thanks, it took me two hours to find it
 
tuner:

I have a question about the strategy tester in MT4, for what reason might there be empty alerts in the log during testing?

and what could this mean?


From my experience, it means that the code reaches the alert but the alert contains a string variable which is empty at the moment it is printed. Well, or there is nothing in the code at all, it means that either nothing was written inattentively or the developer put it in there just for himself: "it got here, it's OK".
 
borilunad:

The rubrics! I determine the minimum lot from the free margin, or I don't open it, so I don't get into a margin call!

I looked it up, it's clearer than in Wiki, but there's no need to apply it, it's too complicated! Arithmetic is more convenient, more visual!


Yes. I totally agree with you that it's a headache! But, nevertheless, I am very interested. If everything is written easier, why does the programmer write it this way? So that someone else reading this code would break his brain and could not master it?

I look at this chain and do not understand why to complicate everything so much....

 
GaryKa:
to hoz First, a bit of theory


And now the conclusion.

Theunderlined expression returns the decimal logarithm (logarithm on base 10) of bd_LOTSTEP, i.e. it shows the power of 10 to get bd_LOTSTEP.


Hmm. You've got it wrong...

//IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII+
//|        Функция, определения минимальной разрядности лота                          |
//IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII+
int LotDecimal()
{return (MathCeil (MathAbs (MathLog (bd_LOTSTEP) / MathLog (10))));}

It's not a decimal logarithm, it's a natural logarithm! So the top part will be the power of e to get bd_LOTSTEP, and below it willbe the power ofe to get10.

But I don't understand the logic of the function anyway.

 
hoz:


Yes. That it's a headache I completely agree with you! But, nevertheless, I'm very interested. If everything is written easier, why does the programmer write it that way? So that somebody else reading this code would break his brain and cannot compile it?

I look at this chain and do not understand why to complicate everything so much....

I will speak in defense of the programmer here! If he is making it for himself, then what he deduced earlier is simply pasted for speed, like assembling a construction set. If he does it for order, then the customer may ask to make everything clear to the uninitiated or does not know what to ask. And if you want to get the hang of it, you've already been given a good explanation of what and how, maybe you'll get the hang of it. I'm not interested in logarithms yet. I'm more interested in creating a market-adaptive algorithm. :))