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

 
rigonich:

It will look for the bar index with the maximum price in the last 9 bars, assuming you run the program at 10 o'clock. Hour() is the start time of the program (server time).

P.S. More precisely, not the index, but the maximum price (High) of this bar.

The essence of the work of the EA is simple: for a certain time (01.00 to 10.00) determine the minimum and maximum price and put the pending orders.
Files:
wfweja10.mq4  10 kb
 
Ekburg:

and this condition doesn't help...

Well, then I don't know. You have to look through the code, not only the function, but the whole program, insert error checking, print variable values and the last error and look for a specific error location in the code. When I was debugging my own programs, if they were rather large (about 1000 lines), it sometimes took me weeks, i.e. more time than when I was writing them.
 

Hi all!

I'm looking at an example from a textbook. I can't understand what function the following condition performs:

ObjectSet(His_Name,OBJPROP_RAY,  false);  

I have attached the code myself. The Expert Advisor colors the last n bars.

Please help me to understand it.

Files:
strings.mq4  7 kb
 
rigonich:


void,int,bool which precede an initialized function, indicate the type of variable whose value the function returns to the program to continue working with it.void indicates that the function doesn't return any values (if the result of the function is, for example, to close or open orders, or change values of global variables, which shouldn't be returned, because it

As for theOTHERlanguage, there is an English version of the forum. Language is simply a set of rules and in a certain language there are common names for objects and phenomena. If you use names that are not common, but the ones you prefer, you won't be understood.


I think I got it :)) thank you :))
 
Sergstuddek:
The essence of the work of the EA is simple: at a certain time (01.00 to 10.00) determine the minimum and maximum price and put the pending orders


I have already seen your code and I don't know what to say. AsTarasBY said above, it's easier to say what's right in it:

As I told you above - Seconds(),Minute(),Hour() functions return server start time, and under this condition if (Hour()==10), your function will not work if you didn't start your Expert Advisor at 10 o'clock. You have such conditions all the time. Carefully read the description of functions in Help.

2.if (TIMECLOSEHIGH19>TIMEOPENLOW19) and if (TIMECLOSELOW19<TIMEOPENHIGH19) -- these are conditions that will always work.

3. Do not write 3 or 4 almost identical functions in one program, make one function and pass to it the required parameters when you call it. This is not an error, but it makes your code cumbersome and hard to read.

4) Use any, but always the same system of arrangement of syntax characters (spaces, tabs, line breaks, brackets), otherwise you will confuse yourself and others will be confused.

That's enough for now, fix it and then we'll see.

 
Pacman:

Hi all!

I'm looking at an example from a textbook. I can't understand what function the following condition performs:

I have attached the code myself. The Expert Advisor colors the last n bars.

Please help me to understand it.


double ObjectGet( string name, int prop_id)
The function returns the value of the specified object property. CallGetLastError() to get error information.
See also ObjectSet().
Parameters:
name - object name.
prop_id - Object property identifier. Can be any of the values in the list of object properties.
 
rigonich:


I looked at your code, I don't know what to say. AsTarasBY said above, it's easier to say what's right in it:

As I told you above -- Seconds(),Minute(),Hour() functions return server start time, and under this condition if (Hour()==10), your function will not work if you didn't start your Expert Advisor at 10 o'clock. You have such conditions all the time. Carefully read the description of functions in Help.

2.if (TIMECLOSEHIGH19>TIMEOPENLOW19) and if (TIMECLOSELOW19<TIMEOPENHIGH19) -- these are conditions that will always work.

3. Do not write 3 or 4 almost identical functions in one program, make one function and pass to it the required parameters when you call it. This is not an error, but it makes your code cumbersome and hard to read.

4) Use any, but always the same system of arrangement of syntax characters (spaces, tabs, line breaks, brackets), otherwise you will confuse yourself and others will be confused.

For now it's enough, fix it and then we'll see.

You deserve a monument! The biggest problem in helping "tomorrow's PROGRAMMER" is that he can't realize or even explain "WHAT HE WANTS???", because it's IMPOSSIBLE to get the kolbak-insert-feel all at the same time!!!! :)))
 
TarasBY:
You should have a monument to yourself by now! The biggest problem in helping "tomorrow's PROGRAMMER" is that he can't realise or even explain "what he wants???", because there is no way he can get the kolbak-insert-perk all at the same time! :)))


As Kissa Sparrowmaninov used to say. Yeah.
 
rigonich:
double ObjectGet( string name, int prop_id)
The function returns the value of the specified object property. You need to callGetLastError() to get the error information.
See also ObjectSet().
Parameters:

This is all clear to me. But what specific function this code section performs -
 ObjectSet(    His_Name, OBJPROP_RAY,   false); // Луч
 

Here's what I've already written:

-------------------------------------------

int start()

{

purchase condition,

the purchase itself,

and modification

return(0);

}

-----------------------------------------

The problem is that now I need to enter NEW conditions, close conditions, and then close itself, and my EA starts modifying infinitely (stop and take are fixed, but the message about successful modification pops up with every tick).

How can i now create a loop inside this start for new conditions and closing, so the first part of the EA will not be affected until it closes completely?

Reason: