Read article https://www.mql5.com/en/articles/1359
Thanks again Rosh.
Bye
Bye
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
How i must understand this sentence that selects an order when it makes reference to the Magicnumber.
This is the script (what it does?)
// Order Management
//
for(cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber )
{
if(OrderType()==OP_BUY)
{{
CurrentProfit=Bid-OrderOpenPrice() ;
// Did we make a profit or loss
if(ProfitMade>0 && (CurrentProfit/Point) >= ProfitMade )
{
CloseBuy("PROFIT");}
And the ordersend order is like this one:
void OpenBuy()
{
ticket=OrderSend(Symbol(),OP_BUY,lotsi,Ask,Slippage,SL,TP,TradeComment,MagicNumber,White);
gle=GetLastError();
}
The problem is that if I want to identify an order fixing magicnumberm for example, replacing it MagicNumber by 1, soon the sentence of "OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber )"
does not work
Thank you.