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

Problem with Parameters Drop Down Box

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

    Problem with Parameters Drop Down Box

    I've created an indicator to populate two parameter drop down boxes: one for the account name and one for the strategy name. The enums are in my User Defined Methods strategy. The concept is to select the account and the strategy from the drop downs and then have them printed on my chart.
    The User Defined methods strategy and the indicator both compile fine. The account name drop down works fine: I select the account and it appears on the chart; however, the strategy name appears in the drop down but no matter which strategy name I select, as soon as I hit Apply the default strategy name entered in the Variables returns and is printed on the chart.
    I cannot see any difference between the code for selecting the account and for selecting the strategy. If you could take a look, I would be appreciative.
    Although there are no passwords in the files, I would be appreciative if you would delete them from the post after you've downloaded them.

    A second question is: what determines the order of the items that appear in the Parameters drop down?

    Thanks,
    Stephen
    Last edited by sgordet; 05-11-2011, 10:39 AM. Reason: Remove files.

    #2
    Stephen, please try putting your enums in the indicator UserDefinedMethods if you wish to access them from an indicator, strategy cross communication would generally not be supported. You also want to refer to the public properties in your code and not the variables.

    The ordering used would be what you set in your code.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I deleted the enum from the strategy user defined methods and added it to the indicator user defined methods as you suggested. It didn't fix the problem.
      I'm sorry. I'm not knowledgeable enough to know how to refer to the public properties in my code. Here is I believe the relevant code. If you could tell me how to change it, I would be appreciative.
      Variables
      SelectStrategy strategy = SelectStrategy.ES_GapOpen;
      SelectAccount accountName = SelectAccount.PFG_IRA_XXXX;

      [in OnStartUp]
      DrawTextFixed(
      "Info",strategy.ToString() +"\n" + accountName.ToString() [etc]

      Comment


        #4
        Hello,

        Just so I understand.

        Is it that its not printing correctly or is it that its not showing up correctly in the parameters for the indicator/strategy?

        If its no printing correctly. Is the only place your printing it OnStartUp()? Are you accessing it anywhere else? You removed the files so I was unable to take a look.

        I look forward to assisting you further.

        Comment


          #5
          I just want the account name and the strategy to appear on screen in the DrawTextFixed area. I select the account in the dropdown and it appears on the chart; however, the strategy name appears in the drop down but no matter which strategy name I select, as soon as I hit "Apply" the default strategy name entered in the Variables returns to the Parameters drop down and is printed on the chart when I close the indicators window. What's strange is that the code for both appears identical to me yet one drop down selects the enum properly and the other always returns to the default one given in the Variables.

          Comment


            #6
            Stephen, could you please contact me at support at ninjatrader com with the latest code you're using now so I could give it a run here on my end?

            Thanks,
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Account Name on Chart

              Hi Bertrand,

              I tried to ask my questions of Stephen - the OP, via PM but he has not responded.

              I know what I am asking is not a supported feature, but it appears from what Stephen wrote that he has acheived what I was trying to do.

              Can you help me instead with the following (I have quoted my PM to Stephen):

              Hi there,

              I read with interest your posts around 12 May on above topic.

              I appreciate you probably removed your code files as they contain a proprietary strategy.

              However there is one small piece of what you were discussing that I have been trying to make work and I can't.

              So I was wondering if you could share just this piece of your code, or explain to me how I need to code it. If you gave me an email address I could email you the code as it stands.

              All I want to do is the following:

              Display the Account Name on the chart. That is it. It is just an indicator. I am not doing anything else with it and I don't use strategies.

              I see part of what you are doing does exactly that.

              Any help, hints etc would really be appreciated.

              Are you on NT 7 or 6.5? I am on NT7.

              Thanks,

              Steve

              Comment


                #8
                Hi Steve, I believe the study used was created with the help of enums, we have a dedicated sample for the coding needed here - http://www.ninjatrader.com/support/f...ead.php?t=3420
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                3 responses
                25 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by Aviram Y, Today, 05:29 AM
                2 responses
                7 views
                0 likes
                Last Post Aviram Y  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by TradeForge, Today, 02:09 AM
                1 response
                23 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X