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

How to get Chart interval selection in Addon

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

    How to get Chart interval selection in Addon

    Hello everyone,

    I try to identify within an Addon which Chart interval the user is requesting within the minute selection.

    I looked into barsRequest, eg. barsRequest.Bars.BarsPeriod.BaseBarsPeriodValue, but it's always 1 Minute.

    Click image for larger version

Name:	2021-03-23 22_02_15-Window.png
Views:	326
Size:	24.4 KB
ID:	1148167

    How to get the real selection?

    Thanks in advance.


    #2
    Hello, thanks for your post.

    See this post that has an example on accessing each ChartControl object of each chart window within the workspace:

    https://ninjatrader.com/support/foru...ons#post837439

    You should be able to access the bar period value from there, please set up a test to confirm.

    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello, thanks for your reply.

      A user had a similar issue here:
      https://ninjatrader.com/support/foru...dow#post782519

      Was resolved by using the NTMenuItem:

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

      There is an example on that forum thread as well.

      Please let me know if this does not resolve your inqury.
      Chris L.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_ChrisL View Post
        Hello, thanks for your reply.

        A user had a similar issue here:
        https://ninjatrader.com/support/foru...dow#post782519

        Was resolved by using the NTMenuItem:

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

        There is an example on that forum thread as well.

        Please let me know if this does not resolve your inqury.
        Ahh, sooorrryy I mixed up two of my threads and posted in the wrong one. Think that lead into some missunderstanding.
        I deleted my post here and added to the right one.

        Thanks for understanding.

        Comment


          #5
          Hi there,

          with protected override void OnWindowDestroyed(Window window) I get everything, what I need.

          But this event is not executed when a user does a selection within following menu.
          Is there an event or other possibility to get the users selection?

          Thanks in advance





          Comment


            #6
            Hello Airwave, thanks for your reply.

            Accessing chat functions and events through an addon is not officially supported so there is nothing documented showing how to do this, unfortunately.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hey Chris,

              but unofficial that is possible? Is there a way of researching this?

              Thanks


              Comment


                #8
                Hello Airwave, thanks for your reply.

                I am not sure if it is possible. You would need to look through the relevant objects in Intellisense to see what undocumented events are available to use.

                Best regards.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by Airwave View Post
                  Hello everyone,

                  I try to identify within an Addon which Chart interval the user is requesting within the minute selection.

                  Hi Airwave,

                  I asked a related question and was quite pleased with the reponse here https://ninjatrader.com/support/foru...-ticks-per-bar

                  Does that info provide any help?

                  HedgePlay

                  Comment


                    #10
                    Thanks a lot, hedgeplay,

                    That guide me in the write direction. :-)


                    But, I'm at the next boarder now:

                    I need to identify the chart window in any way in the IAdapter.RequestBars adapter:

                    void IAdapter.RequestBars(IBars bars, Action<IBars, ErrorCode, string> callback, IProgress progress)
                    {
                    <how to identify the chart window here?>
                    }

                    Is there a possibility? Or is there another way to get the selected period in this adapter?

                    Thanks in advance.
                    Last edited by Airwave; 04-04-2021, 02:18 PM.

                    Comment


                      #11

                      Hi Airwave,

                      I have not developed against the iAdapter constructs so wont be much help on this topic.

                      All I have is.... I believe I remember a post where the post details and attached example DLL apps were posted as reference to check in regards to a question about using iadapter https://ninjatrader.com/support/foru...art#post793626

                      I don't feel strongly this will be a direct reference for what you seek.

                      HedgePlay

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by wzgy0920, 04-20-2024, 06:09 PM
                      2 responses
                      26 views
                      0 likes
                      Last Post wzgy0920  
                      Started by wzgy0920, 02-22-2024, 01:11 AM
                      5 responses
                      32 views
                      0 likes
                      Last Post wzgy0920  
                      Started by wzgy0920, Yesterday, 09:53 PM
                      2 responses
                      49 views
                      0 likes
                      Last Post wzgy0920  
                      Started by Kensonprib, 04-28-2021, 10:11 AM
                      5 responses
                      191 views
                      0 likes
                      Last Post Hasadafa  
                      Started by GussJ, 03-04-2020, 03:11 PM
                      11 responses
                      3,231 views
                      0 likes
                      Last Post xiinteractive  
                      Working...
                      X