namespace NinjaTrader.Strategy
{
public static class Extensions
{
public static int ToBarsAgo(this int BarNum, Object Instance)
{
Strategy s = Instance as Strategy;
return s.CurrentBar - BarNum;
}
}
}
int SaveBar = CurrentBar;
Print("SaveBar occured " + SaveBar.ToBarsAgo(this) + " bars ago");

Comment