MarketOrder("USDJPY",10000); //Take Profit (Sell) at 50 pips above var takeProfit = LimitOrder("USDJPY", -10000, data["USDJPY"].Close + Securities["USDJPY"].SymbolProperties.MinimumPriceVariation*50*10);

Hi,

I have the above code where I'm trying to set a take profit of 50 pips on a buy market order.
What I expect to happen:

Market order gets filled immediately. Limit Order gets "submitted" immediately and then later gets filled when price reaches 50 pips above the current price.

What happens:

Market order and Limit order both get filled immediately.

Shouldnt the limit order be filled after some time when price has moved by 50 pips? Am I doing Limit Orders wrong? A sell limit order gets filled at the limit price or higher right? Then why does it get filled immediately?

Author