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.
- {investfly_sdk-1.2/investfly_sdk.egg-info → investfly_sdk-1.3}/PKG-INFO +1 -1
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/StrategyApiClient.py +2 -2
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/cli/InvestflyCli.py +5 -4
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/Indicator.py +1 -1
- {investfly_sdk-1.2 → investfly_sdk-1.3/investfly_sdk.egg-info}/PKG-INFO +1 -1
- {investfly_sdk-1.2 → investfly_sdk-1.3}/pyproject.toml +1 -1
- {investfly_sdk-1.2 → investfly_sdk-1.3}/LICENSE.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/README.md +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/IndicatorApiClient.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/InvestflyApiClient.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/MarketDataApiClient.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/PortfolioApiClient.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/RestApiClient.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/api/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/cli/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/CommonModels.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/MarketData.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/MarketDataIds.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/ModelUtils.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/PortfolioModels.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/SecurityFilterModels.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/SecurityUniverseSelector.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/StrategyModels.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/TradingStrategy.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/models/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/IndicatorTemplate.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/NewsSentiment.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/RsiOfSma.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/SmaEmaAverage.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/indicators/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverStrategy.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverTemplate.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/CommonUtils.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/PercentBasedPortfolioAllocator.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/utils/__init__.py +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/SOURCES.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/dependency_links.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/entry_points.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/requires.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/investfly_sdk.egg-info/top_level.txt +0 -0
- {investfly_sdk-1.2 → investfly_sdk-1.3}/setup.cfg +0 -0
@@ -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'] == '
|
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'] = '
|
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(
|
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
|
98
|
-
backtestStatus
|
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
|
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)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverStrategy.py
RENAMED
File without changes
|
{investfly_sdk-1.2 → investfly_sdk-1.3}/investfly/samples/strategies/SmaCrossOverTemplate.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|