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

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, 03: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, 03: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 PaulMohn, Today, 12:36 PM
                2 responses
                16 views
                0 likes
                Last Post PaulMohn  
                Started by Conceptzx, 10-11-2022, 06:38 AM
                2 responses
                53 views
                0 likes
                Last Post PhillT
                by PhillT
                 
                Started by Kaledus, Today, 01:29 PM
                0 responses
                3 views
                0 likes
                Last Post Kaledus
                by Kaledus
                 
                Started by yertle, Yesterday, 08:38 AM
                8 responses
                37 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Started by rdtdale, Today, 01:02 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Working...
                X