- ago
// This is executing as a market order. How to change type of order in Auto-Stop-Loss from a Market order to Limit order ?

CODE:
// This is executing as a market order. How to change type of order in Auto-Stop-Loss from a Market order to Limit order ? _transaction.AutoStopLossPrice = bars.AveragePriceOHLC[idx] - 1; // This Stop -Limit is not working and joining/linking with the upper order bracket _transaction.AutoProfitTargetPric _transaction = PlaceTrade(bars, TransactionType.Sell, OrderType.StopLimit, val, "Place Sell At Limit ()");           //Thanks
0
387
2 Replies

Reply

Bookmark

Sort
- ago
#1
Your code is missing the assignment of a value to the Transaction StopLimitLimitPrice property. Have you seen this video?
https://www.youtube.com/watch?v=h3ZtcuPnRyU&t=45s
Also don't forget to check out StopLimitLimitPrice in the QuickRef.
0
Cone8
 ( 28.32% )
- ago
#2
It's not currently possible to make the same-bar AutoStop a StopLimit order. By design, the transaction is OrderType.Stop only. Keep in mind this is only for the stop exit on the entry bar. On subsequent bars your strategy exit code can submit Stop/Limit orders.

That said, I think it's easy enough to change. We can make the AutoStop order type StopLimit if a value is assigned to the Transaction's StopLimitLimitPrice property. We'll investigate that and come back.

0

Reply

Bookmark

Sort