|
Dallas, TX
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169
|
Check out the help in NT for the keyword HISTORICAL
Indicates if the NinjaScript object is running on historical data. With a strategy, when running a backtest, this property will always return true. When running a live strategy, this property will be true until the strategy starts processing real-time data. The property can be of value for many different applications.
1. Filtering out historical data for real-time strategies that does not require any historical data to initialize.
Property Value
This property returns true if the strategy is running on historical data; otherwise, false.
Syntax
Historical
Property Of
Custom Indicator, Custom Strategy
Examples
protected override void OnBarUpdate()
{
// Only run on real-time data
if (Historical)
return;
}
|