live-price-tracking

Process tick-level price data in NinjaTrader OnMarketData for live trailing stops.

2|3|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/mkalhitti-cloud/universal-or-strategy --skill live-price-tracking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: live-price-tracking
Source: https://github.com/mkalhitti-cloud/universal-or-strategy/tree/main/.agent/skills/live-price-tracking
Command: npx skills add https://github.com/mkalhitti-cloud/universal-or-strategy --skill live-price-tracking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables real-time tick-by-tick price tracking and live trailing stop updates in NinjaTrader, addressing delays caused by bar-close decision logic.

Core Features & Use Cases

  • OnMarketData-based pricing: updates trailing stops on every valid tick (MarketDataType.Last) for accurate intra-bar risk management.

  • Instrument filtering & price getters: ensures live prices are sourced from the current instrument and provides a robust GetLivePrice() fallback.

  • Rate-limited order modifications: implements a safe 1-modification-per-second policy to comply with Apex-like constraints and prevent excessive orders.

  • Use Case: A strategy uses OnMarketData to update trailing stops in real time as ticks arrive, rather than waiting for the bar close.

Quick Start

Implement the OnMarketData handler to process only Last ticks, filter for the active instrument, update trailing stops using a live price, and add a rate-limiter for order modifications. Test with real-time tick data and verify stop updates occur between bars.

Frequently Asked Questions about live-price-tracking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update trailing stops in NinjaTrader using tick data instead of bar close?

To update trailing stops using tick data in NinjaTrader, process real-time price changes via the OnMarketData handler instead of waiting for bar close events. This allows your strategy to react to intra-bar price movements and adjust risk management dynamically as market data arrives.

What is the best way to filter MarketDataType in NinjaTrader for live price tracking?

Filtering MarketDataType in NinjaTrader for live price tracking involves checking that the incoming data type is MarketDataType.Last within your OnMarketData handler. This ensures your strategy only processes actual trade ticks rather than bid or ask quotes, providing accurate intra-bar pricing.

How do I prevent excessive order modifications when updating trailing stops on every tick?

To prevent excessive order modifications when updating trailing stops on every tick, implement a rate-limiting policy such as restricting updates to one modification per second. This helps comply with broker constraints and prevents rejected orders during high-frequency market activity.

Why does my NinjaTrader strategy lag during high-frequency market activity?

A NinjaTrader strategy may lag during high-frequency market activity if it relies on bar close data for decisions or lacks proper rate-limiting for order modifications. Switching to OnMarketData for tick-level processing with a rate-limiter ensures reliable data handling and responsive trailing stops.

Can I use OnMarketData to track live prices for specific instruments in NinjaTrader?

Yes, you can use OnMarketData to track live prices for specific instruments in NinjaTrader by applying an instrument filter within the event handler. This ensures the live price data and subsequent trailing stop updates are sourced only from the active instrument your strategy is trading.

Do I need a fallback method for getting live prices in NinjaTrader if OnMarketData fails?

Implementing a GetLivePrice() fallback is necessary if OnMarketData fails to provide immediate updates in NinjaTrader. This ensures your strategy maintains reliable price tracking for trailing stops even when live tick data is momentarily delayed or unavailable during high-frequency activity.