• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to override Strategy Analyzer variables?

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

    Is it possible to override Strategy Analyzer variables?

    Is it possible to override some Strategy Analyzer variables, such as average entry price, and have them work? [eg] for debugging purposes I did the following after entering a position:

    Position.AvgPrice = 1.99999; //for debug
    Print("Position.AvgPrice="+Position.AvgPrice.ToStr ing("0.00000")); //for debug

    At first it appeared to work but inspection of the Analyzer Execution and Trade tables showed that the fake price was Ignored and the attempted over-ridden price was used.


    #2
    This reply is related to my original question in this thread.

    My experience trading the euro dollar/us dollar pair has been that trades go off consistently with virtually no slippage. So far I have not been able to establish analyzer simulated entry and exit prices with practically no slippage from the indicator defined entry/exit prices. My average trade duration is approximately two or three days.

    Kindly tell me the best way to achieve minimum analyzer trade entry/exit price slippage [eg] overriding the NT trade prices would do it, if it could be done. I am aware that one must be very careful in the real world when making assumptions like ‘no slippage’.

    Comment


      #3
      Hello joemiller,

      Thank you for your post.

      The AvgPrice will update on the next bar update in OnBarUpdate() so even though your attempt to over-ride may work it will still be updated to the current price on the next bar update.

      When working in the Strategy analyzer there is a Slippage property that can be set to 0 (zero) if you wish. If you are aware of this, can you detail why you are trying to work around this and what exactly you are attempting to achieve with this work around?
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by joemiller View Post
        This reply is related to my original question in this thread.

        My experience trading the euro dollar/us dollar pair has been that trades go off consistently with virtually no slippage. So far I have not been able to establish analyzer simulated entry and exit prices with practically no slippage from the indicator defined entry/exit prices. My average trade duration is approximately two or three days.

        Kindly tell me the best way to achieve minimum analyzer trade entry/exit price slippage [eg] overriding the NT trade prices would do it, if it could be done. I am aware that one must be very careful in the real world when making assumptions like ‘no slippage’.
        yes, please tell me how to incorporate the analyzer slippage=0 property and I will see if that helps. I am using slippage in the context of how close trade executions prices are to my order price. maybe NT's definition is different?

        Re: "can you detail why you are trying to work around this and what exactly you are attempting to achieve with this work around?"

        I regularly submit forex Eurodollar limit orders at start of day at my indicator price, which I have at the open because the indicator is calculated at yesterday's close. my orders are regularly filled at that indicator price [ie] adjusted for ask price if buying, bid price if selling. So I am trying to get the analyzer to simulate as closely as possible what I am doing.

        Comment


          #5
          Hello joemiller,

          Thank you for your response.

          The property for the Slippage is on the Strategy Analyzer Strategy properties when setting up the instance for the backtest. Please refer to the attached screenshot.
          Attached Files
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by joemiller View Post
            yes, please tell me how to incorporate the analyzer slippage=0 property and I will see if that helps. I am using slippage in the context of how close trade executions prices are to my order price. maybe NT's definition is different?

            Re: "can you detail why you are trying to work around this and what exactly you are attempting to achieve with this work around?"

            I regularly submit forex Eurodollar limit orders at start of day at my indicator price, which I have at the open because the indicator is calculated at yesterday's close. my orders are regularly filled at that indicator price [ie] adjusted for ask price if buying, bid price if selling. So I am trying to get the analyzer to simulate as closely as possible what I am doing.
            Are you not entering with Limit Orders?

            Comment


              #7
              Yes, all are limit orders, and the real world forex executions are very close to indicator line prices which define the limit price. I merely want to get NT to simulate that as closely as possible. My questions have been prompted by an unclear understanding of NT trade execution logic. however the confusion is disappearing. I suspect when I successfully incorporate minute bars into my strategy my simulated executions will generally not be far from the indicator line which triggers them... which is "slippage" from the indicator line price.

              Comment


                #8
                Originally posted by joemiller View Post
                Yes, all are limit orders, and the real world forex executions are very close to indicator line prices which define the limit price. I merely want to get NT to simulate that as closely as possible. My questions have been prompted by an unclear understanding of NT trade execution logic. however the confusion is disappearing. I suspect when I successfully incorporate minute bars into my strategy my simulated executions will generally not be far from the indicator line which triggers them... which is "slippage" from the indicator line price.
                Then I am confused. Limit Orders are executed at "specified price or better". IOW, there can be no (negative) slippage with Limit Orders, so what is it that you are trying to simulate?

                Comment


                  #9
                  I apologize. You guys are knocking yourselves out trying to help me and I have confused the issue.

                  My simulation objective is:
                  At Forex EOD [5:00PM EDT] I have an indicator value. At next day Forex opening [5:15PM EDT] I enter either long or short depending on whether the opening is above or below that indicator value.

                  My simulation problem is:
                  The Analyzer applies the trade one bar later [24 hours later for day bars, 1 minute later for minute bars, etc.]

                  My question is:
                  Is there a means within NT whereby I can eliminate the one bar trade delay?

                  Comment


                    #10
                    Originally posted by joemiller View Post
                    I apologize. You guys are knocking yourselves out trying to help me and I have confused the issue.

                    My simulation objective is:
                    At Forex EOD [5:00PM EDT] I have an indicator value. At next day Forex opening [5:15PM EDT] I enter either long or short depending on whether the opening is above or below that indicator value.

                    My simulation problem is:
                    The Analyzer applies the trade one bar later [24 hours later for day bars, 1 minute later for minute bars, etc.]

                    My question is:
                    Is there a means within NT whereby I can eliminate the one bar trade delay?
                    Yes. Use a multi-timeframe setup. Generate your signal on the higher time frame, and execute your entry against the faster time frame.

                    Comment


                      #11
                      Yes. Use a multi-timeframe setup. Generate your signal on the higher time frame, and execute your entry against the faster time frame.
                      Actually the standard behavior is entering on the next open of a trigger bar.
                      So it should work as is.

                      Comment


                        #12
                        Thanks Baruch,
                        Re: ‘Actually the standard behavior is entering on the next open of a trigger bar. So it should work as is.’

                        That is very very interesting. Do you think therefore not triggering on the next open might simply be related to the fact that I display my indicator trigger line on the Strategy Analyzer chart one time period to the right ... and therefore maybe I can change my strategy and/or indicator logic to fix things? That sounds like more fun than trying to learn about something called 'higher & lower time frames'.

                        Comment


                          #13
                          Originally posted by Baruch View Post
                          Actually the standard behavior is entering on the next open of a trigger bar.
                          So it should work as is.
                          I think his description speaks for itself. He is submitting the order on the open of the bar AFTER the trigger bar, so the order is executed on the next open, giving him what he thinks of as a 1-bar delay.

                          Comment


                            #14
                            [QUOTE][/He is submitting the order on the open of the bar AFTER the trigger barQUOTE]
                            How can this be done?

                            Comment


                              #15
                              [QUOTE=Baruch;340477]
                              [/He is submitting the order on the open of the bar AFTER the trigger barQUOTE]
                              How can this be done?
                              Quoting from his own description in this thread:
                              My simulation objective is:
                              At Forex EOD [5:00PM EDT] I have an indicator value. At next day Forex opening [5:15PM EDT] I enter either long or short depending on whether the opening is above or below that indicator value.
                              I know how I would do it, but I cannot think why I would code that way. Maybe he can show you his code, and you would see how he does it?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by tpdk2012, Today, 12:51 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_ChrisSch  
                              Started by simonerg, Today, 12:13 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post simonerg  
                              Started by rickyblah12, 07-20-2019, 01:01 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_ChrisSch  
                              Started by edunwa, Yesterday, 04:11 PM
                              1 response
                              8 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Started by Grano, Yesterday, 06:07 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Working...
                              X