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

 
Hello again. I have a question, what computer characteristics affect the time of EA optimisation? I am going to optimize it for a very long time, there are a lot of parameters and run time is very long. Who knows?
 

I decided to put an opening price in the order comment to control how much slippage there is when opening pending orders.

int ORDER_OPEN(int sig, double Lot, double oop)
{
     int ticket = 0, FE, i, er;
   string comm = DoubleToString(oop, Digits);

    while(ticket <= 0) // Цикл открытия ордеров.
     {

   ticket = OrderSend(_Symbol, sig, Lot, oop, 40, 0, 0, comm, Magic);

// Дальше обработка ошибок и закрывающие скобки...


This is how strange things happen. I put a comment on market orders, but not on pending orders...

I put a manual pending order with a comment... everything is set. It means there is no ban from brokerage company. I do not understand the reason.


I've never seen such a weird and unpredictable mechanism in MT4... While I was writing my question, I activated a bystop without any comment and got a new self-test with comment...


 

Good evening, below is the code, help me understand the idea of a stop at the minimum of the maximum values, no error in the log, but the owl puts stops at 10-12 points out of the blue, not by hail, as intended, where is the error?

int val_index_buy  = iLowest(NULL,0,MODE_LOW,4,0);
if(val_index_buy!=-1)StopLossBuy = Low[val_index_buy];
else Print("Ошибка вызова iLowest. Код ошибки=%d",GetLastError()); 
int val_index_sell = iHighest(NULL,0,MODE_HIGH,4,0);
if(val_index_sell!=-1)StopLossSell = High[val_index_sell];
else Print("Ошибка вызова iHighest. Код ошибки=%d",GetLastError())

I do not know where I am going.

 
Pokrov:

Good evening, below is the code, help me understand the idea of a stop at the minimum of the maximum values, no error in the log, but the owl puts stops at 10-12 points out of the blue, not by hai, as intended, where is the error?

I do not know where I am going.


I'm not a pro, but what is the purpose of checking if (val_index_buy !=1)? What is the point? Wouldn't it be easier to find high/low, mark it as a stop loss and compare it with the minimum? And if the minimum is set, print it out.
 
Veterros:

I'm not a pro, but why check if (val_index_buy !=1)? What is the point? Wouldn't it be easier to find the high/low to mark it as a stop loss and compare it with the minimum? And if you set a minimum, output it in the print.
iHighest is equal to val_index_buy, it returns - 1 in case of error. Therefore, there is a comparison.
 
Pokrov:
iHighest which is equal to val_index_buy, the return value, returns - 1 , in case of error. Therefore there is a comparison.

I see. Thank you for the clarification.
 
Pokrov:

Good evening, below is the code, help me understand the idea of a stop at the minimum of the maximum values, no error in the log, but the owl puts stops at 10-12 points out of the blue, not by hail, as intended, where is the error?

I do not know where I am going.

The question has been resolved, there is no error in the code. The error was further down.
 
is there no way to change the colour of the period separators?
 
and how do I subscribe to the thread?
 
eddy:
is there no way to change the colour of the period separators?

Right.


eddy:
and how do you subscribe to a thread?
No. https://forum.mql4.com/ru/66128
Reason: