I can't place limit order!

Created at 28 Aug 2016, 12:00
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
BR

brunoamancio.ti

Joined 20.08.2016

I can't place limit order!
28 Aug 2016, 12:00


I have the following code:

 

var tradeResult = PlaceLimitOrder(nextTradeType, Symbol, nextTradeAmount, nextTargetPrice, PositionLabel, nextStopLossPips, nextTakeProfitPips);

var PositionLabel = "testLabel";
var nextTradeAmount = 1000l;
var nextTargetPrice = 1.12897d;
var nextStopLossPips = 10d;
var nextTakeProfitPips = 10d;
var nextTradeType = TradeType.Buy;

var tradeResult = PlaceLimitOrder(nextTradeType, Symbol, nextTradeAmount, nextTargetPrice, PositionLabel, nextStopLossPips, nextTakeProfitPips);

            if (tradeResult.IsSuccessful)
                Print(
                    string.Format(
                        "Placed limit order. Volume: {0} | Symbol: {1} | Trade type: {2} | Target price: {3} | Stop loss: {4} | Take profit: {5}",
                        tradeResult.PendingOrder.Volume, tradeResult.PendingOrder.SymbolCode,
                        tradeResult.PendingOrder.TradeType,
                        tradeResult.PendingOrder.TargetPrice, tradeResult.PendingOrder.StopLoss,
                        tradeResult.PendingOrder.TakeProfit));
            else
                Print("Error placing limit order: " + tradeResult.Error);

The result the the following:

I start a backtest on 26/08/2016 and the order is filled directly, even though the price is wrong!

What is happening?!


@brunoamancio.ti
Replies

brunoamancio.ti
28 Aug 2016, 12:02

The TP and SL are correct at 20 and 16 pips.


@brunoamancio.ti

... Deleted by UFO ...

brunoamancio.ti
28 Aug 2016, 17:56

RE:

lucian said:

Check Spread !

The spread isn't 4 pips on entry! It averages around 0.3 pip!


@brunoamancio.ti

... Deleted by UFO ...

brunoamancio.ti
29 Aug 2016, 22:26

You're right! ahaahha, cant believe I didn't see that. ;) Thanks.


@brunoamancio.ti