Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

WaitUntilFlat: the HelpFile verbiage is unclear

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

    WaitUntilFlat: the HelpFile verbiage is unclear

    ref: http://ninjatrader.com/support/helpG...tuntilflat.htm

    What does this mean?
    Warning: This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure
    as, obviously, the example shows the property being queried in OBU.

    I know what it is intended to say: it just does not say it.

    Please specify exactly what property has to be set where, in the warning that you have penned.

    I agree that it is a niggling detail, but help text must be so clear that it cannot be misunderstood.

    Thanks.

    #2
    Hello,

    Thank you for posting this.

    I have submitted a request to have this page reviewed for clarity. Once I get any updates on that I will post back here.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I've changed the sentence to read: "Warning: This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure, although it can be read elsewhere."

      I've expanded the warning to make it clear that setting should only be done there, while reading/querying can be done elsewhere.
      Dave I.NinjaTrader Product Management

      Comment


        #4
        Originally posted by NinjaTrader_Dave View Post
        I've changed the sentence to read: "Warning: This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure, although it can be read elsewhere."

        I've expanded the warning to make it clear that setting should only be done there, while reading/querying can be done elsewhere.
        bet set?

        typo?

        Comment


          #5
          Also, that help page states,

          "This property returns true if the strategy has detected it is either in a long or short position during start up; otherwise false."

          What is the "it" referring to?

          Isn't this property helping to differentiate between the account position vs strategy position?

          Would it be better to say:

          "This property returns true if the strategy has detected the account position is either in a long or short position during start up; otherwise false."

          Comment


            #6
            Another typo on that same page:

            This statement,

            "Determine is the strategy is currently waiting until a flat position is detected before submitting live orders."

            Should be,

            "Determine if the strategy is currently waiting until a flat position is detected before submitting live orders."

            Comment


              #7
              Originally posted by NinjaTrader_Dave View Post
              I've changed the sentence to read: "Warning: This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure, although it can be read elsewhere."

              I've expanded the warning to make it clear that setting should only be done there, while reading/querying can be done elsewhere.
              That is still somewhat unclear IMHO, as it seems to be implied that IsWaitUntilFlat is not itself set, or capable of being meaningfully set by the user, but rather a state variable that NT reads.

              Maybe you should just move the caveat: "This property would only apply if the strategy StartBehavior was set to StartBehavior.WaitUntilFlat or StartBehavior.WaitUntilFlatSynchronizeAccount", from the description to become the warning?

              Comment


                #8
                Originally posted by koganam View Post
                That is still somewhat unclear IMHO, as it seems to be implied that IsWaitUntilFlat is not itself set, or capable of being meaningfully set by the user, but rather a state variable that NT reads.
                Seems clear that this property can be meaningfully set by the user only "from the OnStateChange() method during State.SetDefaults or State.Configure".

                Now, why one would even choose to set this property at all, and what happens under the hood when it is set to True or False during SetDefaults/Configure .. yes, that is very unclear.

                I can agree with Koganam that IsWaitUntilFlat seems more like a read-only property, even the definition is stated in a way that makes it appear read-only.

                If this variable is settable by the user, even if under limited circumstances, could the description please be updated to say what setting it to True or False is supposed to achieve?

                Comment


                  #9
                  Although the property is settable (in any state <= State.Configure), if you actually tried to set it, there would be no noticeable results. Keep in mind that this property does not indicate the Start Behavior that is set, but rather indicates whether the strategy is currently waiting until flat because of the Start Behavior. Thus, if you were to set it to True in State.Configure, for example, then once State.Transition came around, the value of the property would be overwritten based on checks going on under the hood.

                  That last part is important to understand: In State.Transition (after Historical, before Realtime), if the strategy happens to be waiting until flat because of the configured start behavior, then IsWaitUntilFlat will be set to True, otherwise False.

                  I think you guys will like the updates to the help guide page based on this conversation. I've attached a screenshot of what it will look like.

                  Click image for larger version

Name:	iswaituntilflat.png
Views:	1
Size:	25.7 KB
ID:	877747
                  Dave I.NinjaTrader Product Management

                  Comment


                    #10
                    Originally posted by NinjaTrader_Dave View Post
                    I think you guys will like the updates to the help guide page based on this conversation. I've attached a screenshot of what it will look like.
                    Excellent.

                    Once the property is internally set to True or False inside State.Transition, will this property remain stuck at True or False forever?

                    [I presume the answer is yes, since the documentation implies at no other time is this property value ever set again]

                    Comment


                      #11
                      Would you consider a small enhancement (aka nitpick)?

                      What exactly is the "it" referring to?
                      Account position?
                      Strategy position?

                      See my post here:


                      Would it be wise/helpful to distinguish between account vs strategy position in the documentation for this property?

                      Comment


                        #12
                        The "it" refers to itself. The strategy detects whether it's position is flat or short.

                        The attached NS Output may help to clarify what is going to happen with the property value. If the start behavior is set to Wait Until Flat, then IsWaitUntilFlat will be False all the way up to State.Transition, then will change to False. Then, when it is no longer waiting for flat, it will switch back to False.

                        If the Start Behavior is not set to Wait Until Flat, then IsWaitUntilFlat will always be false. If the strategy is currently waiting until flat, the property will be True, and whenever it is not doing so, it will be False.

                        NinjaScript Output 3_3_2016 1_26 PM.txt
                        Dave I.NinjaTrader Product Management

                        Comment


                          #13
                          Originally posted by NinjaTrader_Dave View Post
                          Although the property is settable (in any state <= State.Configure), if you actually tried to set it, there would be no noticeable results. Keep in mind that this property does not indicate the Start Behavior that is set, but rather indicates whether the strategy is currently waiting until flat because of the Start Behavior. Thus, if you were to set it to True in State.Configure, for example, then once State.Transition came around, the value of the property would be overwritten based on checks going on under the hood.

                          That last part is important to understand: In State.Transition (after Historical, before Realtime), if the strategy happens to be waiting until flat because of the configured start behavior, then IsWaitUntilFlat will be set to True, otherwise False.

                          I think you guys will like the updates to the help guide page based on this conversation. I've attached a screenshot of what it will look like.

                          [ATTACH]37613[/ATTACH]
                          That is just beautiful! Now it is absolutely clear, and incapable of being misunderstood. Thank you for your responsiveness.

                          One last quibble. Given the description, and obvious intent, and as it makes no sense for a programmer or user to set IsWaitUntilFlat, maybe you should explicitly make it incapable of being set? As a said, just a quibble. As long as it works and cannot be messed up by programmer or user, it is not a matter of real importance; more a matter of consistency: if setting it has no effect, then do not let it be set.
                          Last edited by koganam; 03-03-2016, 03:08 PM.

                          Comment


                            #14
                            Originally posted by koganam View Post
                            That is just beautiful! Now it is absolutely clear, and incapable of being misunderstood. Thank you for your responsiveness.

                            One last quibble. Given the description, and obvious intent, and as it makes no sense for a programmer or user to set IsWaitUntilFlat, maybe you should explicitly make it incapable of being set? As a said, just a quibble. As long as it works and cannot be messed up by programmer or user, it is not a matter of real importance; more a matter of consistency: if setting it has no effect, then do not let it be set.
                            It must have a setter for internal purposes. The setter will throw an InvalidOperationException if a user does try to set it past State.Configure, which is why that error text was listed.
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Originally posted by NinjaTrader_Dave View Post
                              The "it" refers to itself. The strategy detects whether it's position is flat or short or long.

                              The attached NS Output may help to clarify what is going to happen with the property value. If the start behavior is set to Wait Until Flat, then IsWaitUntilFlat will be False all the way up to State.Transition, then will change to True. Then, when it is no longer waiting for flat, it will switch back to False.
                              Fixes in red, do you concur?

                              Ah, ok. You mean Position.MarketPosition, right?

                              In other words, during the period while IsWaitUntilFlat is True, the property Position.MarketPosition cannot and will not be MarketPosition.Flat, right?

                              Sort of like this code:

                              Code:
                              if (IsWaitUntilFlat && Position.MarketPosition == MarketPosition.Flat)
                                Print("Stop the presses, this condition should be impossible");
                              Right?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,281 views
                              0 likes
                              Last Post Leafcutter  
                              Started by WHICKED, Today, 12:45 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post WHICKED
                              by WHICKED
                               
                              Started by Tim-c, Today, 02:10 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Taddypole, Today, 02:47 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post Taddypole  
                              Started by chbruno, 04-24-2024, 04:10 PM
                              4 responses
                              53 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Working...
                              X