[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 433
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
Please tell me how to close part of the profit (for example: 50% of the open trade) ?
Lot = NormalizeDouble(OrderLots()/2,Digits);
Good evening! I don't see matches when two buffers are equal to each other!!!! The code is simple. You can see that there is definitely a match on the graph! Maybe I'm approaching the question in the wrong way? And you have to somehow remember where one buffer is smaller and where the other one is already? I wrote, even approximated how. But what is missing in this code?
https://www.mql4.com/ru/search#!keyword=%D0%A1%D1%80%D0%B0%D0%B2%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D1%85%20%D1%87%D0%B8%D1%81%D0%B5%D0%BB
Good evening, could you please tell me how to close the counter orders?
Good evening! I don't see matches when two buffers are equal to each other!!!! The code is simple. You can see that there is definitely a match on the graph! Maybe I'm approaching the question in the wrong way? And you have to somehow remember where one buffer is smaller and where the other one is already? I wrote, even approximated how. But what does the given code lack?
Good evening, could you please tell me how to close the counter orders?
https://docs.mql4.com/ru/trading/OrderCloseBy
Hello, I have a problem. I am learning to write in MQL and decided to try to write a simple Expert Advisor based on exponential moving average just for practice. The trades open as expected but for some reason at some point the deal is closed and the history shows the deal was closed with StopLoss but its value is not equal to what was originally set. Please help me to understand what is wrong. All work with trades in a piece of code below.
if(total<1)
{
if(AccountFreeMargin()<(1000*Lots))
{
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
if (MaCurrent < Close[2] && MaPrevious > Close[3] && (Close[1] > Close[2]+70*Point || Close[0] > Close[2]+70*Point))
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,
"EMA",16385,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
if (MaCurrent > Close[2] && MaPrevious < Close[3] && (Close[0] < Close[1]-70*Point || Close[0] < Close[2]-70*Point))
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
"EMA",16385,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}
https://docs.mql4.com/ru/trading/OrderCloseBy
Thank you! I'll give it a try.
Good afternoon. PEOPLE, ANSWER THE QUESTION PLEASE (3rd time posting). A question about a file pointer...