Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 513

 
woin2110:

https://docs.mql4.com/ru/trading/orderselecthttps://docs.mql4.com/ru/trading/orderopenprice https://docs.mql4.com/ru/trading/orderlots

double z; //declare the "z" variable
double y; //declare the "y" variable


if(OrderSelect(10,SELECT_BY_POS)==true) //if the selected order (by ticket) is present

{

OrderLots()=z //assign the lot for this order to the "z" variable

OrderOpenPrice()=y //assign the open price to the "y" variable

}

try this

Just don't confuse people and tell bullshit, please. You say by ticket, but you write selection by index. And if you select by ticket, you don't need to specify pool - the function ignores it and selects it in either of the two lists - in the one where it is. And to check which list the order is selected from, we should check the time of closing of the order after successful selection and if it is higher than zero - then the order has already been closed, otherwise - it is selected from the list of open positions

You are not assigning the value of the lot to a variable, and vice versa - you are trying to assign the value of the variable to the function returning the lot of the selected order - this is nonsense at all

Exactly the same thing you are trying to do with the function that returns the opening price.

 

artmedia70:

Tell me what I'm doing wrong. Everything seems to be correct.

if((i_buy==0 && i_sell==0) || y > Step)

Or (i_buy==0 && i_sell==0) or y > Step. If either one is true. Then we skip it and open an order.

 
evillive:

If Alpari - you never could. If another brokerage company, it depends on the account. If we have a good working relationship with Alpari, we will get a better understanding of the market. The terms of trade should be studied before starting to do something, it is all written there.

The 8-800-200-01-31 helpdesk explained that at the end of last week they had fixed a bug that allowed orders to be opened in ECN accounts at the same time as SL and TP were set. I closed the last position on Thursday.

You are right in that the Trading Regulations don't say anything about this and that only OrderModify() will save now.

Thanks for the reply.

 
Zolotai:

artmedia70:

Tell me what I'm doing wrong. Everything seems to be correct.

if((i_buy==0 && i_sell==0) || y > Step)

Or (i_buy==0 && i_sell==0) or y > Step. If either one is true. Then we skip it and open an order.

I practically don't understand the question...

I do not know what we are missing, but an order can be opened... I.e., if this condition is met and an order should be opened, then

I can tell you what it says here:

If i_buy and i_sell are both equal to zero, an order may be opened. Or, if any of them is not equal to zero, or maybe even both of them are not equal, but if y is greater than Step, then open an order as well.

 
artmedia70:

I practically don't understand the question...

I do not know what we are missing, but an order can be opened... I.e., if this condition is respected and an order should be opened.

I can tell you what it says here:

"Open an order if i_buy and i_sell are both equal to zero. Or if any of them is not equal to zero, or maybe even both of them are not equal, but if y is greater than Step, then also an order should be opened.



I understand correctly in the loop. We proceed from the first open order to the last one. Accordingly, we should take the price of the last order.

There is more. I have put Alert("d") in OnTick. I have run the code in the tester but I haven't heard any beeps or windows.

 
Zolotai:

In the fork cycle I understand correctly. We are going from the first open order to the last one. Correspondingly, I take the price of the last order.

I also have this. I have put Alert("d") in OnTick. I have run the code in the tester but I haven't heard any beeps or windows.

Alerts in the tester are displayed in the tester log. But about the cycle, skipping, selecting, brute-force is not clear. Can you get the gist of what you want to end up with?
 

Good afternoon!

How to fight with "MetaEditor not found" when trying to edit an EA? MetaTrader build 600.

I don't seem to remember such a problem in older builds...

Can it be explained by the fact that the computer I'm working on is rather low-powered and loaded 50-75% of the time. I've got 7 MT4 instances running on it, but under normal conditions (i.e. without external load like access via TeamViewer and trying to launch MetaEditor) its performance is enough, and Task Manager running in background shows avg CPU usage <=45-50% for 15-20 min.

This problem does not occur in 100% of cases and MetaEditor, after displaying uncommon patience and persistence, will run every time from the 5th-10th-25th time. But it's really annoying to try to start MetaEditor for half an hour.

 
artmedia70:
The alerts in the tester are printed in the tester's log. And what about the loop, skipping, selecting and brute-forcing are not clear. Can you get the gist of what you want as a result?


I just want to write the simplest robot. It works by martin, by itself.

This is where the error lies.

y = OrderOpenPrice()-Ask;

I don't get integer numbers as I thought. But for example 0.0044. How do I get 44, an integer?

 
Zolotai:


I just want to write the simplest robot. It works by martin, by itself.

This is where the error lies.

y = OrderOpenPrice()-Ask;

I don't get integer numbers as I thought. But for example 0.0044. How do I get 44, an integer?



int y = int((OrderOpenPrice()-Ask)/Point);
 
Mr.Profit:

Good afternoon!

How to fight with "MetaEditor not found" when trying to edit an EA? MetaTrader build 600.

I don't seem to remember such a problem in older builds...

Can it be explained by the fact that the computer I'm working on is rather low-powered and loaded 50-75% of the time. I have 7 MT4 instances running on it, but under normal conditions (i.e. without external load like access via TeamViewer and trying to launch MetaEditor) its performance is enough, and Task Manager running in background shows avg CPU usage <=45-50% for 15-20 min.

This problem does not occur in 100% of cases and MetaEditor, after displaying uncommon patience and persistence, will run every time from the 5th-10th-25th time. But it's really annoying to try to start MetaEditor for half an hour.

With such questions you should go to the 610th build thread- the developers are there
Reason: