investfly-sdk 1.2__tar.gz → 1.3__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.
Files changed (44) hide show
  1. {investfly_sdk-1.2/investfly_sdk.egg-info → investfly_sdk-1.3}/PKG-INFO +1 -1
  2. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/StrategyApiClient.py +2 -2
  3. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/cli/InvestflyCli.py +5 -4
  4. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/Indicator.py +1 -1
  5. {investfly_sdk-1.2 → investfly_sdk-1.3/investfly_sdk.egg-info}/PKG-INFO +1 -1
  6. {investfly_sdk-1.2 → investfly_sdk-1.3}/pyproject.toml +1 -1
  7. {investfly_sdk-1.2 → investfly_sdk-1.3}/LICENSE.txt +0 -0
  8. {investfly_sdk-1.2 → investfly_sdk-1.3}/README.md +0 -0
  9. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/__init__.py +0 -0
  10. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/IndicatorApiClient.py +0 -0
  11. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/InvestflyApiClient.py +0 -0
  12. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/MarketDataApiClient.py +0 -0
  13. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/PortfolioApiClient.py +0 -0
  14. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/RestApiClient.py +0 -0
  15. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/__init__.py +0 -0
  16. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/cli/__init__.py +0 -0
  17. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/CommonModels.py +0 -0
  18. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/MarketData.py +0 -0
  19. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/MarketDataIds.py +0 -0
  20. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/ModelUtils.py +0 -0
  21. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/PortfolioModels.py +0 -0
  22. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/SecurityFilterModels.py +0 -0
  23. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/SecurityUniverseSelector.py +0 -0
  24. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/StrategyModels.py +0 -0
  25. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/TradingStrategy.py +0 -0
  26. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/__init__.py +0 -0
  27. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/__init__.py +0 -0
  28. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/IndicatorTemplate.py +0 -0
  29. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/NewsSentiment.py +0 -0
  30. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/RsiOfSma.py +0 -0
  31. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/SmaEmaAverage.py +0 -0
  32. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/__init__.py +0 -0
  33. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverStrategy.py +0 -0
  34. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverTemplate.py +0 -0
  35. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/__init__.py +0 -0
  36. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/CommonUtils.py +0 -0
  37. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/PercentBasedPortfolioAllocator.py +0 -0
  38. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/__init__.py +0 -0
  39. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/SOURCES.txt +0 -0
  40. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/dependency_links.txt +0 -0
  41. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/entry_points.txt +0 -0
  42. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/requires.txt +0 -0
  43. {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/top_level.txt +0 -0
  44. {investfly_sdk-1.2 → investfly_sdk-1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: investfly-sdk
3
- Version: 1.2
3
+ Version: 1.3
4
4
  Summary: Investfly SDK
5
5
  Author-email: "Investfly.com" <admin@investfly.com>
6
6
  License: The MIT License (MIT)
@@ -15,7 +15,7 @@ class StrategyApiClient:
15
15
 
16
16
  def listStrategies(self) -> List[TradingStrategyModel]:
17
17
  strategiesList: List[Dict[str, Any]] = self.restApiClient.doGet('/strategy/list')
18
- strategiesList = list(filter(lambda jsonDict: jsonDict['type'] == 'CUSTOM', strategiesList))
18
+ strategiesList = list(filter(lambda jsonDict: jsonDict['type'] == 'SCRIPT', strategiesList))
19
19
  return list(map(lambda jsonDict: TradingStrategyModel.fromDict(jsonDict), strategiesList))
20
20
 
21
21
  def getStrategy(self, strategyId: int) -> TradingStrategyModel:
@@ -24,7 +24,7 @@ class StrategyApiClient:
24
24
 
25
25
  def createStrategy(self, strategyModel: TradingStrategyModel) -> TradingStrategyModel:
26
26
  strategyDict = strategyModel.toDict()
27
- strategyDict['type'] = 'CUSTOM'
27
+ strategyDict['type'] = 'SCRIPT'
28
28
  strategyDict = self.restApiClient.doPost('/strategy/create', strategyDict)
29
29
  return TradingStrategyModel.fromDict(strategyDict)
30
30
 
@@ -2,7 +2,7 @@ import argparse
2
2
  import pickle
3
3
  import os.path
4
4
  import time
5
- from typing import List
5
+ from typing import List, cast
6
6
 
7
7
  from investfly.api.InvestflyApiClient import InvestflyApiClient
8
8
  from investfly.models import Session, IndicatorSpec
@@ -63,8 +63,9 @@ class InvestflyCli:
63
63
  strategyId = int(args.id)
64
64
  path = args.file
65
65
  strategyModel: TradingStrategyModel = self.investflyApi.strategyApi.getStrategy(strategyId)
66
+ code: str = cast(str, strategyModel.pythonCode)
66
67
  with open(path, 'w') as out_file:
67
- out_file.write(strategyModel.pythonCode)
68
+ out_file.write(code)
68
69
  return f"Strategy saved to {path}"
69
70
 
70
71
  def __updateCode(self, args: argparse.Namespace) -> str:
@@ -94,8 +95,8 @@ class InvestflyCli:
94
95
  try:
95
96
  while notFinished:
96
97
  time.sleep(3)
97
- backtestResult: BacktestResult = self.investflyApi.strategyApi.getBacktestResult(strategyId)
98
- backtestStatus: BacktestResultStatus = backtestResult.status
98
+ backtestResult = self.investflyApi.strategyApi.getBacktestResult(strategyId)
99
+ backtestStatus = backtestResult.status
99
100
  print(str(backtestStatus.toDict()))
100
101
  notFinished = backtestStatus.jobStatus == BacktestStatus.QUEUED or backtestStatus.jobStatus == BacktestStatus.INITIALIZING or backtestStatus.jobStatus == BacktestStatus.RUNNING
101
102
  except KeyboardInterrupt as e:
@@ -122,7 +122,7 @@ class IndicatorSpec:
122
122
  name = json_dict['name']
123
123
  indicatorSpec: IndicatorSpec = IndicatorSpec(name)
124
124
  indicatorSpec.indicatorId = json_dict['indicatorId']
125
- indicatorSpec.description = json_dict.get('description')
125
+ indicatorSpec.description = json_dict['description']
126
126
  indicatorSpec.valueType = IndicatorValueType[json_dict['valueType']]
127
127
  for key, value in json_dict['params'].items():
128
128
  indicatorSpec.params[key] = IndicatorParamSpec.fromDict(value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: investfly-sdk
3
- Version: 1.2
3
+ Version: 1.3
4
4
  Summary: Investfly SDK
5
5
  Author-email: "Investfly.com" <admin@investfly.com>
6
6
  License: The MIT License (MIT)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "investfly-sdk"
7
- version = "1.2"
7
+ version = "1.3"
8
8
  description = "Investfly SDK"
9
9
  authors = [
10
10
  { name = "Investfly.com", email = "admin@investfly.com" },
File without changes
File without changes
File without changes