OpenApi-5p / py5paisa

Official Python SDK for 5paisa APIs natively written in VB .NET
https://5paisa.github.io
89 stars 67 forks source link

Empty Buy/Sell Avg Rate for USDINR position #34

Open Akash141991 opened 3 years ago

Akash141991 commented 3 years ago

Description

Trying to get USDINR positions data. But buy or sell avg rate is zero because of which unbooked PL is wrong.

What I Did

Endpoint URL - "https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/NetPositionNetWise"
Request Payload - {"head":{"appName":"5PAKASH","appVer":"1.0", "key":"****",
                                "osName":"WEB","requestCode":"","userId":"****",
                                 "password":"****"},"body":{"ClientCode":"***"}}
Response Sample - 
{"BodQty"=>1,
  "BookedPL"=>0,
  "BuyAvgRate"=>0,
  "BuyQty"=>0,
  "BuyValue"=>0,
  "Exch"=>"N",
  "ExchType"=>"U",
  "LTP"=>0.815,
  "MTOM"=>-45,
  "Multiplier"=>1000,
  "NetQty"=>1,
  "OrderFor"=>"D",
  "PreviousClose"=>0.86,
  "ScripCode"=>9175,
  "ScripName"=>"USDINR 29 Dec 2020 CE 73.0000",
  "SellAvgRate"=>0,
  "SellQty"=>0,
  "SellValue"=>0},
 {"BodQty"=>-2,
  "BookedPL"=>0,
  "BuyAvgRate"=>0,
  "BuyQty"=>0,
  "BuyValue"=>0,
  "Exch"=>"N",
  "ExchType"=>"U",
  "LTP"=>0.0425,
  "MTOM"=>10,
  "Multiplier"=>1000,
  "NetQty"=>-2,
  "OrderFor"=>"D",
  "PreviousClose"=>0.0475,
  "ScripCode"=>9191,
  "ScripName"=>"USDINR 29 Dec 2020 CE 75.0000",
  "SellAvgRate"=>0,
  "SellQty"=>0,
  "SellValue"=>0},
5paisa commented 3 years ago

Hey @Akash141991 ,

This has been noted and is under development

balgates1 commented 3 years ago

This also for Cash Market, Please consider that in your development