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

Additional Instrument Selector... can I add as a Strategy/Indicator grid parameter?

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

    Additional Instrument Selector... can I add as a Strategy/Indicator grid parameter?

    Hi,
    I've looked at this page on Instrument Selectors: ... but I don't want to create an addon or do the stuff re linking to other windows ... I just want a control in my indicator/strategy grid to select a secondary instrument.

    Is this possible?

    Regards,

    #2
    Hello tgn55,

    Thank you for the post.

    You can do this however keep in mind the passed in instrument should not be used for AddDataSeries purposes, that is not reliable and is a known failure point. This is documented in the help guide in the AddDataSeries page, other uses should be fine only AddDataSeries has the stipulation that variables cannot be used. If that was the intention let me know so I can add a vote for the feature request for that.

    Code:
    [NinjaScriptProperty]
    [XmlIgnore]
    [TypeConverter(typeof(NinjaTrader.Gui.Tools.InstrumentSelector))]
    [Display(Name="Select Instrument", GroupName = "Parameters", Order = 0)]
    public NinjaTrader.Cbi.Instrument InstrumentInput
    { get; set; }

    I look forward to being of further assistance.
    Last edited by NinjaTrader_ChelseaB; 10-10-2022, 10:04 AM.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse... that is great. But... as you guessed, I really did plan to use it in AddDataSeries ;-( I had read the caveat in the documentation...tried it anyway, it seemed to work.
      Are you able to elaborate on how it fails when it fails? Is it obvious? Or subtle... as in data is incorrect, but not really apparent that something went pear-shaped?

      I can probably handle a spectacular failure... it's the other kind that is probably more risky !

      Cheers,
      T.

      Comment


        #4
        Hello tgn55,

        There is not a list of areas where this can fail it is just not expected to always work so that note is added. I have in the past seen some strangeness surrounding data loading incorrectly after making changes to the input series. There are also specific cases which the analyzer will detect to prevent you from using that type of syntax which is the error mentioned in the help guide. The best I can suggest here is to avoid this type of use until a supported solution is available for that use case.

        If you are checking the accuracy in some way and making sure it is running right while you use it you can certainly explore using this for the input series we just can't advise it based on the expectation. I will add a vote for the feature request SFT-882 to hopefully see this as a feature in the future.


        I look forward to being of further assistance.







        JesseNinjaTrader Customer Service

        Comment


          #5
          Sweet ... thanks Jesse.

          Comment


            #6
            How to set default value or clear the field ? it always show last selected instrument ?

            Comment


              #7
              Hello Lyubomir Kratinov,

              You can set a default instrument in State.SetDefaults.

              InstrumentInput = Instrument.GetInstrument("ES 06-23");

              Yes, the instrument selector will always show the last selected instrument as the selected instrument.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                SFT-882 vote request.

                Comment


                  #9
                  Hello PaulMohn,

                  Thank you for your vote.

                  I have added this to SFT-882.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by llanqui, Today, 03:53 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Started by burtoninlondon, Today, 12:38 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post burtoninlondon  
                  Started by AaronKoRn, Yesterday, 09:49 PM
                  0 responses
                  15 views
                  0 likes
                  Last Post AaronKoRn  
                  Started by carnitron, Yesterday, 08:42 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post carnitron  
                  Started by strategist007, Yesterday, 07:51 PM
                  0 responses
                  14 views
                  0 likes
                  Last Post strategist007  
                  Working...
                  X