Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error: Failed to execute DB job... have tried suggestions in the forum

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

    Error: Failed to execute DB job... have tried suggestions in the forum

    Hello, when automating strategies from a chart with live data on Sim101, I am seeing the following message:

    Failed to execute DB job 'StrategyUpdateJob': There was an error
    generating the XML document.: NinjaTrader.Strategy.[whateverstrategy]+Q
    is inaccessible due to its protection level. Only public types can be
    processed.

    I am on NT 6.5.1000.7, .NET 3.0, Vista SP1.

    The error does not occur when configuring the same strategies from the Strategies tab.

    I have done Reset DB, Repair DB, Reset sims, etc. per forum suggestions and the error still occurs.

    The line in the log shows the above error message. The proceeding line is:
    Starting NinjaScript strategy 'AtomicTest6/705f8fc8d64e4d2fb35c7c761e7edfa6' : On starting a real-time strategy - StrategySync=WaitUntilFlat EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy

    Any additional advice?

    Thanks,

    OregonSun

    #2
    Hello OregonSun,

    I suggest to rename the database and check if the error persists upon initiating the strategy from the chart.

    Close NinjaTrader and go to My Documents-->NinjaTrader 6.5-->db and rename the "NinjaTrader.mdb" file to 'OldNinjaTrader.mdb".

    Start NinjaTrader and a new database is created automatically. Check if the error persists.
    JasonNinjaTrader Customer Service

    Comment


      #3
      >> Failed to execute DB job 'StrategyUpdateJob': There was an error
      generating the XML document.: NinjaTrader.Strategy.whateverstrategy]+Q is inaccessible due to its protection level. Only public types can be
      processed.

      I vaguely recall that this is an issue related to marking your custom coded strategy properties as private/public/internal etc. I suggest inspecting your custom coded properties. You should not see this issue on wizard generated strategies.

      Comment


        #4
        DB error apparently fixed!

        Ok, I renamed the db, but the problem persisted. Dierk's comment did give the me the clue I needed. My strategy properties were defined as the wizard does them, however, the issue was a struct, which is not by default serializable.

        So, the solution was to add the XmlInclude attribute at the beginning of the strategy's public class definition, like so:

        [XmlInclude(typeof(MyStruct))]
        [Description("Enter the description of your strategy here")]
        public class MyStrategy : Strategy

        This link has a good description of the use of XmlInclude.



        Thanks Jason and Dierk.

        Comment


          #5
          Glad you got it resolved.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by andrewtrades, Today, 04:57 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          3 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          7 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X