Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjatrader API

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

    Ninjatrader API

    Hello everyone,


    Is there a way to programmatically add strategies?

    Something like some COM/OLE API would be great... I wold need this because everytime I have to restart ninjatrader, I have to manually edit params for 30 strategies. This is both time consuming and most of all very error-prone. Consider that I already moved all parameters in files, so I only have to set a file per strategy, but still... 30 is 30. And I am planning to increase this number.

    I also tried creating a strategy that does everything, but if I go higher than 2 instruments it starts missing trades both in market replay and real-time...

    Please let me know if there's a way of simplifying this.

    Thank you very much. Any help is appreciated.

    #2
    Hello nicanor.babula,

    Thank you for your note.

    There is not a way to add instances or enable strategies programmically.

    However, the strategies should be saved with your workspace with their current parameters. You can also enable all strategies at the same time by selecting one strategy, hit Ctrl+A on the keyboard, then right-click an instance of a strategy and select Enable.

    Are you finding that the strategy instances are not being saved with the workspace?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi there,


      The instances are being saved, but without the parameters values.

      Comment


        #4
        Hello nicanor.babula,

        This may indicate that some inputs have [XmlIgnore()] set so that these are not saved with the workspace or templates.

        A serialized variable would need to be included to save these values.

        Are all of the parameters not being saved or just a few?

        Is this a script that you have written or one that you have imported?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          You're right. All my parameters have [XmlIgnore()], because of a serialization problem I had before. I'll start removing the superfluous xmlignore directives and will let you know if that did the trick.


          Thanks!

          Comment


            #6
            Hi nicanor.babula,

            Instead of removing the [XmlIgnore()], create a serialized input that saves the value of the non-serialized input as a string and returns it.

            Below are links to a few examples of this.

            http://www.ninjatrader.com/support/forum/showthread.php?t=4977_

            http://www.ninjatrader.com/support/f...t.php?p=124724
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              Thanks for the thorough answer. My params are already string. But will keep that in mind for other cases where I could use TimeSpan or other types of params.

              Thank you very much!

              Comment


                #8
                Hello nicanor.babula,

                If the parameters are already strings, these can be serialized and the [XmlIgnore()] can be removed.

                The [XmlIgnore()] should only be used for items that are not strings, doubles, ints, or bools.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sidlercom80, 10-28-2023, 08:49 AM
                172 responses
                2,276 views
                0 likes
                Last Post sidlercom80  
                Started by Irukandji, Yesterday, 02:53 AM
                2 responses
                17 views
                0 likes
                Last Post Irukandji  
                Started by adeelshahzad, Today, 03:54 AM
                0 responses
                3 views
                0 likes
                Last Post adeelshahzad  
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                3 views
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Working...
                X