Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error in trace orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    error in trace orders

    I got a crash today and the trace log pointed to the customisation I did to trace orders. why don't I have access to Highs and Lows array from onOrderTrace?
    Code:
    protected override void OnOrderTrace(DateTime timestamp, string message)
    {
    	 	PrintTo=PrintTo.OutputTab2;
         Print(string.Format("{0} {1}", timestamp, message));
    	[COLOR="Red"]Print("price info High[1]" + Highs[1][1] + "lows " + Lows[1][1]);
    [/COLOR]	PrintTo=PrintTo.OutputTab1;
    	 		 
    }
    2016-05-31 10:54:18:850 *************** unhandled exception trapped ***************
    2016-05-31 10:54:18:850 Index was outside the bounds of the array.
    2016-05-31 10:54:18:850 System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at NinjaTrader.NinjaScript.Strategies.STSVer2Strategy .OnOrderTrace(DateTime timestamp, String message) in c:\Users\ \Documents\NinjaTrader 8\bin\Custom\Strategies\STSVer2Strategy.cs:line 102
    at NinjaTrader.NinjaScript.StrategyBase.CancelAllOrde rs(Boolean entries, Boolean exits)
    at NinjaTrader.NinjaScript.StrategyBase.OnAfterSetSta te()
    at NinjaTrader.NinjaScript.NinjaScriptBase.SetState(S tate state)
    at NinjaTrader.Gui.NinjaScript.StrategyRenderBase.Set State(State state)
    at NinjaTrader.NinjaScript.NinjaScriptBase.Finalize()

    #2
    Hello junkone,

    The OnOrderTrace is not a data driven event method.

    Are you ensuring anything involving data is being called through TriggerCustomEvent?

    http://ninjatrader.com/support/helpG...ustomevent.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    136 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    293 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    238 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    334 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    171 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X