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:

    https://ninjatrader.com/support/help...don_window.htm

    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.
      http://ninjatrader.com/support/forum...059#post477059
      https://ninjatrader.com/support/foru...686#post492686

      NinjaTrader_Jesse also has some unsupported code that loops through open windows.
      http://ninjatrader.com/support/forum...541#post445541
      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, 02: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.
              https://ninjatrader.com/support/foru...208#post786208
              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.
                    https://ninjatrader.com/support/foru...802#post455802

                    A different example I have allows the user to select the instrument (and only works with one instrument) and uses this for a BarsRequest.
                    https://ninjatrader.com/support/foru...720#post820720
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by jjanguda, Today, 10:15 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post jjanguda  
                    Started by ScorpioTravis, Today, 09:41 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post ScorpioTravis  
                    Started by DTSSTS, Today, 09:41 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post DTSSTS
                    by DTSSTS
                     
                    Started by Segwin, Today, 06:33 PM
                    1 response
                    26 views
                    0 likes
                    Last Post NinjaTrader_ShawnB  
                    Started by bmaltz, Today, 08:14 PM
                    1 response
                    20 views
                    0 likes
                    Last Post NinjaTrader_ShawnB  
                    Working...
                    X