Good afternoon. I'm learning to write code and I have a problem. The code in the tester runs, opens one trade and that's it. The price does not change, everything stops in place.
Who is not difficult, please advise.
if (CountTrades() == 0)
{
double body = Close[1] - Open[1];
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx////Открытие позиции Buyif (body > 0)
{
Forder = (OrderSend(_Symbol,OP_BUY,Lot,Ask,Slippage,0,0,"Коммент",Magic,0,Blue));
{
Print("Открыта Позиция BUY");
{
if(Forder > 0)
{
TP = NormalizeDouble((Ask+TakeProfit*_Point+OrderSwap()+OrderCommission()),_Digits);
Forder = OrderModify(Forder,OrderOpenPrice(),0,TP,0);
}Print("Ордер Модифицирован BUY ");
}Print("Ошибка Модификации Ордера BUY");
}
}Print("Ошибка Открытия Позиции BUY");
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx////Открытие позиции Sell if (body < 0)
{
Forder = (OrderSend(_Symbol,OP_SELL,Lot,Bid,Slippage,0,0,"Коммент Sell",Magic,0,Red));
{
Print("Открыта Позиция SELL");
{
if(Forder > 0)
{
TP = NormalizeDouble((Bid-TakeProfit*_Point+OrderSwap()+OrderCommission()),_Digits);
Forder = OrderModify(Forder,OrderOpenPrice(),0,TP,0);
}Print("Ордер Модифицирован SELL ");
}Print("Ошибка Модификации Ордера SELL");
}
}Print("Ошибка Открытия Позиции Sell");
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx//
}
Good afternoon. I'm learning to write code and I have a problem. The code in the tester runs, opens one trade and that's it. The price does not change, everything stops in place.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Good afternoon. I'm learning to write code and I have a problem. The code in the tester runs, opens one trade and that's it. The price does not change, everything stops in place.
Who is not difficult, please advise.
Good afternoon. I'm learning to write code and I have a problem. The code in the tester runs, opens one trade and that's it. The price does not change, everything stops in place.
Who doesn't mind, please advise.
Ask+TakeProfit*_Point+OrderSwap()+OrderCommission()How do you add swap and commission to the price?
How do you add swap and commission to the price?
How do I do it?)
Do you think this is a problem?
How I know how to count.)
Do you think that's the problem?
First, when you open a swap, there is no swap.
Second, let's assume the commission of 1$ you open an order on the pound at 1.32500
you add (TakeProfit) 200*_Point and (commission) 1$ and you end up with a Take of 2.32700 ... In what decade would that be?
Add onTimer to onTick
Thank you
How I know how to count.)
Do you think that's the problem?
No, it's not right.
With OrderModify, that's more correct.
And better as a separate block.
How I know how to count.)
Do you think that's the problem?
I don't think that's the problem, it's just not right. And as for the tester freezing, you'd better post the whole code and we'll see.
OrderCommission()*_PointThat's not right either.
_Points are decimal places and do not translate to points in any wayI don't think that's the problem, it's just not right. And as for the tester freezing, you'd better post all the code and see.
That's not right either.
_Point is decimal places and does not translate to points in any wayIt's all there. Thanks for your help.