OrderSend(...mql4...)

 

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?

 

:) 

 

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
 
So, is it better to make the slippage value = high value or to open it by using 0
 
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
 
Mmmmmm
Ok thanks
 
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
 

so the user can change it ?

Why is anything used as input ?

 
Marco vd Heijden:

so the user can change it ?

Why is anything used as input ?

What the benefit of changing the magic no. ?
 

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.

 
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
 

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.

Reason: