-
-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
145 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
config/specific_evaluator_config/GoogleTrendStatsEvaluator.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"refresh_rate_seconds" : 3600, | ||
"refresh_rate_seconds" : 86400, | ||
"relevant_history_months" : 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import ccxt | ||
|
||
from trading.exchanges.exchange_manager import ExchangeManager | ||
from evaluator.symbol_evaluator import SymbolEvaluator | ||
from trading.trader.trader_simulator import TraderSimulator | ||
from evaluator.cryptocurrency_evaluator import CryptocurrencyEvaluator | ||
from evaluator.evaluator_creator import EvaluatorCreator | ||
from tests.test_utils.config import load_test_config | ||
from evaluator.Util.advanced_manager import AdvancedManager | ||
from trading.trader.portfolio import Portfolio | ||
from evaluator.Updaters.symbol_time_frames_updater import SymbolTimeFramesDataUpdaterThread | ||
from evaluator.evaluator_threads_manager import EvaluatorThreadsManager | ||
from config.cst import TimeFrames | ||
|
||
|
||
def _get_tools(): | ||
symbol = "BTC/USDT" | ||
exchange_traders = {} | ||
exchange_traders2 = {} | ||
config = load_test_config() | ||
time_frame = TimeFrames.ONE_HOUR | ||
AdvancedManager.create_class_list(config) | ||
symbol_time_frame_updater_thread = SymbolTimeFramesDataUpdaterThread() | ||
exchange_manager = ExchangeManager(config, ccxt.binance, is_simulated=True) | ||
exchange_inst = exchange_manager.get_exchange() | ||
trader_inst = TraderSimulator(config, exchange_inst, 0.3) | ||
trader_inst.stop_order_manager() | ||
trader_inst2 = TraderSimulator(config, exchange_inst, 0.3) | ||
trader_inst2.stop_order_manager() | ||
crypto_currency_evaluator = CryptocurrencyEvaluator(config, "Bitcoin", []) | ||
symbol_evaluator = SymbolEvaluator(config, symbol, crypto_currency_evaluator) | ||
exchange_traders[exchange_inst.get_name()] = trader_inst | ||
exchange_traders2[exchange_inst.get_name()] = trader_inst2 | ||
symbol_evaluator.set_trader_simulators(exchange_traders) | ||
symbol_evaluator.set_traders(exchange_traders2) | ||
symbol_evaluator.strategies_eval_lists[exchange_inst.get_name()] = EvaluatorCreator.create_strategies_eval_list( | ||
config) | ||
evaluator_thread_manager = EvaluatorThreadsManager(config, symbol, time_frame, symbol_time_frame_updater_thread, | ||
symbol_evaluator, exchange_inst, []) | ||
trader_inst.portfolio.portfolio["USDT"] = { | ||
Portfolio.TOTAL: 2000, | ||
Portfolio.AVAILABLE: 2000 | ||
} | ||
symbol_evaluator.add_evaluator_thread_manager(exchange_inst, symbol, time_frame, evaluator_thread_manager) | ||
return symbol_evaluator, exchange_inst, time_frame, evaluator_thread_manager | ||
|
||
|
||
def test_init(): | ||
symbol_evaluator, exchange_inst, time_frame, evaluator_thread_manager = _get_tools() | ||
assert symbol_evaluator.evaluator_order_creator | ||
assert symbol_evaluator.evaluator_thread_managers[exchange_inst.get_name()][time_frame] == evaluator_thread_manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters