How the signal fires, how positions are sized, and how the backtest engine simulates it all.
Fires when the short EMA crosses above the long EMA at the close of a candle.
If a SHORT is open, it is closed first. Then the new LONG opens at the same price.
Fires when the short EMA crosses below the long EMA at the close of a candle.
If a LONG is open, it is closed first. Then the new SHORT opens at the same price.
Standard EMA with an SMA seed for the first period candles. The smoothing factor k controls how fast it responds to new prices.
Default periods and what they mean in practice:
Each trade uses 95% of available balance as margin. The remaining 5% stays liquid.
Leverage is baked into size, so PnL is simply Δprice × size — no second multiply.
SL and TP are calculated as a percentage of entry at open time. Checked on every live WebSocket tick to catch intra-candle wicks.
Example: $1,000 balance, 3× leverage, entry $64,000 → margin $950, size ≈ 0.0445 BTC. Price +2%: PnL ≈ +$57 (+6% of margin).
Auto-selected per date range to balance data resolution and Binance API limits.
| Preset | Range (days) | Interval | Candles (approx) |
|---|---|---|---|
| 1M, 3M, 6M | ≤ 90 days | 1h | ~720 |
| 1Y | 91 – 365 days | 4h | ~720 |
| 2Y, 5Y | > 365 days | 1d | up to 1826 |