Not getting ask price on position opened from pending order
When the Ask reaches or exceeds your pending price, the order becomes a market order and opens at any available price.
When the Ask reaches or exceeds your pending price, the order becomes a market order and opens at any available price.
Did you check the prices of the previous ticks?
Did you check the prices of the previous ticks?
I found out what I was seeing wrong... I was looking at the bid/ask price of the order opening and not of the position opening. Now its clear and makes sense!
Thanks guys!
Hello guys,
As we know the prices information on the Data Window of Strategy Tester Visualization are "BID prices".We also know that when we open a long position, we buy at the Ask Price.
I am using only pending orders on the EA, but when they get triggered I am not seeing the Ask price beeing used to opeining the position...Let's see:
double price_in = candle[1].high // high price form the previous candle
// When RSI indicator meets a certain condition, the EA sends a pending order to get triggered when price reaches the previous candle high.
request.action = TRADE_ACTION_PENDING;
request.type = ORDER_TYPE_BUY_STOP;
request.price = price_in
Example:
candle[1].high = 1.30838
I have obtained the info of Bid and Ask Price (using SymbolInfoDouble funcion) when the position is opened but the Ask Price is different than 1.30838:
Ask = 1.30806
Bid = 1.30794
The price recorded is acctually the high price of the previous candle when the order was launched:
But shouldn't this price and the Ask price be the same? Actually doesn't match neither the Bid price...
What am I not seeing on this??? Please help.
Thanks,
Filipe