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

indicator pulldown menu

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

    indicator pulldown menu

    Hi, I want to script an indicator with inputs that are some sort of options one has to choose.
    I would like to set those options via a pulldown menu/ a list in the indicator dialog.
    For example, for calculating smoothed values I want to set the option
    "smoothed". For calculating nonsmoothed values I want to set the option
    "nonsmoothed". How is that done?

    #2
    You probably want to use enums for this. Check out the link below, that should get you started.





    ____________________________________

    EMSystems Software & Services for Traders
    TraderGuy
    NinjaTrader Ecosystem Vendor - EMS

    Comment


      #3
      indicator pulldown menu

      Hi,

      thanks, I got the enum working in my script.
      However, when I want to insert the indicator in a chart
      and choose via right mouse click indicators...
      select the compiled indi and hit the new-button
      the following is displayed:

      For all parameters exept the primary dataseries <unknown> is displayed.

      I identified the command

      Add(SecondInstrument, BarsPeriods[0].Id, BarsPeriods[0].Value);

      as the reason of the error. Without that line it works, but I can't figure out the
      mistake.

      SecondInstrument is a string property, that contains @"ADLine(^NYA(Daily),1)"
      ADLine is a self coded indi, which works fine.
      ^NYA is an index.
      Do I have to declare the 2nd instrument in another way?

      Comment


        #4
        I just realized I can't add indicators like that.

        Seems like I have to define one input that defines if an indicator or a 2nd instrument
        has to be avaluated.
        But therefore I would need the parameter list to be dependent on the setting of the first parameter.
        If the first parameter is set to "instrument" second input should be a string specifying that
        instrument. If the first parameter is set to "indicator", 2nd input should be an enumlist of
        implemented indicators.
        How can this be done in NT?

        Comment


          #5
          Hello,

          Looks like you got most of your post sorted out besides the last question here.

          Most of your issues here most likely come from it looks like your trying to change the secondary series based on what the user inputs for the indicators settings.

          Unfortunately this dynamic setting of adding in indicators/data must be hard coded in NinjaTrader and does not support setting this dynamically.

          Let me know if I can be of further assistance.

          Comment


            #6
            Hi,

            what I want to do is to script a divergence indicator.
            Second dataseries could eighter be an indicator based on the primary series
            or another instrument.
            Therefore I have to specify in the inputs if the 2nd dataseries is goin to be an indi or an instrument. Depending on this setting there should be fields for setting indicator paramters or a field for specifying the 2nd instrument.

            I tried to insert if then conditions within the properties region of the divergence indicator
            but got error messages during compiling.
            So if there is a way to integrate that kind of functionality I would be glad to learn about.

            Comment


              #7
              Hi Stephan, setting up the property dropdowns in a dynamic way is unfortunately not supported. I would just add enums for the user settings you want to expose, like oscillator used and if an oscillator or price series should be used.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by egordleo, Today, 05:50 AM
              0 responses
              4 views
              0 likes
              Last Post egordleo  
              Started by kevinenergy, 02-17-2023, 12:42 PM
              118 responses
              2,778 views
              1 like
              Last Post kevinenergy  
              Started by briansaul, Today, 05:31 AM
              0 responses
              9 views
              0 likes
              Last Post briansaul  
              Started by fwendolynlpxz, Today, 05:19 AM
              0 responses
              4 views
              0 likes
              Last Post fwendolynlpxz  
              Started by traderqz, Yesterday, 12:06 AM
              11 responses
              28 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X