placelimitorder success

Created at 07 Aug 2023, 18:17
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!
LU

luca.tocchi

Joined 25.03.2020

placelimitorder success
07 Aug 2023, 18:17


I placed a limit order, what is the code to say: When the place limit order is activated do this etc.

 

PlaceStopOrder(TradeType.Buy, SymbolName,  volumeInUnits, Symbol.Bid + 15);


@luca.tocchi
Replies

firemyst
07 Aug 2023, 23:51

What do you mean by “activated”? DO you mean when the order is actually executed? If so, just check the trade result:

 

TradeResult r = PlaceStopOrder(TradeType.Buy, SymbolName,  volumeInUnits, Symbol.Bid + 15);

if (r.IsSuccessful) {

////

}


@firemyst

luca.tocchi
08 Aug 2023, 06:16 ( Updated at: 08 Aug 2023, 06:23 )

RE: placelimitorder success

firemyst said: 

What do you mean by “activated”? DO you mean when the order is actually executed? If so, just check the trade result:

 

TradeResult r = PlaceStopOrder(TradeType.Buy, SymbolName,  volumeInUnits, Symbol.Bid + 15);

if (r.IsSuccessful) {

////

}

 

I mean when the pending order turns into position. 

 

                TradeResult r = PlaceStopOrder(TradeType.Buy, SymbolName, volumeInUnits, Symbol.Bid + 0.0003);
                
                if (r.IsSuccessful)
                {
                 Print("yes");
                }

 

in this case it print “yes” immediatly. But I want it to print “yes”, only when the order is executed. When the price line crosses the order line and the order filled

thanks


@luca.tocchi

firemyst
08 Aug 2023, 06:19

RE: RE: placelimitorder success

luca.tocchi said: 

firemyst said: 

What do you mean by “activated”? DO you mean when the order is actually executed? If so, just check the trade result:

 

TradeResult r = PlaceStopOrder(TradeType.Buy, SymbolName,  volumeInUnits, Symbol.Bid + 15);

if (r.IsSuccessful) {

////

}

 

I mean when the pending order turns into position. 

Then do what I suggested. If the trade result is successful, you know you have a position. 


@firemyst