0bps

Strategy vault / Tools & templates

Template Library Usage Examples

Template Library Usage Examples

Author
Zero
Complexity
Starter · 4 lines
Parameters
2

Template Library Usage Examples

Parameters

NameDefaultWhat it controls
OType0Buy or sell: Buy | Sell
Amount0.5Order Quantity

Source JavaScript


function main() {
    Log(OType === 0 ? $.Buy(Amount) : $.Sell(Amount));
}

Published by Zero on the FMZ strategy square · last modified 2016-02-20. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a tested, production-ready module from strategies/Template-Library-Usage-Examples.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open