Strategy vault / DCA & fixed investment
Daily Market Price Fixed Investment
JavaScript strategy by cdxy.
JavaScriptDCA & fixed investment
The original spec has no written description. Read the source below.
Parameters
| Name | Default | What it controls |
|---|---|---|
| singleInvestAmount | true | Market Buy |
Source JavaScript
function main() {
Log(exchange.GetAccount());
//Date of the most recent investment
var lastInvestDate = '';
while (true) {
//Each polling interval is60second
Sleep(60 * 1000);
//If the current date is the same as the last investment date, it means that you have already invested on that day and skip it.
var now = new Date();
var date = now.toISOString().slice(0,10);
if (date == lastInvestDate) {
continue;
}
lastInvestDate = date;
Log("Date: " + date);
exchange.Buy(-1, singleInvestAmount);
}
}
Published by cdxy on the FMZ strategy square · last modified 2019-06-07. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Daily-Market-Price-Fixed-Investment.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Ahr999 Fixed Investment StrategyJavaScript · DCA & fixed investment · 1d
- My 1 Value Average Fixed Investment StrategyJavaScript · DCA & fixed investment
- 100USDT Invested Every Week Regular Variable InvestmentPython · DCA & fixed investment
- Dollar Cost Averaging Investment StrategyPine Script · DCA & fixed investment · 1d
- Dynamic DCA based Cryptocurrency Quantitative Trading StrategyPine Script · DCA & fixed investment · 1h
- Dynamic Position Building StrategyPine Script · DCA & fixed investment · 1h