Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 373
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
you have a summation
Thank you! Ran it through, and fixed it! Now it works.
The order is selected by ticket, and then, after one kilometre of code, you try to modify it. But it may already be closed at that time.
If the order was closed, then OrdersTotal()==0;; respectively, the OrderModify() would not happen at all.
If the order was closed, then OrdersTotal()==0;, respectively, OrderModify() would not take place at all
Orders can be closed 0.01 lots at a time if the order is a lot of 0.59 for example. A question arises. Is it possible to combine two orders into one? For example, an order with the lot 0.01 and you want to open another order with 0.02 lot. Can they be combined with 0.03 lots to avoid the piling up of orders, and if so, how?
install MT5 netting
no such thing in MT4?
Hello again everyone.
With all due respect to the pristine rectangles.
I don't understand - WHY it happily modifies sell orders, but ignores modification of buy orders even when using incense tambourines and other irrational optimization tools.
if (ticket>0)
{
//set a Stop Loss and Take Profit for a Buy order//
if(OrderSelect (ticket, SELECT_BY_TICKET, MODE_TRADES))
{
double sl,tp;
if (type==OP_BUY)
{
sl=OrderOpenPrice () - (StopLoss*_Point);
sl=NormalizeDouble (sl,_Digits);
tp=OrderOpenPrice () + (TakeProfit*_Point);
tp=NormalizeDouble (tp,_Digits);
}
if (type==OP_SELL)
{
sl=OrderOpenPrice () + (StopLoss*_Point);
sl=NormalizeDouble (sl,_Digits);
tp=OrderOpenPrice () - (TakeProfit*_Point);
tp=NormalizeDouble (tp,_Digits);
}
bool mod = false;
int count=0;
while (!mod)
{
mod=OrderModify (ticket, OrderOpenPrice (), sl, tp, 0, clrYellow);
count++;
if (count>=100)
{
mod=true;
break;
Figured it out!!!!!
Please help me, I'm just learning, if ZZ from one buffer was called from one buffer and ZZ from two buffers, how should I write it correctly?
I am not writing it correctly, how should it be written? Thank you
Didn't capture the piece at the top, it makes more sense that way. Please tell me the mistake.