Download MetaTrader 5

OrderSend(...mql4...)

To add comments, please log in or register
Mohammad Soubra
31253
Mohammad Soubra  

HI AGAIN


//---------------------------------------------------------------------------------- 

      ticket = OrderSend
                     (Symbol(), //CURRENCY (PAIR)
                      OP_SELL, //SELL POSITION IN CURRENT PRICE
                      auto_lot, //LOT SIZE

                      Bid, ????????????????????????????????????????????????????????

                      3, ????????????????????????????????????????????????????????

                      sell_stop_loss, //STOP LOSS
                      sell_take_profit, //TAKE PROFIT
                      "COMMENT", //COMMENT ON THE TRADE
                      magic_number, //MAGIC NUMBER!
                      0, //DATE/TI???ME EXPIRATION

                      clrRed); //ARROW WITH COLOR ON CHART WHERE ORDER HAS OPENED

 //---------------------------------------------------------------------------------- 

 

WHAT IS THE MEANING OF (Bid,) WHY IT IS REPEATED IN (PO_SELL,) AND (Bid,)????

WHAT IS THE MEANING OF THE SLIPPAGE AND IS IT NICE TO USE THE VALUE IN THE EXAMPLE ABOVE?

 

:) 

Stuart Browne
6578
Stuart Browne  

Bid is quite simply, the current Bid price (quote).
Slippage is the amount (pips or points) you will let it deviate from the Bid. The price may have moved in the time it takes to place and then fill your order. If the price has moved more than the slippage amount, the order will not be placed.  Note that this does not work on all brokers

How to avoid the bad slippage? - MQL4 forum
  • www.mql5.com
How to avoid the bad slippage? - MQL4 forum
Mohammad Soubra
31253
Mohammad Soubra  
So, is it better to make the slippage value = high value or to open it by using 0
Stuart Browne
6578
Stuart Browne  
Mohammad Soubra:
So, is it better to make the slippage value = high value or to open it by using 0
That's entirely up to you, your strategy, and if your broker even uses the slippage figure
Mohammad Soubra
31253
Mohammad Soubra  
Mmmmmm
Ok thanks
Mohammad Soubra
31253
Mohammad Soubra  
Hello again

regarding the magic number
Why some time it is used as an input ...
//-------------
extern integer magicno = 12345;
//------


!
Any body can give answer regarding that
Marco vd Heijden
Moderator
5648
Marco vd Heijden  

so the user can change it ?

Why is anything used as input ?

Mohammad Soubra
31253
Mohammad Soubra  
Marco vd Heijden:

so the user can change it ?

Why is anything used as input ?

What the benefit of changing the magic no. ?
Marco vd Heijden
Moderator
5648
Marco vd Heijden  

so it handles only the trades with that magic number.

if your ea has a fixed magic number it can run into trouble when running on multiple charts because they all have the same magic number.

so you put in a separate number for each chart and then you can run multiple instances each with their own magic number.

this is only necessary when you want to run the same ea on multiple charts.

the more professional ea's work the other way around, you can run multiple symbols in one ea, so there is no need to use more then one and with a single magic number.

Mohammad Soubra
31253
Mohammad Soubra  
Marco vd Heijden:

so it handles only the trades with that magic number.

if your ea has a fixed magic number it can run into trouble when running on multiple charts because they all have the same magic number.

so you put in a separate number for each chart and then you can run multiple instances each with their own magic number.

this is only necessary when you want to run the same ea on multiple charts.

the more professional ea's work the other way around, you can run multiple symbols in one ea, so there is no need to use more then one and with a single magic number.

Can you please tell what kind of problems when running as one magic no. With more charts
Marco vd Heijden
Moderator
5648
Marco vd Heijden  

it can get confused between orders, it will see the orders, from the other chart/ea as his own... not a good idea.

having two charts with on both the same ea with the same magic number is like having two Mohammad Soubra's ,

trying to drive the same car.

it can be done but then you also have to filter on OrderSymbol(), tickets and etc, and then the actual need for the magic number itself disappears..

besides, if you need the same ea on many symbols this shows a good reason for writing just one that handles it all.

To add comments, please log in or register