- I place the order using the following code and it gets executed without any problem:
//place order
` strategy.entry(
currentOrder.orderEntryId,
direction = longCondition ? strategy.long: strategy.short,
qty = currentOrder.quantity,
stop = currentOrder.entryPrice,
limit = currentOrder.limitPrice)`
- I want to set-up a SL and TP entry for the same order, but when I place it with the following code it does not get executed: `
//setup SL and TP for the currently placed order
strategy.exit(
id = currentOrder.orderExitId,
from_entry = currentOrder.orderEntryId,
qty = currentOrder.quantity,
qty_percent = 100,
limit = currentOrder.takeProfit,
stop = currentOrder.stopLoss)`
I looked into the values assigned to all parameters and they are all OK. Attaching a screen capture of the debug output: As you can see Price passed the TP line (green) but the strategy.exit did not execute