Strategy vault / DCA & fixed investment
Digital Currency Fixed Investment
Universal fixed investment strategy for digital currencies, supporting simultaneous fixed investment on multiple exchanges orderAmount Fixed investment amount: BTCCNY and BCCCNY in CNY, BCCBTC in BTC, etc…
Universal fixed investment strategy for digital currencies, supporting simultaneous fixed investment on multiple exchanges
Parameter description
orderAmount #Fixed investment amount: BTCCNY and BCCCNY in CNY, BCCBTC in BTC, etc.
accountLimitMoney #Account limit: keep some money. When the account reaches the minimum limit, stop fixed investment
orderTimeInterval #Regular casting interval, in seconds, per minute = 60 Per hour = 3600 per day = 86400 per week=604800
maxBidPrice #Maximum trading price. Skip if exceeded, wait for the next trading opportunity
Parameters
| Name | Default | What it controls |
|---|---|---|
| orderAmount | true | order amount |
| maxBidPrice | false | max bid price |
| accountLimitMoney | false | account limit money |
| orderTimeInterval | 60 | Order Time Interval |
Source Python
def onTick():
exchange_count = len(exchanges)
for i in range(exchange_count):
account = exchanges[i].GetAccount()
marketName = exchanges[i].GetName()
depth = exchanges[i].GetDepth()
Log("Market ",marketName,exchanges[i].GetCurrency(),"Account Balance [",account["Balance"],"] Stocks[",account["Stocks"],"]")
if account and depth and account["Balance"] > accountLimitMoney :
bidPrice = depth["Asks"][0]["Price"]
if bidPrice < maxBidPrice :
amount = orderAmount
if amount <= account["Balance"]:
exchanges[i].Buy(amount)
else:
Log("Account Balance is less than bid Amount")
else:
Log("Bid Price >= maxBidPrice, not process")
else:
Log("Account Balance <= accountLimitMoney")
def main() :
while 1:
onTick()
time.sleep(orderTimeInterval)Published by ankye on the FMZ strategy square · last modified 2017-09-08. 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/Digital-Currency-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
- Fixed Investment StrategyPython · DCA & fixed investment
- 100USDT Invested Every Week Regular Fixed InvestmentPython · 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