Skip to content

Commit

Permalink
Tp (#47)
Browse files Browse the repository at this point in the history
* upd
  • Loading branch information
m5l14i11 committed Sep 6, 2024
1 parent 8eb71da commit ef9a9d3
Show file tree
Hide file tree
Showing 510 changed files with 11,595 additions and 6,283 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ LOG_DIR=

LOG_LEVEL=INFO
WASM_FOLDER=wasm
REGIME=default
REGIME=default

COPILOT_MODEL_PATH=
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ check:
cargo clippy --all-features --all-targets --workspace --manifest-path=$(TA_LIB_PATH)
cargo fmt --all --check --manifest-path=$(TA_LIB_PATH)

build:
build: build-timeseries build-strategy

build-strategy:
RUSTFLAGS="-C target-feature=+multivalue,+simd128 -C link-arg=-s" cargo build --release --manifest-path=$(TA_LIB_PATH) --package trend_follow --target wasm32-wasi
cp $(TA_LIB_DIR)/target/wasm32-wasi/release/trend_follow.wasm $(WASM_DIR)/trend_follow.wasm

build-timeseries:
RUSTFLAGS="-C target-feature=+multivalue,+simd128 -C link-arg=-s" cargo build --release --manifest-path=$(TA_LIB_PATH) --package ffi --target wasm32-wasi
cp $(TA_LIB_DIR)/target/wasm32-wasi/release/ffi.wasm $(WASM_DIR)/timeseries.wasm

run:
pipenv run python3 quant.py

format:
cargo fmt --all --manifest-path=$(TA_LIB_PATH)
pipenv run black .
pipenv run ruff . --fix
pipenv run ruff . --fix

update:
cargo update --manifest-path=$(TA_LIB_PATH)
pipenv update
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ cachetools = "*"
orjson = "*"
scipy = "*"
cbor2 = "*"
llama-cpp-python = "0.2.82"
umap-learn = "*"

[dev-packages]
mypy = "*"
Expand Down
48 changes: 27 additions & 21 deletions config.default.ini
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
[store]
buf_size = 100
buf_size = 50
base_dir = tmp

[bus]
piority_groups = 168
num_workers = 1
piority_groups = 8
num_workers = 5

[backtest]
batch_size = 1597
window_size = 2
batch_size = 350
buff_size = 8
window_size = 1

[position]
risk_reward_ratio = 1.618
trade_duration = 900
twap_duration = 180
max_order_slice = 13
trade_duration = 26800
twap_duration = 80
max_order_slice = 8
order_expiration_time = 8
max_order_breach = 3
stop_loss_threshold = 0.5
risk_factor = 0.618
tp_factor = 2.236
sl_factor = 2.236
trl_factor = 1.236
depth = 80
dom = 15
max_scale_in = 0

[portfolio]
risk_per_trade = 0.005
risk_per_trade = 0.0004
account_size = 1000
cagr_threshold = 0.01
sharpe_ratio_threshold = 0.236
total_trades_threshold = 8
sharpe_ratio_threshold = 0.23
total_trades_threshold = 6

[system]
active_strategy_num = 3
verify_strategy_num = 21
mode = 1
leverage = 1
leverage = 75
reevaluate_timeout = 3600

[generator]
n_samples = 21
n_samples = 8
blacklist = [USDCUSDT]
timeframes = [5m]

[optimization]
max_generations = 5
max_generations = 3
elite_count = 3
mutation_rate = 0.0236
crossover_rate = 0.8
tournament_size = 5
reset_percentage = 0.236
stability_percentage = 0.382
stability_percentage = 0.382

[copilot]
model_path = ''
n_ctx = 4096
n_threads = 7
n_gpu_layers = 2
n_batch = 256
max_tokens = 66
temperature = 0.52
3 changes: 3 additions & 0 deletions copilot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._actor import CopilotActor

__all__ = [CopilotActor]
Loading

0 comments on commit ef9a9d3

Please sign in to comment.