- ago
Hello

I am doing this by manually entering trades in Order Manager.

I bought an instrument for 400. Then -

Case 1:
I placed a limit sell order for 402.
I placed a stop sell order for 395.
In this case the 402 limit order gets auto-canceled in WealthLab as soon as the stop order is placed.

Case 1:
I placed a stop sell order for 395.
I placed a limit sell order for 402.
In this case the 395 stop order gets auto-canceled in WealthLab as soon as the limit order is placed.

How am I supposed to place these trades so that the position can be closed either for profit at 402 or for stop-loss at 395?
0
444
Solved
4 Replies

Reply

Bookmark

Sort
- ago
#1
Hello,

That's not the right way to do it. Please find your question answered in the Help > Order Manager > One Cancels Other (OCO) Orders: "OCO Manual Entry".

This implies that your broker provider supports OCO natively i.e. implements SupportsOco and PlaceOcoTradePair: https://www.wealth-lab.com/Support/ExtensionApi/BrokerAdapter
1
Best Answer
- ago
#2
Thanks for the reply.

My broker doesn't support OCO orders. I am trying to place the order manually. The help section clarified my question. I will have to first stage both orders and place them in a single step.

Using a coded strategy extension, I need to make sure that both orders have the same cancellation code.

Pls correct me if I am wrong.
0
Glitch8
 ( 10.94% )
- ago
#3
That sounds right!
1
- ago
#4
QUOTE:
Using a coded strategy extension, I need to make sure that both orders have the same cancellation code.

An identic value assigned to Backtester.CancelationCode prior to a PlaceTrade for TransactionType.Sell/Cover groups separate exit orders into one unit so that when one of them gets filled the others will be canceled. Here's a recent discussion with code sample (we need to add one to the QuickRef):

https://www.wealth-lab.com/Discussion/Could-not-Close-position-on-Same-bar-at-Market-Close-7014
1

Reply

Bookmark

Sort