Market Order if price moves of x pips

Created at 12 Jun 2015, 17:27
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!
GS

GS66

Joined 12.04.2015

Market Order if price moves of x pips
12 Jun 2015, 17:27


Is it possible in to execute a market order if the price moves of x pips in one direction or the order?

Best Regards

 


@GS66
Replies

Spotware
16 Jun 2015, 12:38

Dear Trader,

It is possible to execute a market order based on the difference of an existing order and the current price in Pips. The following Code Snippet illustrates an example.  

var position = Positions.Find("myLabel");

if (position.Pips > 0) 
{
       ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, "label", 10, 10);
}

 


@Spotware