Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

Re: Please help me !

 

I've a robot that was not magic number. How to add this ? What's the mq4 code ?

 

At the beginning of your EA, add this line

 

int MagicNumber=112233; // any number you like

 

Then when you try to open trades, you must issue command like

 

ticket=OrderSend(Symbol(),BUY_OR_SELL,Lots,Price,Slippage,SL,TP,Comment,MagicNumber,OrderValidity,Color);

 

Now, each position opened has the magic number defined as above. So very time you refer to your position, you need to make sure it has the same MagicNumber by using

 

OrderMagicNumber()==MagicNumber as part of your expression.

 

eg . if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==MagicNumber))

 

Hope this helps...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...