PolyVelocity Strategy Optimization Guide
Polynomial forecast-velocity signal engine, stop-and-reverse execution
Exact Start / Step / End values for the NinjaTrader 8 Strategy Analyzer (Optimize tab), the order to optimize in, and how to avoid curve-fitting.
HOW THE SYSTEM WORKS
- Trades the PolyVelocity indicator's BuySignal / SellSignal series: a least-squares polynomial fit of degree Degree over the last N closes, evaluated for its forecast derivative ("velocity"), normalized (Auto or Manual), and compared against VUp / -VDn thresholds.
- Every PolyVelocity signal-relevant parameter (Degree, N, VUp, VDn, NormMode, NormPeriod, Mult, RequireAccelConfirm, the session time filter) is exposed directly on the strategy and passed straight through to its internal PolyVelocity indicator instance.
- Execution is stop-and-reverse, but NOT unconditionally: an opposite signal while in a position exits it immediately (that part IS unconditional), then the strategy attempts to re-enter in the new direction on the SAME bar, provided CanEnter() (the Max Trades Per Day cap) passes AND the volume filter (if enabled) passes on that bar. If either check fails, the strategy goes flat instead of reversing - it will NOT force a reversal through a blocked filter.
- Runs a fixed-tick stop loss, profit target, and optional breakeven / trailing stop stack on whichever position results.
- ShowArrows is NOT exposed on the strategy - it is hardcoded true in the strategy's internal indicator instantiation, so chart arrows always draw regardless of any setting you look for here.
FULLY DETERMINISTIC - NO ML, NO RANDOMNESS
The polynomial least-squares fit, its normalization (Auto or Manual), and the threshold comparisons are pure arithmetic - there is no trained model and no random number generator anywhere in this strategy or its indicator. A single backtest run is trustworthy as-is: running the same settings on the same data twice will reproduce identical results, so there is no reproducibility check needed before you start (unlike an ML-based system).
"TICKS" UNITS
All *Ticks inputs (StopLossTicks, TargetTicks, BreakEvenTriggerTicks, etc.) are in ticks of the instrument you attach the strategy to, not points or pips. Check your instrument's TickSize before carrying a tick value from one instrument to another (e.g. ES vs NQ vs a stock).
STRATEGY ANALYZER SETUP
- Use real tick-based historical data. Fixed-interval time bars only (e.g. 1-minute, 5-minute) - tick, range, and Renko bars distort the time axis the polynomial fit depends on and are not supported.
- Period: 1-2+ years of data; hold back the most recent ~25-30% for out-of-sample validation, or use NT8's Walk-Forward Optimization feature to automate that split.
- Optimization criterion: Profit Factor or a combination criterion that also weighs Max Drawdown - don't optimize on net profit alone.
- Bools optimize as Start 0 / Step 1 / End 1 (tests both false and true) in the Optimize tab's checkbox-style row.
OPTIMIZATION TABLES (Start / Step / End)
GROUP A: POLYVELOCITY SIGNAL PARAMETERS (optimize first - this is where the actual trading edge lives)
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Degree | 1 | 1 | 4 | polynomial order (default 2) |
| N (lookback bars) | 20 | 20 | 200 | closes in the fit (default 60) |
| VUp | 1.00 | 0.25 | 4.00 | long threshold, normalized units (default 2.0) |
| VDn | 1.00 | 0.25 | 4.00 | short threshold, normalized units (default 1.25) |
NormMode: Auto vs Manual produce values on genuinely different scales (per the PolyVelocity indicator's own documentation). Do NOT grid-sweep NormMode combined with VUp/VDn/NormPeriod/Mult in one pass - run Auto and Manual as two SEPARATE locked passes instead, each with its own VUp/VDn re-optimization, then compare the two results and pick one.
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Norm period (Auto) | 200 | 100 | 1000 | Auto mode ONLY (default 500) |
| Mult (Manual) | - | - | - | Manual mode ONLY (default 3.87) |
| Require accel confirm | 0 | 1 | 1 | bool (default false) |
WARNING: the shipped default (3.87) is calibrated to a specific reference study (NQ, 1-minute bars per the indicator's own description) - it is NOT a universal constant. Do not carry this value over to a different instrument or timeframe unchanged; re-derive an appropriate Mult for your own instrument/timeframe before trusting Manual mode results.
UseTimeFilter / Session Start / Session End: set ONCE to match your own instrument's actual trading session hours - do not grid-sweep session times. UseTimeFilter defaults true, Session Start 09:00, Session End 15:00 (chart time); adjust to your instrument before optimizing anything else in this group.
GROUP B: STOP LOSS / TARGET (optimize with Group A locked)
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Use Stop Loss | 0 | 1 | 1 | bool, default true - enables the fixed-tick stop below |
| Stop Loss (Ticks) | 10 | 10 | 100 | default 40; only meaningful if Use Stop Loss = true |
| Use Target | 0 | 1 | 1 | bool, default true - enables the fixed-tick target below |
| Target (Ticks) | 15 | 15 | 150 | default 60; only meaningful if Use Target = true |
Leave Use Stop Loss and Use Target at their defaults (both true) unless you deliberately want to test running without a stop or without a target - disabling either changes the risk profile fundamentally, not just its distance, so treat them as a conscious choice rather than a routine sweep.
GROUP C: BREAKEVEN (choose ONE of Group C or Group D - never both; see the critical note under Group D)
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Use Break Even | 0 | 1 | 1 | bool (default true) |
| Trigger (Ticks) | 10 | 5 | 60 | default 20 |
| Offset (Ticks) | 0 | 5 | 20 | default 5 |
GROUP D: TRAILING STOP (optional, off by default)
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Use Trailing Stop | 0 | 1 | 1 | bool (default false) |
| Trigger (Ticks) | 10 | 10 | 100 | default 30 |
| Offset (Ticks) | 5 | 5 | 50 | default 15 |
CRITICAL - do not optimize Group C and Group D together, and do not enable both in production: with the strategy's SHIPPED DEFAULTS, Break Even Trigger (Ticks) = 20 is LESS than Trailing Stop Trigger (Ticks) = 30. Breakeven's trigger is reached first, so its SetStopLoss() call fires and PERMANENTLY overrides the trailing stop for that trade - the position is then managed by the fixed breakeven stop, not a trailing stop, for the rest of its life. The strategy's own log may still print "Trailing Stop ACTIVATED!" later in that same trade even though the trailing stop is not actually the one managing the exit at that point. Pick one management style (Group C or Group D), lock the other one off, and optimize only the one you chose.
GROUP E: TRADE MANAGEMENT
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Max Trades Per Day | 2 | 2 | 10 | default 1; 0 = unlimited |
NOTE: a reversal counts as TWO trades against this cap (the exit leg and the re-entry leg each increment the counter independently) - a trader thinking in terms of "how many reversals can happen today" needs to set this cap at roughly DOUBLE what a flat-required strategy would need for the same number of round-trip signals. Setting it too low will cause the strategy to exit on a reversal signal and then sit flat instead of re-entering, once the cap is hit for the day.
GROUP F: ENTRY FILTERS
| Input | Start | Step | End | Note |
|---|---|---|---|---|
| Use Volume Filter | 0 | 1 | 1 | bool (default false) |
| Volume Multiplier | 0.80 | 0.20 | 2.00 | default 1.2; only if filter on |
NOTE: per the strategy's design, this filter gates BOTH a fresh entry from flat AND the re-entry leg of a reversal. A strict (high) Volume Multiplier can cause the strategy to sit flat after an exit instead of reversing, because the re-entry leg fails the same volume check a fresh entry would - this is expected behavior arising from the shared entry path (EnterOrReverse), not a bug.
SET, DON'T OPTIMIZE
- Contract Quantity (your position size - scales P&L, not the edge).
PHASES (order; lock each before the next)
- GROUP A (signal parameters) FIRST. Lock Degree / N / VUp / VDn / NormMode (running Auto and Manual as separate passes per the note above, and re-deriving Mult if you keep Manual) before touching anything else - this is where the strategy's actual trading edge comes from. Everything downstream trades whatever signal Group A produces.
- GROUP B (stop loss / target) - with Group A locked.
- GROUP E (trade management / Max Trades Per Day) - remembering the reversal-counts-as-2 rule when choosing a cap.
- GROUP F (volume filter) - one setting at a time; watch for the sit-flat-instead-of-reverse effect noted above if you tighten it.
- Choose ONE of GROUP C (breakeven) or GROUP D (trailing stop) as a final, optional overlay - never both - tested LAST against the already-locked settings from steps 1-4.
READING RESULTS / VALIDATION
- Weigh Profit Factor (>1.2, >1.5 strong), Max Drawdown, Sharpe Ratio, and total trade count together - don't sort by net profit alone.
- TRADE COUNT NOTE (NT8-specific): because this strategy is stop-and-reverse rather than flat-required, its raw trade count will run roughly DOUBLE what a flat-required strategy shows at the same underlying signal frequency, since most reversals register as 2 trades (an exit leg + a re-entry leg) rather than 1 round trip. Don't be alarmed by a higher trade count than a comparable flat-required strategy on this same product line (e.g. the Enhanced ORB Strategy) when comparing the two side by side - it does not by itself mean more signals or a different edge, just a different trade-counting mechanic.
- CLUSTER TEST: in the Strategy Analyzer's optimization results, the best row should be surrounded by other good rows, not standing alone as a lone spike. A slightly-lower but robust setting beats a fragile peak that collapses when a neighboring parameter shifts slightly.
- OUT-OF-SAMPLE: use NT8's Walk-Forward Optimization feature (or a manual older-data / held-out-recent-data split) to confirm the locked settings from the PHASES above hold up on data the optimizer never saw. If performance collapses out-of-sample, the in-sample result was curve-fit - go back and pick a broader, coarser setting from the cluster instead.
- Repeat this whole process per instrument and per timeframe - there is no universal setting, especially for Mult in Manual mode.
QUICK-START CHECKLIST
- Real tick-based data; fixed-interval time bars; tick units checked
- Degree / N / VUp / VDn / NormMode optimized and locked (Auto and Manual tested as separate passes; Mult RE-DERIVED for this instrument/timeframe if using Manual, not carried over from another instrument)
- Session Start / Session End set once to this instrument's actual trading hours (not grid-swept)
- Stop Loss (Ticks) / Target (Ticks) optimized and locked
- Max Trades Per Day set with the reversal-counts-as-2 rule in mind
- Volume filter tuned one setting at a time, if used
- Only ONE of Break Even or Trailing Stop enabled, if either - never both (with shipped defaults, Break Even fires first anyway)
- Picked from a STABLE CLUSTER in the optimizer results, not a spike
- Validated with NT8 Walk-Forward Optimization (out-of-sample) - it held up
- Repeated per instrument / timeframe
- Demo-confirmed, then live