• 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

General Data Storage

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

    General Data Storage

    Hello together,

    I need some help to make a list with objects available for several strategies.

    Is there a possibility to store data in a script, so that several strategies can use this data? I would like to create a method which is holding a list with objects. This method will be feed by a strategy. Is it now possible to read this list from another strategy?

    strategy_1 <-- write & read --> method -- only read --> strategy_2

    Perhaps I am thinking to complicated. I am working with a multi time frame strategy and I want to do the plotting in another chart...

    Thanks for your help!
    Regards
    uupsa!

    #2
    Hello Uupsa,

    Thank you for your note.

    You would want to use the UserDefinedMethods.CS for strategies. This will allow you to create public methods that both strategies could reference and use for your Method creation.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      You could also use the StreamWriter and StreamReader Class to record the data to a file and then read from that file in the second strategy.

      Comment


        #4
        Thanks NinjaTrader_Cal!

        Hello GKonheiser,

        thanks for your reply. I already thought about an external file, but I am talking about a class with a lot of Infos stored in lists, arrays, strings, etc..

        Is there no way to store data inside Ninjatrader, which is accessilble from different strategies?
        Or is there a way to access a list (in a strategy) from another strategy?

        Thanks
        uupsa!

        Comment


          #5
          Why dont you just write the strategies together and just add the different instruments you need? That way all your logic and variables are in the same script.

          Comment


            #6
            That´s the way I did. I am working with 10 different dataseries and plotting all these data meaningfull is impossible. So I thought to put all dataseries in one panel and create some buttons to set the barcolor to transparent. This would work, but now I have a scaling problem. The scaling problem can´t be solved.
            Next step, I thought to draw the data in a different chartwindow. There, I can use the BarsInProgress=0 and switch with the implemented dataseries button through all datseries. Switching between the dataseries would start the script new, but this doesn´t matter, because it´s only for visualization.
            If there is no way to store lists internal, I have to create a method, which uses a streamwriter for an external file.
            Is there a possibility to store data in a static method?

            Greetings
            uupsa!
            Last edited by uupsa; 12-12-2014, 12:26 PM.

            Comment


              #7
              During browsing I just learned, that several user looking for a "global draw" possibility for indicators. That would solve my problem! Is it already implemented?

              Comment


                #8
                Uupsa,

                As I stated in the my earlier post you can use the UserDefinedMethods.cs which is available for all strategies to use. This will allow you to create your own methods for use.

                Additionally, the ability to use global draw objects with NinjaScript is not available with NinjaTrader 7, however this item is on the developers list for NinjaTrader 8 for consideration.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks a lot for sharing this thread

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TazoTodua, Today, 02:02 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post TazoTodua  
                  Started by rehema, Today, 01:29 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post rehema
                  by rehema
                   
                  Started by Papercut110, Yesterday, 11:25 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post Papercut110  
                  Started by cgjecv, Yesterday, 09:42 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post cgjecv
                  by cgjecv
                   
                  Started by fxRichard, Yesterday, 08:34 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post fxRichard  
                  Working...
                  X