Square off open position when PnL falls below -1000

Benthomas
Benthomas edited January 2021 in Python client
Hi Dear All,
Greetings..

I am new to this forum. I just want to Square off the open position when the loss equal to or greater than Rs.1000.
How to code this using Python. Kindly give me a sample code to continuously check this(while loop) and execute Square off for every newly opened positions.
I take only one position at a time. I may have other positions closed.
Only the current open position P&L needs to be calculated and squared off based on the above condition.

Thank you in advance
Sign In or Register to comment.