Questions from Beginners MQL4 MT4 MetaTrader 4 - page 204
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
Hello all.
I have one question. I wrote an EA on Martin. When I modify orders and set TakeProfit, it flies to the sky. And this only happens on real account. In the Strategy Tester all is OK, and everything is OK on the demo. I do not understand what is the trick.
//+------------------------------------------------------------------+
double BuyAverange=0, SellAverange=0, SellPrice=0, BuyPrice=0, BuyLot=0,SellLot=0;
for(int i = OrdersTotal()-1; i>=0; i--)
if(OrderSelect(i,SELECT_BY_POS))
if(OrderSymbol()==Symbol())
if(OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
BuyPrice+=OrderOpenPrice()*OrderLots();
BuyLot+=OrderLots();
}
if (OrderType()==OP_SELL)
{
SellPrice+=OrderOpenPrice()*OrderLots();
SellLot+=OrderLots();
}
}
if(b>1&&BuyLot>0)
BuyAverange=NormalizeDouble(BuyPrice/BuyLot+Profit*Point(),Digits());
if(s>1&&SellLot>0)
SellAverange=NormalizeDouble(SellPrice/SellLot-Profit*Point(),Digits());
//+-----------------------------------------------------------
for(int i = OrdersTotal()-1; i>=0; i--)
if(OrderSelect(i,SELECT_BY_POS))
if(OrderSymbol()==Symbol())
if(OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
if(b==1)
{ if(OrderTakeProfit()==0)
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()+TakeProfit*Point(),Digits(),0,clrGreen)==false)
Print("Errow N",GetLastError());
if (b>1)
if(OrderTakeProfit()!=BuyAverange)
if(Ask<BuyAverange)
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(BuyAverange,Digits(),0,clrGreen)==false)
Print("Errow N",GetLastError());
}
if (OrderType()==OP_SELL)
{
if(s==1)
if(OrderTakeProfit()==0)
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()-TakeProfit*Point(),Digits(),0,clrGreen)==false)
Print("Errow N",GetLastError());
if (s>1)
if(OrderTakeProfit()!=SellAverange)
if(Bid>SellAverange)
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(SellAverange,Digits(),0,clrGreen)==false)
Print("Errow N",GetLastError());
}
}
Colleagues - decided to write here because I don't know where else to go. Please correct - in MT 4 - when saving one default profile - default - when running multiple robots on multiple tabs - in general this theme from below eurobucks, poundbucks, etc. - When you restart the terminal - it is mixed up and when loading the default profile - it is also mixed up - this is VERY inconvenient, I have to manually sort out the sequence - what came after what, etc.
CAN it be fixed?
Good day!
Why is the chart in mt4 different from the chart in mt5? And if possible, how do i transfer the mt5 chart to mt4? (Just my broker uses price data as in mt5, but all my favourite indicators are in mt4)
Can you tell me why the postal service is not working?
Can you tell me why sending to the post office is not working?
Maybe from whom and to whom should it be different?
Maybe from whom and to whom should it be different?
I've already tried it, nothing works.
I've already tried it, it doesn't work.
All mailers now require a separate password to be generated for the third party application. Read your mailer's help - most likely you need to generate a separate password.
Plus you need to specify the exact port of the SMTP server, like this:
smtp.ukr.net:465
All mailers now require you to generate a separate password for a third-party application. Read your email provider's help - you'll probably need to generate a separate password.
Plus you need to specify the exact port of the SMTP server, like this:
Tak-zhe tried - did not go.
The port was prescribed: smtp.ukr.net:465