How to use the order margin function of python sdk
No matter what args i use it throws none/body
And upon inspection i found that the url https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/PreOrdMarginCalculationVendor
Throws error 500 no matter the content in request which shows that its a server side error, because wrong credentials or request result in error 400/403
Help appreciated
@Aryan_Charan We have now migrated to new API which helps user calculate margin for either single or multiple orders. Please find the python documentation for it below.
Orders = [
{
“Exch”: “N”,
“ExchType”: “C”,
“ScripCode”: 2885,
“ScripData”: “”,
“PlaceModifyCancel”: “P”,
“OrderType”: “S”,
“Price”: 0,
“Qty”: 1,
“IsIntraday”: False
},
{
“Exch”: “N”,
“ExchType”: “C”,
“ScripCode”: 1660,
“ScripData”: “”,
“PlaceModifyCancel”: “P”,
“OrderType”: “S”,
“Price”: 0,
“Qty”: 1,
“IsIntraday”: False
},
{
“Exch”: “N”,
“ExchType”: “D”,
“ScripCode”: 52538,
“ScripData”: “”,
“PlaceModifyCancel”: “P”,
“OrderType”: “S”,
“Price”: 0,
“Qty”: 75,
“IsIntraday”: False
}
]
a = client.multi_order_Margin(CoverPositions=‘Y’, Orders=Orders)
print(a)
1 Like