Reworked. Seems to be technically correct, but looks a bit Hindu.
Better like this:
bool Orders(int magic)
{
int ordrs;
for(ordrs=0; ordrs<OrdersTotal(); ordrs++)
{
if(OrderSelect(ordrs, SELECT_BY_POS)==true)
{
if(OrderMagicNumber()==magic)
{
return(true); // раз нашли, то и хватит, дальше смотреть не надо
}
}
}
return(false); // все просмотрели и не нашли
}
Put a closing parenthesis after the profit and a semicolon after it. The rest is scrap.
MAGIC - screw it.
Magic and slip are not that important, as normal orders go without them.
double PriceBuy = iHigh(Symbol(),60, 1);
OrderSend(Symbol(), OP_BUYSTOP, Lot, PriceBuy, StopLoss, TakeProfit, "Order", 0, Green);The compiler thinks that"Order" isthe value oftakeprofitparameter, and it should be of double type.
takeprofit should be the seventh parameter, but it is the sixth, because slippage is missing.
This is the problem.
Thank you! I understand the logic. But how can it be fixed?
I've redone it. Seems to be technically correct, but looks a bit Hindu.
Reworked. Seems to be technically correct, but looks a bit Hindu.
it's better this way:
Exactly! Thank you for your help.
it's better this way:
Just less, not less or equal.
Yes, that's right. I was copying and didn't pay attention to that place
Hi all! As the topic is for newbies help:
Variable name in the board to change, so that in MT4 the name is different and the file itself will change! Thanks
Hi all! As the topic is for newbies help:
Variable name in the board to change, so that in MT4 the name is different and the file itself will change! Thanks