Strategy vault / DCA & fixed investment
100USDT Invested Every Week Regular Fixed Investment
Invest 100 USDT weekly, with fixed periodic amounts
PythonDCA & fixed investment
Invest 100 USDT weekly, with fixed periodic amounts
Source Python
def main():
amountAll = 0 #Total Holdings
cost = 0 #Cost
marketValueCurrent = 0 #Current total market value of holdings
rateOfReturn = 0 #Yield
while True:
ticker = exchange.GetTicker()
price = ticker['Last'] #Get current price
amount = 100 / price #Calculate the purchase amount this time
exchange.Buy(price,amount) #buy
amountAll = amountAll + amount #Calculate total holding amount
cost = cost + 100 #Calculate total cost
marketValueCurrent = amountAll * price #Calculate the current total market value held
rateOfReturn = (marketValueCurrent - cost) / cost #Calculate return rate
Log("Amount invested this time:", 100, "Principal:", cost, "Current total market value:", marketValueCurrent, "Yield:", rateOfReturn * 100,"%","Current Price",price)
Sleep(7 * 24 * 60 * 60 * 1000) #Wait for a Week
Published by jfyh5388 on the FMZ strategy square · last modified 2021-04-06. 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/100USDT-Invested-Every-Week-Regular-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
- 100USDT Invested Every Week Regular Variable InvestmentPython · DCA & fixed investment
- Digital Currency Fixed InvestmentPython · DCA & fixed investment
- Fixed Investment StrategyPython · DCA & fixed investment
- Martin Variant Original VersionPython · 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