Problem with PlaceLimitOrder and PlaceStopOrder

Created at 26 May 2025, 16:03
AG

agent.xzxz

Joined 04.04.2020

Problem with PlaceLimitOrder and PlaceStopOrder
26 May 2025, 16:03


I tried to place a limit order using this new method

double volume = 1000;
double entryPrice = 1354;
double stopLossInPrice = 1340
double takeProfitInPrice = 1370;
PlaceLimitOrder(TradeType.Buy, SymbolName, volume , entryPrice , "", stopLossInPrice, takeProfitInPrice, ProtectionType.None);

but it doesn't set the SL and TP when i execute it.

I even try to set stoploss and takeprofit to pips but still not setting both.

 

the old method is working using pips 

double volume = 1000;
double entryPrice = 1354;
double stopLossInPips = 10
double takeProfitInPips = 10;
PlaceLimitOrder(TradeType.Buy, SymbolName, volume, entryPrice, "", stopLossInPips , takeProfitInPips);

but it says its obsolete so Im trying the new one.

 

 


@agent.xzxz
Replies

firemyst
27 May 2025, 00:23

It's not setting your SL or TP in the new method because you said Protection Type is “None”. So if there's no protection type, why would you expect a SL or TP protection to be set? :-)


@firemyst

agent.xzxz
27 May 2025, 13:09 ( Updated at: 27 May 2025, 13:10 )

RE: Problem with PlaceLimitOrder and PlaceStopOrder

firemyst said: 

It's not setting your SL or TP in the new method because you said Protection Type is “None”. So if there's no protection type, why would you expect a SL or TP protection to be set? :-)

I feel so stupid right now lol

My bad.

Btw, what is Relative or distance based protection type? is it by pips?


@agent.xzxz