Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DateTime as an Integer Error

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

    DateTime as an Integer Error

    Hi,

    I am getting this error when running my strategy. It complies fine and the strategy runs fine, but when an order is placed I get this error:

    Failed to execute DB job 'StrategyUpdateJob' There was an error reflecting typeTrader.StochScalpV3_1. There was an error reflecting property SessionEnd. Member of type Int32 hides base class member StrategyBase.SessionEnd of type System.DateTime. Use XmlElementAttribute or XmlAttribueAttributr to specify a new name.

    Here is how I use the variable sessionEnd:

    As a parameter:

    Code:
            [Description("Session End Time (format HHMMSS)")]
            [Category("Parameters")]
            public int SessionEnd
            {
                get { return sessionEnd; }
                set { sessionEnd = value; }
            }
    And then to check the trading hours:

    Code:
            private void checkTradingHours() 
            {
                currentTime = ToTime(Time[0]);
                
                if (currentTime <= sessionStart || currentTime >= sessionEnd )  
                    withinTradingHours = false;
                
                else withinTradingHours = true;    
            }
    Any ideas? Thanks

    #2
    Please try using a different variable name. SessionEnd may be reserved.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Great, that worked thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X