Coverage for src/scrilla/static/functions.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-18 18:14 +0000

1from scrilla.static.constants import constants 

2from scrilla.static import keys 

3 

4 

5def get_trading_period(asset_type: str) -> float: 

6 """ 

7 Returns the value of one trading day measured in years of the asset_type passed in as an argument. 

8 

9 Parameters 

10 ---------- 

11 1. **asset_type**: ``str`` 

12 

13 A string that represents a type of tradeable asset. Types are statically accessible through the ` settings` variables: ASSET_EQUITY and ASSET_CRYPTO. 

14 """ 

15 if asset_type == keys.keys['ASSETS']['CRYPTO']: 

16 return constants['ONE_TRADING_DAY']['CRYPTO'] 

17 return constants['ONE_TRADING_DAY']['EQUITY']