On September 20th and 21st, my order was triggered from the algoTest platform. The orders consisted of two simple sell orders and their respective stop-loss orders, along with two buy orders. However, Dhan is blocking margin for the stop-loss orders as well. On another platform, I am able to trigger the same orders with the available funds. Please review my order history for the mentioned days to gain a better understanding of the situation.
Hello @lakshmi_negi
Good to see you back on community after quite some time.
On Dhan, we do not block marging for Stop-loss order in case your position is already created.
If both the orders are being placed simultaneously, then margin might be blocked only for few milliseconds and later the same will be released, once the primary order is executed successfully.
HI @Hardik,
Itβs always a delight to use Dhan.
In Algotest, all orders are executed simultaneously, but there seems to be a problem where buying and stop-loss (SL) orders are occasionally executed before sell orders, resulting in a margin issue. This issue appears to be a bug. As a result, I am considering switching to another platform for now where the execution flow follows the preferred sequence of sell orders being executed first, followed by SL orders, and then other buy orders. Is it possible to integrate this same execution flow into Dhan?
Hello @lakshmi_negi
I will have to check with the Algotest team on this. Since the integration is done by their end on APIs, they must have implemented logic to handle this already.
@raghav-algotest can maybe look into this directly here.
@Hardik @raghav-algotest did you get the chance to check above mentioned issue?
Over here, if you are trying to place four buy orders in total (along with two stop loss buy order), then it will require margin for two buy orders. Can you confirm if this is the scenario?
I have also asked AlgoTest team to check logic at their end.
@Hardik
I attempted to place two sell orders along with two stop-loss orders and two new buying orders. However, one of the sell orders did not execute due to a margin issue, even though I have sufficient funds [checked in basket] and an additional 10,000 in margin added to the account.