• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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));
    	Print("price info High[1]" + Highs[1][1] + "lows " + Lows[1][1]);
    	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 memonolog, Today, 02:39 AM
    1 response
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by memonolog, Today, 07:07 AM
    0 responses
    4 views
    0 likes
    Last Post memonolog  
    Started by juanram, Today, 06:01 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by dastaan, Today, 06:29 AM
    0 responses
    8 views
    0 likes
    Last Post dastaan
    by dastaan
     
    Started by random9570, Yesterday, 09:01 PM
    4 responses
    24 views
    0 likes
    Last Post NinjaTrader_Marco  
    Working...
    X