• 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 Debayan Sen, Today, 01:50 AM
    0 responses
    3 views
    0 likes
    Last Post Debayan Sen  
    Started by eleven, Yesterday, 10:03 PM
    1 response
    9 views
    0 likes
    Last Post eleven
    by eleven
     
    Started by tvbecv, Yesterday, 09:23 PM
    0 responses
    8 views
    0 likes
    Last Post tvbecv
    by tvbecv
     
    Started by reedstickets, Yesterday, 08:07 PM
    0 responses
    9 views
    0 likes
    Last Post reedstickets  
    Started by timko, Yesterday, 07:39 PM
    0 responses
    5 views
    0 likes
    Last Post timko
    by timko
     
    Working...
    X