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 trilliantrader, 04-18-2024, 08:16 AM
    4 responses
    18 views
    0 likes
    Last Post trilliantrader  
    Started by mgco4you, Today, 09:46 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by wzgy0920, Today, 09:53 PM
    0 responses
    9 views
    0 likes
    Last Post wzgy0920  
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    10 views
    0 likes
    Last Post Rapine Heihei  
    Working...
    X