sysstra 0.1.2.0__tar.gz → 0.1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sysstra
3
- Version: 0.1.2.0
3
+ Version: 0.1.2.2
4
4
  Summary: Official Python Library for Sysstra Algo Trading
5
5
  Home-page: https://github.com/sysstra/sysstra
6
6
  Author: Anurag Singh Kushwah
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="sysstra",
5
- version="0.1.2.0",
5
+ version="0.1.2.2",
6
6
  description="Official Python Library for Sysstra Algo Trading",
7
7
  long_description=open("README.md").read(),
8
8
  long_description_content_type="text/markdown",
@@ -33,10 +33,10 @@ def place_bt_order(rdb_cursor, order_candle, position_type, quantity, transacti
33
33
  order_dict["expiry"] = order_candle["expiry"]
34
34
  order_dict["option_type"] = option_type
35
35
  order_dict["strike_price"] = strike_price
36
- else:
37
- order_dict["expiry"] = ""
38
- order_dict["option_type"] = ""
39
- order_dict["strike_price"] = ""
36
+ # else:
37
+ # order_dict["expiry"] = ""
38
+ # order_dict["option_type"] = ""
39
+ # order_dict["strike_price"] = ""
40
40
 
41
41
  order_dict["day"] = order_candle["date"].strftime("%A")
42
42
 
@@ -5,8 +5,10 @@ import itertools
5
5
  import traceback as tb
6
6
  import requests
7
7
  from custom_indicators import *
8
+ import pandas_ta as ta
8
9
  from sysstra import orders_url
9
10
 
11
+
10
12
  def change_granularity(data_df, granularity):
11
13
  """ Function to Change Granularity for Provided Dataframe """
12
14
  try:
@@ -1357,13 +1359,23 @@ def calculate_brokerage(buy_price, sell_price, quantity, broker="zerodha", marke
1357
1359
  gst = round(total_charges * gst, 2)
1358
1360
 
1359
1361
  # Calculating Total tax and Charges
1360
- total_charges = round(
1361
- (brokerage + sebi_charges + exchange_charges + stt + clearing_charge + stamp_duty + gst), 2)
1362
+ total_charges = round((brokerage + sebi_charges + exchange_charges + stt + clearing_charge + stamp_duty + gst), 2)
1362
1363
 
1363
1364
  # Calculating Net PnL
1364
1365
  net_pl = ((sell_price - buy_price) * quantity) - total_charges
1365
1366
 
1366
1367
  return total_charges, net_pl
1368
+
1369
+ elif broker == "coindcx":
1370
+ brokerage = 0.5
1371
+ buy_turnover = buy_price * quantity
1372
+ sell_turnover = sell_price * quantity
1373
+ buy_charges = round(buy_turnover * brokerage/100, 2)
1374
+ sell_charges = round(sell_turnover * brokerage/100, 2)
1375
+ total_charges = buy_charges + sell_charges
1376
+ net_pl = ((sell_price - buy_price) * quantity) - total_charges
1377
+ return total_charges, net_pl
1378
+
1367
1379
  except Exception as e:
1368
1380
  print("Exception in calculating brokerage : {}".format(e))
1369
1381
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sysstra
3
- Version: 0.1.2.0
3
+ Version: 0.1.2.2
4
4
  Summary: Official Python Library for Sysstra Algo Trading
5
5
  Home-page: https://github.com/sysstra/sysstra
6
6
  Author: Anurag Singh Kushwah
File without changes
File without changes
File without changes
File without changes