Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Vietanhnguyen2hotmailcom, Yesterday, 10:29 AM
                  4 responses
                  21 views
                  0 likes
                  Last Post Vietanhnguyen2hotmailcom  
                  Started by PhillT, 04-19-2024, 02:16 PM
                  4 responses
                  35 views
                  0 likes
                  Last Post PhillT
                  by PhillT
                   
                  Started by ageeholdings, 05-01-2024, 05:22 AM
                  5 responses
                  37 views
                  0 likes
                  Last Post ageeholdings  
                  Started by reynoldsn, Today, 02:34 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post reynoldsn  
                  Started by nightstalker, Today, 02:05 PM
                  0 responses
                  20 views
                  0 likes
                  Last Post nightstalker  
                  Working...
                  X