From two positions chose the last one, namely on the 11th bar, which you can see in the screenshot:
Validation code
I decided to change the condition to enter the position, just set Limit to Low[2] worked, but when the condition as in my first call today, it does not work, so it is in the condition itself before the function is called
I decided to change the condition for entering a position, just set the limit to Low[2] it worked, but when the condition as in my first call today, it does not work, so the problem is in the condition itself before the function is called
It is you who set an order and not a position entry (Buy, Sell).
if(takelimit=OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print(takelimit,GetLastError());//здесь возвращает число 11, получается ошибка код 11, но не нашел расшифровку нигде?
{if(iBarShift(Symbol(),0,OrderOpenTime())==1)
deletelimit=OrderDelete(ticket);
if(!deletelimit)
Comment(GetLastError());
}
bool takelimit;
if(takelimit?=OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print(string(takelimit)+" :",GetLastError());//здесь возвращает число 11, получается ошибка код 11, но не нашел расшифровку нигде?
{if(iBarShift(Symbol(),0,OrderOpenTime())==1) // <<< что это, почему сравнивать с единицей? OrderOpenTime() может вернуть "1"???
deletelimit=OrderDelete(ticket);
if(!deletelimit)
Com
Print(takelimit,GetLastError()) returns two values because the 1st variable is of bool type and it doesn't need GetLastError, and because it has a comma, GetLastError returns the last error in the code at the moment of calling GetLastError?
It works brilliantly!
From two positions chose the last one, namely on the 11th bar, which you can see in the screenshot:
Validation code
I decided to change the condition to enter the position, just set Limit to Low[2] worked, but when the condition as in my first call today, it does not work, so it is in the condition itself before the function is called
I decided to change the condition for entering a position, just set the limit to Low[2] it worked, but when the condition as in my first call today, it does not work, so the problem is in the condition itself before the function is called
It is you who set an order and not a position entry (Buy, Sell).
Ok, so it's a good thing.
It was you who set the order, not the entry into the position(Buy, Sell).
Ok, we've got it figured out - so it's good.
i meant that first there was a condition for enteringif(Open[2]>Close[2] && Open[1]>Close[1] && Close[1]<Low[2]
then I called this function to return the bar index, but now I just removed it and put Low[2] in OrderSend and it works
After all, I did not waste a day on it, it's a bit of a shift from the dead point
maybe 1 and 1 ?/i.e. true and error code 1
Your whole code is wrong.
Your whole code is wrong.
it checks the bar number against the time there...
he checks the bar number against the time there...
Yes, didn't notice the bracket.
it checks the bar number by time there...
maybe 1 and 1 ?/i.e. true and error code 1
Print(takelimit,GetLastError()) returns two values because the 1st variable is of bool type and it doesn't need GetLastError, and because it has a comma, GetLastError returns the last error in the code at the moment of calling GetLastError?