Open/Close positons at price that not exist in market! (off-quote)

 

Hi..

There are some EAs that open or close position in a few pips upper or lower than current price...
i saw this in some Arbitrage EAs and i remember that those experts used a specific build version of MT4 to trade like this..
does anybody knows how is it possible and how can i code it? or has a version of these EAs code?
Regards
 

The chart shows BID price only.

ASK price will be either the same as bid price, or usually higher. The difference between them is the spread.

A buy/long order opens at ASK price and closes at BID price.

A sell/short order (like your one above?) opens at BID price and closes at ASK price.

F8 > Common > Show Ask Line to see what the ask price is now (and therefore also the spread now)

You cannot open an order above or below the current price.

But you can set a pending order order or below current price, which will activate if the current price reaches your order's opening price. To code these, use OP_BUYLIMIT, OP_SELLLIMIT, OP_BUYSTOP or OP_SELLSTOP when you open the order with OrderSend().

All the time when you're coding or doing anything related to forex.. think about what is actually happening. How can you possibly open an order above or below the current price? Who would be the other side of that trade?

 
alladir:


But you can set a pending order order or below current price, which will activate if the current price reaches your order's opening price. To code these, use OP_BUYLIMIT, OP_SELLLIMIT, OP_BUYSTOP or OP_SELLSTOP when you open the order with OrderSend().

All the time when you're coding or doing anything related to forex.. think about what is actually happening. How can you possibly open an order above or below the current price? Who would be the other side of that trade?

Doesn't the image show a Buy closing above the Bid at the time ? and therefore show what you have said cannot happen ?

OrderSend() can only open a OP_BUY/OP_SELL at Ask/Bid . . . "At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price." but this is not correct for all Brokers . . .

For an ECN type Broker you send your Order with TP & SL set to 0.0 and then send the TP and SL with an OrderModify() . . . except that this is no longer needed . . .

Some things that we thought we understood about MT4 are no longer true . . .
 
alladir:

The chart shows BID price only.

ASK price will be either the same as bid price, or usually higher. The difference between them is the spread.

A buy/long order opens at ASK price and closes at BID price.

A sell/short order (like your one above?) opens at BID price and closes at ASK price.

F8 > Common > Show Ask Line to see what the ask price is now (and therefore also the spread now)

You cannot open an order above or below the current price.

But you can set a pending order order or below current price, which will activate if the current price reaches your order's opening price. To code these, use OP_BUYLIMIT, OP_SELLLIMIT, OP_BUYSTOP or OP_SELLSTOP when you open the order with OrderSend().

All the time when you're coding or doing anything related to forex.. think about what is actually happening. How can you possibly open an order above or below the current price? Who would be the other side of that trade?


Dear alladir, thank you for your post..
these are basic information and i know all of them...
as you see in attached screen shot Buy position has closed almost 10 pips higher than BID price..
it's a bug in metatrader or in a specific version of MT4..
 
RaptorUK:
Doesn't the image show a Buy closing above the Bid at the time ? and therefore show what you have said cannot happen ?

OrderSend() can only open a OP_BUY/OP_SELL at Ask/Bid . . . "At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price." but this is not correct for all Brokers . . .

For an ECN type Broker you send your Order with TP & SL set to 0.0 and then send the TP and SL with an OrderModify() . . . except that this is no longer needed . . .

Some things that we thought we understood about MT4 are no longer true . . .


I don't understand.

I assumed the image showed a short order. Do the colours mean it's a long order?

 
I wouldn't go chasing rainbows because of an Image like that. I'm interested to know why the order missed all those profit and then decide to take less than half of what it could have?
 
ubzen:
I wouldn't go chasing rainbows because of an Image like that. I'm interested to know why the order missed all those profit and then decide to take less than half of what it could have?

it's not very important why he has not closed sooner in more profit, may be EA was not online that time or any other reason! the important thing is how the EA closed the position out of price..
 
alladir:


I don't understand.

I assumed the image showed a short order. Do the colours mean it's a long order?

The standard colours for a Buy is a blue opening arrow.
 
hrmf: it's not very important why he has not closed sooner in more profit, may be EA was not online that time or any other reason! the important thing is how the EA closed the position out of price..

There's already been some good reasons. 1) Perhaps its a Fake. 2) Perhaps its a Bug. 3) Perhaps its the wrong Color.

You cannot just say "look!! this picture did this.... so tell me how to duplicate it". You can try asking "he" whoever he is. You can try asking the broker. There just isn't enough information in the picture to determine whats happening there. I think you're making too many assumptions here and thats just my opinion.

 
hrmf:

it's not very important why he has not closed sooner in more profit, may be EA was not online that time or any other reason! the important thing is how the EA closed the position out of price..
How were the Objects drawn on the chart ? what is it's provenance ?
 
hrmf:


Hi..

There are some EAs that open or close position in a few pips upper or lower than current price...
i saw this in some Arbitrage EAs and i remember that those experts used a specific build version of MT4 to trade like this..
i attached a screen shot of this type of trading style..
does anybody knows how is it possible and how can i code it? or has a version of these EAs code?
Regards
You have to ask your broker. It provides data and trade server.
Reason: