DARKPOOL ALGO
Guides/PolyVelocity
Free Optimization Guide

PolyVelocity Optimization Guide

1. What PolyVelocity Is

PolyVelocity fits a curve to your recent closes and tells you how fast the trend is moving — and, if you turn that curve's speed into a rate of change again, whether that speed is picking up or fading. Think of it like a speedometer for price: it doesn't just say "price went up," it says "price is moving up at this specific velocity, and here's whether that velocity is still accelerating." Signals only fire when that velocity clears a noise threshold, so the indicator stays quiet during choppy, directionless action and speaks up when the trend actually has legs.

Under the hood, PolyVelocity fits a least-squares polynomial (you choose the order — a line, or a curve up to 4th degree) to the last N closes, then evaluates the first derivative of that polynomial at the forecast point. That derivative is the "velocity." Version 2 adds the second derivative — the "acceleration" — evaluated the same way.

This indicator is based on Dennis Meyers' published quantitative working paper on the Nth Order Fixed Memory Polynomial Velocity strategy. The math (weight construction via Gram-Schmidt orthogonalization, next-bar forecast derivatives) follows that paper closely; the default parameters below trace back to the paper's NQ 1-minute study. Treat the paper as an educational reference for why the math works, not as a guarantee of the numbers you'll see on your own charts.

2. Installation

There are two ways to get PolyVelocity into NinjaTrader 8:

A. NinjaScript import (recommended, and how it ships). In NinjaTrader 8, go to Tools > Import > NinjaScript Add-On... and select the .zip file you were given. NinjaTrader handles unpacking, placing files in the right folders, and compiling for you. This is the shipping method — use it unless you have a specific reason not to.

B. Manual .cs drop (if you're installing from source). Copy the PolyVelocity.cs and PolyVelocityMath.cs files into your bin\Custom\Indicators folder, then open the NinjaScript Editor inside NinjaTrader and press F5 to compile. If compilation fails, read the error list at the bottom of the editor — it will usually point at a missing file or a naming conflict.

Warning: Never unzip a NinjaScript export .zip manually into bin\Custom. The zip's internal folder structure and NinjaTrader's own project files don't line up the way you'd expect, and hand-extracting it is a common way to end up with duplicate classes or a broken compile. Always use the Import dialog for .zip files.

3. Adding It to a Chart

Open a chart, right-click, choose Indicators..., find PolyVelocity in the list, and add it. It draws in its own panel below the price panel (it is not an overlay).

Chart type matters. PolyVelocity is built for fixed-interval time bars (1-minute, 5-minute, and so on). It is not designed for tick bars, range bars, or Renko bars — those bar types distort the time axis that the polynomial fit depends on, so velocity and acceleration readings on non-time bars won't mean what you think they mean. Stick to time-based charts.

Warmup. The plot will be blank for the first N bars (N is the lookback parameter, default 60) — there simply isn't enough data yet to fit the polynomial. If you're using Auto normalization (the default), expect roughly 50 additional bars of blank/zero output beyond that before the rolling standard deviation has enough samples to normalize against. This is normal — it is not a sign of a broken indicator.

4. Parameter Reference

All names and defaults below are transcribed directly from the indicator's property definitions, so what you see in the NinjaTrader parameters dialog will match this table exactly.

Parameter (display name) Default Group What it does / when to change it
Degree 2 Parameters Order of the polynomial fit (1–4). 1 = straight line (fastest, least noisy, no acceleration). Higher degrees track curvature better but react to more noise. Raise it for more responsiveness in a strong trend; lower it if signals feel jumpy.
N (lookback bars) 60 Parameters How many recent closes go into the fit. Larger N smooths the fit and reacts slower; smaller N reacts faster but is noisier. Must be at least Degree + 2 — the indicator enforces this floor automatically.
VUp 2.0 Parameters Long threshold, in normalized velocity units. A long signal needs normalized velocity to cross above this value. Raise it to demand a stronger move before going long.
VDn 1.25 Parameters Short threshold, in normalized velocity units. The indicator plots this as -VDn, and a short signal needs normalized velocity to cross below that line. Raise it to demand a stronger move before going short.
Normalization Auto Normalization Auto divides raw velocity (and raw acceleration) by their own rolling standard deviation, so thresholds stay meaningful in standard-deviation units across different instruments and volatility regimes. Manual instead multiplies by a fixed Mult. Leave this on Auto unless you specifically want to match the paper's fixed-multiplier setup.
Norm period (Auto) 500 Normalization The rolling window (in bars) used to compute that standard deviation when Normalization is Auto. Longer periods make the normalization more stable but slower to adapt to a volatility regime change; shorter periods adapt faster but are noisier.
Mult (Manual) 3.87 Normalization Fixed multiplier applied to raw velocity (and raw acceleration) when Normalization is Manual. The default of 3.87 is the paper's value for NQ on a 1-minute chart — it is not a universal constant and will not automatically make sense on other instruments or timeframes.
Show arrows true Signals Draws an up-arrow or down-arrow on the price panel when a long or short signal fires. Turn it off if you only want the BuySignal/SellSignal series (for example, when driving a strategy) without the visual clutter.
Use time filter true Signals Restricts signals to the window between Session start and Session end (chart time). Turn it off to allow signals at any time of day — useful for instruments that trade around the clock or when you don't want a session cutoff.
Session start 09:00 Signals Start of the signal window when Use time filter is on. The paper uses 30 minutes after the 08:30 CT futures open; adjust to match your instrument's session and your own preferred start time.
Session end 15:00 Signals End of the signal window when Use time filter is on. Once chart time reaches this value, any open state is flattened and no new signals fire until the next session. The paper uses a 15:00 CT close-out. Session start must be earlier than session end — this is a same-day window only; overnight windows are not supported.
Require accel confirmation false Signals When true, a long signal additionally requires raw acceleration to be positive (a short requires it negative) at the moment velocity crosses the threshold. Ignored when Degree = 1, since a straight-line fit has no curvature to check. Turn this on to filter out crosses where the trend's speed is already leveling off or reversing. See Section 7 for the full explanation.

5. How a Signal Forms

Signals evaluate on closed bars only (the indicator is set to Calculate = OnBarClose by design — leave it that way). Here is the walk-through for one long signal:

  1. On each new closed bar, PolyVelocity fits the polynomial to the last N closes and computes normalized velocity.
  2. If normalized velocity crosses above VUp (was at or below VUp on the prior bar, is above it on this bar), and the current position state isn't already long, that's a candidate long cross.
  3. If Use time filter is on, the candidate is only accepted if the current bar's time falls within the Session start–Session end window. Outside that window (or after session end), no new signals fire, and at session end any open state is flattened back to flat.
  4. If Require accel confirmation is on (and Degree is not 1), the candidate additionally needs raw acceleration to be positive on this bar. If acceleration is flat or negative, the cross is skipped — the trend's speed crossed the threshold, but it isn't gaining momentum, so the signal is held back.
  5. If all of the above pass, the indicator fires: internal state flips to "long," BuySignal is set to 1 for that bar, and (if Show arrows is on) an up-arrow is drawn below the bar.
  6. From here the indicator is stop-and-reverse at the state level: if a later bar crosses below -VDn while still in the long state, it flips directly to short (setting SellSignal and drawing a down-arrow) rather than requiring a flat state in between. The same logic runs in mirror for shorts crossing into longs.
  7. At session end, state is forced back to flat regardless of where velocity sits, and no new entries are considered until the next session's window opens.

6. Tuning Cookbook

Goal: fewer, stronger signals. Change: raise VUp/VDn, enable Require accel confirmation, or lower Degree toward 1–2. Expect: fewer crosses overall, but the ones that do fire represent more decisive moves. Turning on accel confirmation in particular filters out threshold crosses where the trend is already losing steam.

Goal: earlier trend entry. Change: raise Degree to 3–4 and use a larger N. Expect: the higher-order fit picks up curvature sooner, so you catch trend starts earlier — but you'll also pick up more noise-driven false starts. This trade-off is the core tension in the indicator; there's no free lunch here.

Goal: handle choppy or quiet markets. Change: raise VUp/VDn thresholds, and/or drop Degree to 1–2. Expect: a straight-line fit (Degree 1) is the least sensitive to noise and simply won't signal much when there's no real trend — which is the point. Higher thresholds mean the indicator waits for a clearer move before committing.

Goal: use it on other instruments or timeframes. Change: keep Normalization on Auto. Do not carry over the Manual Mult default (3.87) — that number is specific to the paper's NQ 1-minute study and will be wrong (too strong or too weak) on a different instrument or bar size. Auto's thresholds stay meaningful in standard-deviation units regardless of what you're trading, which is why it's the safer default when moving to a new market. Expect: with Auto, VUp/VDn keep the same intuitive meaning ("how many standard deviations of velocity") across instruments; with Manual, you would need to re-derive an appropriate Mult yourself, which this guide does not attempt to do for you.

Goal: scalping vs. swing posture. Change: for a scalping feel, use a smaller N on a fast timeframe (e.g., 1-minute) so the fit reacts quickly. For a swing feel, use a larger N and/or a slower timeframe (e.g., 5- or 15-minute) so the fit smooths over intrabar noise and reacts to the larger trend. Expect: N and timeframe interact — the same N means a much longer lookback in wall-clock time on a 15-minute chart than on a 1-minute chart. Tune them together, not independently.

7. The Acceleration Plot

Velocity tells you how fast price is trending. Acceleration — the Goldenrod line — tells you whether that speed is increasing or decreasing. A rising Goldenrod line alongside rising Velocity means the trend is speeding up; a falling Goldenrod line while Velocity is still positive means the trend is decelerating, even though it hasn't reversed yet. Watching for that divergence — velocity still elevated but acceleration rolling over — is often the earliest hint that a trend is running out of steam, before velocity itself crosses back through a threshold.

The confirm gate (Require accel confirmation) only checks the sign of raw acceleration, not its magnitude, and it checks the raw value rather than the normalized/displayed one. That's deliberate: sign alone answers the question "is momentum still building in this direction," and using the raw value means the confirm gate's behavior doesn't shift if you later change Normalization or Mult — it's normalization-invariant by construction.

Degree 1 (a straight-line fit) has no curvature, so its acceleration is always exactly zero, and both the plot and the confirm gate reflect that: the Goldenrod line will sit flat at zero, and Require accel confirmation is automatically bypassed (never blocks a signal) when Degree is 1.

Important scaling caveat — Manual normalization mode: when Normalization is set to Manual, the Acceleration plot's displayed value is raw acceleration multiplied by the same Mult you use for velocity. But raw acceleration and raw velocity are in different units (acceleration is a rate of change of a rate of change), so multiplying both by the same constant does not put them on a common, comparable scale. In Manual mode, do not compare the Goldenrod line's magnitude directly against VUp/VDn, and do not assume its scale lines up visually with the Magenta velocity line — those thresholds were built for velocity, not acceleration. This caveat does not apply in Auto mode: Auto normalizes acceleration independently, dividing raw acceleration by its own rolling standard deviation, so the displayed Goldenrod line is already in its own meaningful standard-deviation units and doesn't inherit velocity's scale.

8. Limitations & Honest Caveats

  • The source paper's parameters were re-optimized on a weekly walk-forward basis. The defaults shipped here are a fixed snapshot, not a continuously re-tuned system. Treat them as a reasonable starting point, not a permanently optimal setting.
  • Because the settings are fixed, they can go stale as market conditions shift. A parameter set that worked well in one volatility regime may underperform in another. Periodically re-evaluate whether your settings still make sense for current conditions.
  • The session time filter only supports a same-day window (Session start earlier than Session end). Overnight or cross-midnight session windows are not supported.
  • Signals evaluate on closed bars only. The indicator is built around Calculate = OnBarClose — leave this setting alone. Switching to intrabar calculation (OnPriceChange / OnEachTick) is not how this indicator is designed to run and may produce confusing or inconsistent-looking signal behavior.
  • Nothing here is a claim about future performance. Any historical behavior you observe — in the paper or on your own charts — is hypothetical/backward-looking and does not guarantee similar results going forward.

9. Troubleshooting

The plot is blank. You're most likely still in the warmup period — blank for the first N bars, plus roughly 50 more bars in Auto mode before the rolling standard deviation has enough samples. Wait for more bars to load, or check that your chart has enough historical data.

No arrows are appearing. Check three things: (1) Show arrows is turned on; (2) if Use time filter is on, confirm the current bar falls within your Session start/Session end window; (3) if Require accel confirmation is on, remember it can silently prevent a threshold cross from becoming a signal when acceleration doesn't agree in sign — try toggling it off to confirm that's the cause.

The scale looks completely different from another chart or another trader's screenshot. This almost always means one of you is on Manual normalization and the other is on Auto, or you're using different Mult/Norm period values. Manual and Auto produce values on genuinely different scales by design — check the Normalization parameter first.

The indicator shows as disabled after I edited the source. After any change to the .cs files, you need to recompile: open the NinjaScript Editor and press F5. NinjaTrader disables indicators whose compiled code is out of sync with the source until a successful recompile.

10. Risk Disclaimer

Trading futures and other derivatives involves substantial risk of loss and is not suitable for every investor. PolyVelocity is an educational and analytical tool, not a signal service or investment advice. Any historical or hypothetical performance referenced in connection with this indicator or the research it is based on does not guarantee future results. You are solely responsible for your own trading decisions, risk management, and compliance with applicable rules. Past performance, backtested results, and hypothetical scenarios have inherent limitations and should not be relied upon as an indicator of future performance.