am using python script to exit all position if my MTM SL limit exceeded for the day. every 60 seconds am pulling the data via "get_positions()" , but its not having updated value....seems like whenever i pull the data its having 5 mins old data....please help.
******************************************************************************************************************* Current Intraday Position =============================================================================================================== tradingsymbol exchange product quantity last_price day_sell_price day_buy_price pnl day_sell_quantity day_buy_quantity 0 NIFTY20AUG11300CE NFO MIS -75 203.10 215.65 0 941.25 75 0 1 NIFTY20AUG11300PE NFO MIS -75 17.35 16.25 0 -82.50 75 0 2 NIFTY20AUG11350PE NFO MIS -75 24.40 22.90 0 -112.50 75 0 3 NIFTY20AUG11400CE NFO MIS -75 120.45 131.45 0 825.00 75 0 4 NIFTY20AUG11400PE NFO MIS -75 35.00 32.10 0 -217.50 75 0 5 NIFTY20AUG11500CE NFO MIS -75 57.00 63.90 0 517.50 75 0 6 NIFTY20AUG11500PE NFO MIS -75 71.40 64.45 0 -521.25 75 0 7 NIFTY20AUG11600CE NFO MIS -75 19.45 22.50 0 228.75 75 0 ------------------------------------------------------------------------------------------------------------------------- ================================================================================== Current MTM: 1578.75 Net QTY: -600.00 Current SL Limit: -4000.0 ==================================================================================
yes...i tried this already..."last price" also updating every 5 mins only....not every 60 seconds.. only "quantitiy" getting updated correctly... pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);