Buying the bid and selling the ask

 
Will this code work? Can it really buy the bid and sell the ask? It seems to be working on FXDD demo.

Maji


        MOrderSend(Symbol(),OP_BUY,lotsi,Bid,slippage,Bid-StopLoss*Point,Ask+TakeProfit*Point,"",16384,0,Red);
        MOrderSend(Symbol(),OP_SELL,lotsi,Ask,slippage,Ask+StopLoss*Point,Bid-TakeProfit*Point,"",16384,0,Blue);

int MOrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment="", int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
{
  LastTradeTime = CurTime();
  price = MathRound(price*10000)/10000;
  stoploss = MathRound(stoploss*10000)/10000;
  takeprofit = MathRound(takeprofit*10000)/10000;
  return ( OrderSend( symbol, cmd, volume, price, slippage, stoploss, takeprofit, comment, magic, expiration, arrow_color ) );
}

 
Check real open price after succesful OrderSend. It will be right price in range invalid price +- slippage
 
Hi Maji,
i've been thinking that Pipmaster EA trick works only on MT3 demo?
Is that bug still present in MT4?
 
Hi Maji,
i've been thinking that Pipmaster EA trick works only on MT3 demo?
Is that bug still present in MT4?


It appears to be working in MT4 too...

Slawa, what do you think of the following output of my Journal:
2006.05.22 08:12:24 '1063239': order is open : #3229155 sell 6.50 EURUSD at 1.2750 sl: 1.2770 tp: 1.2738
2006.05.22 08:12:24 '1063239': request in process
2006.05.22 08:12:24 '1063239': request was accepted by server
2006.05.22 08:12:24 '1063239': instant order sell 6.50 EURUSD at 1.2750 sl: 1.2770 tp: 1.2738
 
In this case print bid price and compare it with order open price. Your open price and new bid will be the same
 
@Maji:

Please print the actual Bid before SendOrder() command.
So we can compare.
 
Here is an example:

2006.05.22 13:20:43 PipMaster Modified EURUSD,M1: open #739659 buy 1.00 EURUSD at 1.2875 sl: 1.2855 tp: 1.2887 ok
2006.05.22 13:20:39 PipMaster Modified EURUSD,M1: Ask= 1.2877, Bid= 1.2875


2006.05.22 13:20:43 '407780': order is open : #739659 buy 1.00 EURUSD at 1.2875 sl: 1.2855 tp: 1.2887

I am not sure if it is a bug or just that there was a rapid 2 pip move in that 4 second time for this to happen. Remember, there is no refreshrates between the print command and the ordersend command.
 
Another example,

2006.05.22 13:25:19 PipMaster Modified USDJPY,M1: open #739749 sell 1.00 USDJPY at 111.4800 sl: 111.6800 tp: 111.3600 ok
2006.05.22 13:25:19 PipMaster Modified USDJPY,M1: Ask= 111.48, Bid= 111.46

2006.05.22 13:25:19 '407780': order is open : #739749 sell 1.00 USDJPY at 111.4800 sl: 111.6800 tp: 111.3600
2006.05.22 13:25:19 '407780': request in process
2006.05.22 13:25:19 '407780': request was accepted by server
2006.05.22 13:25:19 '407780': instant order sell 1.00 USDJPY at 111.4800 sl: 111.6800 tp: 111.3600
 
Look at another order, both open and close:

2006.05.22 13:45:13 '407780': close order #740061 buy 1.00 USDJPY at 111.3700 sl: 0.0000 tp: 0.0000 at price 111.3900
2006.05.22 13:45:13 PipMaster Modified USDJPY,M1: close #740061 buy 1.00 USDJPY at 111.3700 sl: 111.1700 tp: 111.4900 at price 111.3900
2006.05.22 13:45:12 PipMaster Modified USDJPY,M1: Ask= 111.39, Bid= 111.37

2006.05.22 13:44:12 '407780': order is open : #740061 buy 1.00 USDJPY at 111.3700 sl: 111.1700 tp: 111.4900
2006.05.22 13:44:12 '407780': request in process
2006.05.22 13:44:12 '407780': request was accepted by server
2006.05.22 13:44:12 '407780': instant order buy 1.00 USDJPY at 111.3700 sl: 111.1700 tp: 111.4900

2006.05.22 13:44:12 PipMaster Modified USDJPY,M1: open #740061 buy 1.00 USDJPY at 111.3700 sl: 111.1700 tp: 111.4900 ok
2006.05.22 13:44:12 PipMaster Modified USDJPY,M1: Ask= 111.39, Bid= 111.37
 
Maji,
is there in demo trading every order executed, that is trying to buy at the Bid?
Or are these only few out of many?

If this is happening to all orders, we can say this is a bug.
If only some orders are affected, maybe there were requotes in your favour?

Hopefully someone from Metaquotes can comment on this.
 
Maji,
is there in demo trading every order executed, that is trying to buy at the Bid?
Or are these only few out of many?

If this is happening to all orders, we can say this is a bug.
If only some orders are affected, maybe there were requotes in your favour?

Hopefully someone from Metaquotes can comment on this.




I think these are almost random trades and possibly due to requotes. However, I would like to get confirmation from the Metaquote guys that this is not a bug like their MT3 product.

Maji
Reason: