[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 339

 
Gek34:

Thank you very much I will look into it. And the second question, can you tell me about the 3 posts above?

There's not a lot of information.
 

Vinin 20.08.2012 13:28

Gek34:

Thanks a lot I will take it apart. And with the second question, can you tell me 3 posts above?

There is not much information

Code attached: When a pending limit or stop order is placed, a line for modification appears, if I move it, the order is modified as needed, but then every tick tries to modify it, although I don't need it anymore

I have not kept track of all mistakes but I don't feel like rewriting it now. Fonts are not attached (If you have not installed the name will be crooked)

Files:
pobedaov5.mq4  51 kb
 
Gek34:

Vinin 20.08.2012 13:28

Gek34:

Thanks a lot I will take it apart.And with the second question, can not prompt 3 posts above ?

There is not much information

I am attaching the code: After a pending limit or stop order is placed, a line for modification appears, if you move it, the order will be modified as needed, but after every tick it tries to modify it, even though I don't need it anymore.

I have not kept track of all errors in the code but I don't feel like rewriting it now


You have to understand the logic in order to understand it. And that, for me, takes a lot of time. Sorry
 

Then I will formulate the question differently: if an error during order modification is displayed not in the ( journal, the journal is clean) but in the tab (Experts) It means that

1. An error in the Expert Advisor calculations (a request to the server to modify the order was not sent)?

2. the server returned the error (as it happens every tick, the account can be blocked)?

 
Gek34:

Then I will formulate the question differently: if an error during order modification is displayed not in the ( journal, the journal is clean) but in the tab (Experts) It means that

1. An error in the Expert Advisor calculations (a request to the server to modify the order was not sent)?

2. the server returned the error (as it happens every tick, the account can be blocked)?


Error code. If 0, no request has been sent to the server.
 
skyjet:
... can MetaTrader decide if the results are important or not?

Yes, if you have checked the "Skip Useless Results" box. Optimization Results tab, right mouse button.
 
Zhunko:
If you're on the lookout for it, do some more research under DOS. It may come in handy.

Thanks, I got it.

Very funny.

 

https://www.mql5.com/ru/forum/138609/page333#683047

However, can someone help me figure out how to organise the array correctly? It's not a complicated problem, but I can't figure it out on my own.

 
silhouette:

https://www.mql5.com/ru/forum/138609/page333#683047

However, can someone help me figure out how to organise the array correctly? It's not a complicated problem, but I can't figure it out on my own.

Try solving it on a piece of paper:

2) Find the length of a series of green and red values and store them in an array.

Personally, it's not clear to me what the size of the arrays should be. In other words - over what period of time do you want to see a picture of the green and red values, starting from which bar?

 
artmedia70:

Try "on paper" to solve this problem:

2) Find the length of a series of green and red values and store them in an array.

Personally, I don't understand what the size of the arrays should be. In other words - over what period of time do you want to see the picture of the green and red values, starting from which bar?

What should be the size of the arrays - I don't know. Its index should accumulate over the whole interval of calculated bars, i.e. starting from bar limit.

I will try to describe the logic of the problem in words.

  • We have three indicator buffers that draw a colored LSMA. If its value on the current bar is higher than the previous one, we leave the value in yellow and green buffers and clear the value in red. If the current value is lower than the previous one - on the contrary. In all other cases - we clear the value in the red and green buffers, leaving only the yellow one.
  • Green series buffer value is 1, index value is 0. If green buffer on the current bar =EMPTY_VALUE and on the previous one too =EMPTY_VALUE, then green buffer's value increases by one (value accumulation). If value of green buffer == EMPTY_VALUE, while value of red buffer == EMPTY_VALUE too (only yellow colour on the chart), it means that the series is over - we assign series length to green series array with index 0 (we save it to the buffer). We increase the array index by one (the next ones will now be 1, 2, 3 etc.), reset the series value to one, wait for the beginning of the next green series.
  • We carry out the same manipulations with the red series array.
Reason: