Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard builds code that won't compile

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

    Strategy Wizard builds code that won't compile

    I noticed cases in the Strategy Wizard where selections in the Condition Builder can result in code that won't compile. It appears that If you use an indicator in Condition Builder that has a parameter that needs to be serialized, like a Color or a TimeSpan, the code that is generated will be incorrect. The attached screen shot shows a Condition Builder entry using an indicator that has a color as a parameter. Notice that the entry for the color parameter is 'Color [Gray]'. That is exactly what gets inserted into the code (rather than Color.Gray), and so you get an error.

    It's similar for a TimeSpan, though I haven't included a picture. If the parameter is, say, 00:00:00, then 00:00:00 gets inserted into the code. No quotes, no constructor, just 00:00:00.

    Click image for larger version

Name:	ConditionBuilder.JPG
Views:	1
Size:	58.2 KB
ID:	895340

    #2
    Mike,

    I cant see but what is the indicator this is occuring on?

    Is this a custom indicator or a NinjaTrader indicator?

    Also, does this color are you able to change it when you add it to the chart just the paremeter appears differently in the strategy builder?

    I look forward to assisting you further.

    Comment


      #3
      It don't matter. Take any indicator you want that has a Color parameter (or a Timespan parameter) that appears in the indicator's Parameters section. Use it in Condition Builder in Strategy Wizard and you'll get invalid code.

      Comment


        #4
        Thanks,

        Looking into this now.

        Comment


          #5
          Hello,

          On my side when I add a customizable color option using the method described below.

          The color option isnt there. Did they code this color to be correctly serialized as I think this might be where the issue here.

          As the color option should not be visable in the strategy wizard according to my test.

          Please check the coding to make sure it has the below aspects and let me know if it does. If it does I would need you to send me an indicator that causes this to happen so I can test on my side.

          Comment


            #6
            Okay, "they" is me, and the indicator I used in my example works fine as a stand-alone indicator. I've attached it, though somewhat ruefully because I really don't think this is about the indicator. The issue should remain why a properly-constructed indicator causes Strategy Wizard to generate code that won't compile.

            BollingerShaded.zip

            Comment


              #7
              Correct, this is because you are working outside of what is supported by the Strategy Wizard. The Wizard cannot take color inputs. For your case, you would need to actually click on the color, bring up the selector, select a color, and then it should populate that selected color into there.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                That's as opposed to Strategy Wizard generating a valid entry, like Color.Gray? It doesn't seem far-fetched to suggest that Strategy Wizard should not insert 'Color [Gray]' into the parameter list.

                Comment


                  #9
                  Hello,

                  I would agree.

                  Currently this is not supported.and as such you will get an non-valid entry since its outside of whats supported. Development is aware of this and will look to add this to a future version of NinjaTrader.

                  As of currently color inputs parameters will need to be hard coded in if an indicator uses it Unfortunately or selected manually for now.

                  Thanks for reporting in. You have been of great help narrowing down bugs we/ I very much appreciate it.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, Today, 10:57 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  158 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Today, 09:29 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post Belfortbucks  
                  Started by zstheorist, Today, 07:52 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post zstheorist  
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  151 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Working...
                  X