Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/targets/longbridge/hk_combo.example.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../../schemas/runtime-target.schema.json",
"target_id": "longbridge/hk_combo_sg",
"target_id": "longbridge/hk_combo",
"description": "LongBridge SG target for hk_equity_combo (60/40 ETF momentum/dividend quality with dynamic regime adjustment).",
"github": {
"repository": "QuantStrategyLab/LongBridgePlatform",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../../schemas/runtime-target.schema.json",
"target_id": "longbridge/us_combo_leveraged_sg",
"target_id": "longbridge/us_combo_leveraged",
"description": "LongBridge SG target for us_equity_combo_leveraged (40/20/40 TQQQ/SOXL/BOXX with SPY MA200 dynamic adjustment).",
"github": {
"repository": "QuantStrategyLab/LongBridgePlatform",
Expand Down
2 changes: 1 addition & 1 deletion examples/targets/qmt/cn_combo.example.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../../schemas/runtime-target.schema.json",
"target_id": "qmt/cn_combo_dry_run",
"target_id": "qmt/cn_combo",
"description": "QMT dry-run target for cn_equity_combo (30/50/20 ETF/stock/dividend with dynamic regime adjustment).",
"github": {
"repository": "QuantStrategyLab/QmtPlatform",
Expand Down
30 changes: 15 additions & 15 deletions internal_dependency_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"path": "requirements.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "bc5351d3567b2bb60416dc969062c37eedbbf65e"
"ref": "e86554b"
},
{
"consumer_repo": "BinancePlatform",
Expand All @@ -20,7 +20,7 @@
"path": "requirements-lock.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "bc5351d3567b2bb60416dc969062c37eedbbf65e"
"ref": "e86554b"
},
{
"consumer_repo": "BinancePlatform",
Expand All @@ -34,7 +34,7 @@
"path": "requirements.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "CharlesSchwabPlatform",
Expand All @@ -55,7 +55,7 @@
"path": "pyproject.toml",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "FirstradePlatform",
Expand All @@ -69,7 +69,7 @@
"path": "requirements.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "FirstradePlatform",
Expand All @@ -83,14 +83,14 @@
"path": "pyproject.toml",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "InteractiveBrokersPlatform",
"path": "requirements.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "InteractiveBrokersPlatform",
Expand All @@ -111,7 +111,7 @@
"path": "requirements.txt",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "LongBridgePlatform",
Expand All @@ -132,7 +132,7 @@
"path": "pyproject.toml",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "7b6e3ce33e6563db4794fa7b865db9ec428dc478"
"ref": "e86554b"
},
{
"consumer_repo": "UsEquitySnapshotPipelines",
Expand All @@ -146,35 +146,35 @@
"path": "pyproject.toml",
"package": "us-equity-strategies",
"source_repo": "UsEquityStrategies",
"ref": "c7793bab6d63a434338bfcfd997a7ae9195dcddb"
"ref": "a9546362a27abdfc9cd5184b30ca8d26fd774187"
},
{
"consumer_repo": "UsEquityStrategies",
"path": "pyproject.toml",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "dfdbef6b58ab46f357d67800510bb9e8c4a01182"
"ref": "e86554b"
},
{
"consumer_repo": "QmtPlatform",
"path": "pyproject.toml",
"package": "quant-platform-kit",
"source_repo": "QuantPlatformKit",
"ref": "d18fe32b57a0a8bb746bebf6f11465dd68107eae"
"ref": "e86554b"
},
{
"consumer_repo": "QmtPlatform",
"path": "pyproject.toml",
"package": "cn-equity-strategies",
"source_repo": "CnEquityStrategies",
"ref": "de6c76033e9d8a83fd6a8a31a51ce98690bb4262"
"ref": "357dba7e8896a7f488a484d4a3eea33894708ab9"
},
{
"consumer_repo": "CnEquitySnapshotPipelines",
"path": "pyproject.toml",
"package": "cn-equity-strategies",
"source_repo": "CnEquityStrategies",
"ref": "0440651539dad4bb79c21bb5b965e97daec837de"
"ref": "357dba7e8896a7f488a484d4a3eea33894708ab9"
}
]
}
}
3 changes: 3 additions & 0 deletions scripts/runtime_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
"ibkr": {"plugin_mounts_prefix": "IBKR_", "repository": "QuantStrategyLab/InteractiveBrokersPlatform"},
"firstrade": {"plugin_mounts_prefix": "FIRSTRADE_", "repository": "QuantStrategyLab/FirstradePlatform"},
"qmt": {"plugin_mounts_prefix": "QMT_", "repository": "QuantStrategyLab/QmtPlatform"},
"binance": {"plugin_mounts_prefix": "BINANCE_", "repository": "QuantStrategyLab/BinancePlatform"},
}
PLATFORM_REPOSITORY_ENV = {
"schwab": "RUNTIME_SETTINGS_SCHWAB_REPO",
"longbridge": "RUNTIME_SETTINGS_LONGBRIDGE_REPO",
"ibkr": "RUNTIME_SETTINGS_IBKR_REPO",
"firstrade": "RUNTIME_SETTINGS_FIRSTRADE_REPO",
"qmt": "RUNTIME_SETTINGS_QMT_REPO",
"binance": "RUNTIME_SETTINGS_BINANCE_REPO",
}
RUNTIME_REQUIRED_FIELDS = (
"platform_id",
Expand Down Expand Up @@ -102,6 +104,7 @@
"longbridge": "LONGBRIDGE_DRY_RUN_ONLY",
"ibkr": "IBKR_DRY_RUN_ONLY",
"firstrade": "FIRSTRADE_DRY_RUN_ONLY",
"binance": "BINANCE_DRY_RUN",
}


Expand Down
32 changes: 1 addition & 31 deletions web/strategy-switch-console/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const DCA_PROFILE_CONFIG = {
ibit_smart_dca: { default_mode: "fixed", default_base_investment_usd: "1000" },
crypto_btc_dca: { default_mode: "fixed", default_base_investment_usd: "100" },
};
const DCA_SUPPORTED_PLATFORMS = new Set(["firstrade"]);
const DCA_SUPPORTED_PLATFORMS = new Set(["firstrade", "binance"]);
const SECURITY_HEADERS = {
"Content-Security-Policy": [
"default-src 'self'",
Expand Down Expand Up @@ -1795,36 +1795,6 @@ async function fetchGithubVariable(token, repository, scope, githubEnvironment,
}
}

async function fetchAllGithubVariables(token, repository, scope, githubEnvironment) {
const apiUrl = githubVariableListUrl(repository, scope, githubEnvironment);
if (!apiUrl) return {};
try {
const response = await fetchWithTimeout(apiUrl, {
headers: githubHeaders(token),
});
if (!response.ok) return {};
const payload = await response.json();
const vars = Array.isArray(payload) ? payload : (payload?.variables || []);
const result = {};
for (const v of vars) {
result[v.name] = v.value;
}
return result;
} catch {
return {};
}
}

function githubVariableListUrl(repository, scope, githubEnvironment) {
const [owner, repo] = String(repository || "").split("/");
if (!owner || !repo) return "";
const base = `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`;
if (scope === "environment") {
if (!githubEnvironment) return "";
return `${base}/environments/${encodeURIComponent(githubEnvironment)}/variables`;
}
return `${base}/actions/variables`;
}

function githubVariableUrl(repository, scope, githubEnvironment, name) {
const [owner, repo] = String(repository || "").split("/");
Expand Down
Loading