Algo Short Term Margin problem

Hi, I Am facing A Problem

i work on Loop System

example :- Long SBI 1 Lot … Short SBI 2 Lot… net position 1 …
long sbi 2 lot net position 1 lot…

so my order get place 2 lots but my positions stays 1 lot i am facing issue of … market requirement …

cz this is not just 2 lot i am trading with its multiple lots in multiple scripts nifty bank nifty etc…

so what is the solution cz net i am long 1 lot but all the time i have keep 2 times of margine … just to get order executed …

Hello @VoV

To understand this, taking the below example:

Assuming you are trading SBI options and margin requirements are as below

Buy Margin (1 lot) : 50,000
Sell Margin (1 lot) : 1,00,000

In this scenario, first margin is blocked for Long Position, which will be 50,000. Now when you want to Short 2 Lots, you will need additional margin of 1,00,000 (for selling 1 lot) to be available in your account, since the buy lot has not been squared off yet.

Hope this clarifies!

I Am not talking about option selling i am talking about future buying & selling …

buy 1 lot margin 2 lakh
sell 2 lot margine 4 lakh (previous buy covered 1 lot & net position 1 lot sell)
i am talking about this problem… hope u got it…

Hello @VoV

Yes, understood this. In this scenario, when you are selling 2 lots, you will require additional margin for 1 short lot, as the initial position is not closed until the sell order is executed.

Correct Kindly Find A Solution Or Any Extra Changes we need to do in code do let me know … but plz get a solution …

@VoV

This scenario is difficult to handle at our end as there are a lot of edge cases where margin requirements might be higher due to partial order execution.

What you can do is try placing two separate orders, one for squaring off and another for taking fresh position in opposite direction. You can keep a slip of 100-200 ms between these two orders to ensure successful execution (time taken for first order to be processed and margin to be released).

Only 1 signal can be generated at time… next signal can only be done after specific time frame or next candle close… TV have its own limitations …

Alright, didn’t know you were using TV here for placing orders. In this scenario, yes, the margin requirement will be applicable as suggested above.

why don’t you guys introduce reverse option … as its already existing in manual trades… why not for algo ? … its really usefull & amazingly fast… kindly think about it n do implement …

Hello @VoV

Reverse orders from web or other platforms are simply 2x quantity opposite order (e.g. 2x sell order for long position). You can use the same to achieve reverse order from TradingView Webhook Orders.