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

Creating a global Data Box window

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

    Creating a global Data Box window

    Hi,
    Not sure if the AddOn forum is the place for this question rather than the Indicator forum.
    Currently the Ninjatrader Data Box window can be made visible in Ninjatrader that displays any bar and indicator properties in the window. However this window is Chart window centric and the propeties and values change depending on which chart has the focus.

    Basically I want to create a Data Box type type window that can be shared between two or more charts so that I can display indicator values in this Data Box.
    I've seen some posts in the forum to create a window by encapsulating the window creation code as part of an indicator but this is not suitable as I want to be able to share this window between multiple chart windows. I can share data using perhaps shared memory files etc but I dont know how to create a shared window in NInjatrader as I am constrained by the Ninjatrader framework and the information the NInjatrader company provide.

    Does anyone have any ideas please?
    Thank-you,
    Steve.

    #2
    So I had a look around also ... and I came across the following:



    it seems that XAML may be the way to go. Is this correct? If so, is there a complete example on this please?

    Comment


      #3
      Hello steven.einarson,

      Welcome to the NinjaTrader forums.

      This would take a lot of custom programming and much of it would be undocumented and unsupported such as accessing multiple charts.


      I do have an examples of an addon window and opening an addon window from an indicator that you may find helpful.



      NinjaTrader_Jesse also has some unsupported code that loops through open windows.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea,
        Many thanks for your reply. I had another idea .... rather than trying to access indicators in other chart windows, is it possible instead to create a user panel window and instantiate some indicator objects based on multiple data streams within that panel window?? Perhaps I can use this information to display results as values and say LEDs such as in a traffic light type system based on my indicator values in that panel window..
        Thanks for any help,
        Regards,
        Steve.
        Last edited by steven.einarson; 05-05-2020, 03:06 AM.

        Comment


          #5
          Hello Steve,

          With an addon, the issue would be that there would be no supported ChartControl for an addon window and Addons don't work with Series<T> objects.

          But if you are talking about a chart, you can definitely have an indicator with multiple data series added with AddDataSeries() and you can call values from other indicators.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi Chelsea, I don't want to use the ChartControl . All I want is to load the data streams, do the calculation and display values in a static text control.
            Is there a way to do this within the NT architecture?
            ​​​​​​​Thank-you
            Regards,
            Steve

            Comment


              #7
              Hello Steve,

              Yes, you can use BarsRequests, do whatever calculations you want, and display text.

              Below is a link to an example.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank-you so much Chelsea. This is the first time I'm creating an Addon.

                Comment


                  #9
                  Hi Chelsea, I had a look at the BarsRequests example but could not get it to work. I added the tool into Ninjatrader using Tools->Import->Ninjascript AddOn.
                  I then restarted Ninjatrader as requested by the import process. However when the menu is New->BarRequest Multi Example is invoked, the window comes up but then I couldn't do anything else. Clicking, right clicking etc doesnt do anything! I also tried to debug it in Visual Studio setting breakpoints in all the methods but even then execution doesnt break anywhere...

                  In any case, I looked through the code and it seems that the it is hard wired to load three symbols. I can understand why as you need to tell it what data series to load.

                  What I need is for the NTWindow to load the data corresponding to a particular chart window so perhaps it seems that a NTWindow loaded from an indicator might be the better approach. However I am not sure if the NTWindow can somehow be able to load the same data symbol but perhaps the same and some other timeframes).

                  Can you please confirm if my thought process is correct?

                  Thank-you for your help.
                  Regards,
                  Steve.

                  Comment


                    #10
                    Hello steven.einarson,

                    The instruments it loads from the symbolsList on line 130 are from 2017. As this was a simple example to demonstrate the basic logic of BarsRequest, I did not want to add fancy logic to automatically choose the correct expiry for a future.

                    You can use any instruments that you are receiving real-time data for with your connected data provider or brokerage connection.

                    I've updated this script to use 06-20 so that this is again a working example (for the time being).

                    The example that is linked in that post allows the user to type an instrument.


                    A different example I have allows the user to select the instrument (and only works with one instrument) and uses this for a BarsRequest.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by merzo, 06-25-2023, 02:19 AM
                    10 responses
                    823 views
                    1 like
                    Last Post NinjaTrader_ChristopherJ  
                    Started by frankthearm, Today, 09:08 AM
                    5 responses
                    15 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    43 views
                    0 likes
                    Last Post jeronymite  
                    Started by yertle, Today, 08:38 AM
                    5 responses
                    16 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by adeelshahzad, Today, 03:54 AM
                    4 responses
                    20 views
                    0 likes
                    Last Post adeelshahzad  
                    Working...
                    X