• 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

getting indicator properties programmatically from the chart?

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

    getting indicator properties programmatically from the chart?

    Hello,

    I have some custom huge 3rd party indicator that has tons of visible/invisible properties.

    I would like to be able to manually add indicator to the chart while setting all properties manually, and then run some kind of script/addon that should be able to grab that indicator object that was manually added to the chart (basically class object) and serialize all its public properties into XML file so that I could review these properties later, modify them manually, and potentially load strategy and that indicator into strategy while using XML deserialize method to get all properties I configured manually...

    All I need is some way to grab indicator object programmatically from specific chart object...

    Thanks

    #2
    Thanks for your post music_p13,

    It sounds like what you are trying to accomplish could be done by saving a template for your ninjascript and to reuse that template's saved properties for your strategy template.

    Nonetheless, to loop through indicators on a chart programmatically, you could access the ChartControl.Indicators collection.

    Indicators Collection - https://ninjatrader.com/support/help...indicators.htm

    You can also loop through all properties of that object using reflection. We do not support implementations based on reflection, but we could point you to an external resource for further direction.

    How to loop through all properties of a class (StackOverflow) - https://stackoverflow.com/questions/...ies-of-a-class

    Please let us know if we can be of further assistance.
    Last edited by NinjaTrader_Jim; 08-03-2018, 02:10 PM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,

      The first suggestion seems the simplest/easiest.

      I was able to save chart template, open XML and see all indicator properties.

      As a follow up question, when adding "Indicators" through "Indicators" menu in NinjaTrader, there are buttons "Preset","Save","Restore". When clicking "Save" button it saves modified properties somewhere - where is this file to where those properties are saved? Just was thinking as alternative solution I could just "Save" individual indicator properties without having to save a chart template, but not sure where it is saved too and in what format...

      Thanks

      Comment


        #4
        Hello music_p13,

        Presets are saved in the NinjaTrader 8/UI.xml file in the Documents folder.

        If you have any additional questions, please don't hesitate to ask.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks, and what is being saved in NinjaTrader 8\templates\Indicator\ folder and when is it saved there?

          Comment


            #6
            Indicators currently only offer presets and do not offer complete indicator templates. I wouldn't expect this folder to have a dedicated function right now. If you are interested in having this feature we could add your vote in a feature request.

            I've updated my previous post to be clearer.

            Let us know if we can be of further help.
            Last edited by NinjaTrader_Jim; 08-03-2018, 02:10 PM.
            JimNinjaTrader Customer Service

            Comment


              #7
              Thanks!

              Please add my vote to it...

              Comment


                #8
                Vote Added!

                Keep in mind, feature request interest is aggregated before it is determined if the feature should be implemented, so we can't offer an ETA. Upon implementation the ticket ID can be found publicly on the Release Notes page of the help guide.

                Release Notes: https://ninjatrader.com/support/help...ease_notes.htm
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by faisamtrader, Today, 10:31 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Tyler  
                Started by ChazJ, Today, 09:48 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by maxie, Today, 10:01 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Melissa  
                Started by Bionian, Today, 09:36 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by tomd, Today, 09:48 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Ariana  
                Working...
                X