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

 

Hello Dear Professionals!

Please help me solve this problem:

I need to select a closed order with a certain Magic number from the deal history, which is the last closed order with that Magic number in the list of closed positions relative to other closed orders with the same Magic number, and the order itself is not the last closed order in the list, there are closed deals with other Magic numbers in the history after/before it. Binding exactly to the Magic number is not necessary, you can choose the order by other parameters, the main thing is to choose the last order out of all similar ones. Perhaps this can be done by comparing their tickets or closing time, but how to do this programmatically, I do not know, please advise.

Here is an example to clarify:

Deal History:

1. closed order

2. a closed order

3. The sought-after closed order with the needed symbol to be selected and receive information about it(order direction)

4. a closed order

5. a closed order with the same message as order number 3

6. a closed order

I currently understand that if we try to search for orders in the history with the same message and try to find out the deal direction, the program will show all the deal types (OP_BUY and OP_SELL) one by one and we will not be able to find out which order type was the last one with this message.

Help me find a solution, I'm waiting for your reply.

 
Experto:

Hello Dear Professionals!

Please help me solve this problem:

I need to select a closed order with a certain Magic number from the deal history, which is the last closed order with that Magic number in the list of closed positions relative to other closed orders with the same Magic number, and the order itself is not the last closed order in the list, there are closed deals with other Magic numbers in the history after/before it. Binding exactly to the Magic number is not necessary, you can choose the order by other parameters, the main thing is to choose the last order out of all similar ones. Perhaps this can be done by comparing their tickets or closing time, but how to do this programmatically, I do not know, please advise.

Here is an example to clarify:

Deal History:

1. closed order

2. a closed order

3. The sought-after closed order with the needed symbol to be selected and receive information about it (order direction)

4. a closed order

5. a closed order with the same message as order number 3

6. a closed order

I currently understand that if we try to search for orders in the history with the same message and try to find out the deal direction, the program will show all the deal types (OP_BUY and OP_SELL) one by one and we will not be able to find out which order type was the last one with this message.

Help me find a solution, I'm waiting for your reply.

Please check here:
 
r772ra:
Look here:


Thanks for the tip! We'll look into it.
 
Greg987:

Please help who can...

Question on page 4


108 line.

return(0) is clearly unnecessary + sell deals are somehow taken out of condition is new bar

 
Hello! Does anyone know. Is it possible to disable in MT4 the arrival or rather reflection of quotations in real time? I.e. I need the program to draw a bar when it is already closed at a given timeframe. The intriguing wandering of the price up/down while the bar is forming will be removed. Thank you!
 
alxm:
Hello! Does anyone know. Is it possible to disable in MT4 the incoming or rather the reflection of quotes in real time? I.e. I need the program to draw the bar when it is already closed at a given timeframe. The intriguing wandering of the price up/down while the bar is forming will be removed. Thank you!

it is possible to colour the bars into a chart background.

You should use an indicator to draw them - look at the Heiken Aschi indicator

 

Hello again.

Can someone give me an idea about my question on page 5?

Thanks in advance.

 
alxm:
Hello! Does anyone know. Is it possible to disable in MT4 the arrival or rather reflection of quotations in real time? I.e. I need the program to draw a bar when it is already closed at a given timeframe. The intriguing wandering of the price up/down while the bar is forming will be removed. Thank you!

You can close and reopen the autonomous chart with a new bar, for this you can slightly modify the indicator synbar4EA (available somewhere in kodobase).
 
sergeev:

it is possible to paint the bars in the background of the chart.

and draw them with an indicator - look at the Heiken Aschi indicator


The idea is good, but the price line and the price itself to the right remains on the chart. We can colour it in the background as well, but in this case all symbols on X and Y axis will be invisible. No other options?
 
nemo811:

Hello again.

Can someone give me an idea about my question on page 5?

Thanks in advance.


Error 0 is returned if the operation was successful, 2 is a terminal or operating system glitch, you have to reboot, 3 is your case, you can either just exit the start and this error will be gone on the next tick, or update data and go to the next iteration, if you are working on multiple orders in the loop.
Reason: