Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting a true Realtime Strategy report

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

    Getting a true Realtime Strategy report

    Please examine the attached pictures.
    1. Picture of stategy trades on chart. (Realtime trades start on 4/5/2013; earlier trades are theoretical, historical trades, per the strategy setup).
    2. Manually produced spreadsheet showing realtime trades starting from 4/5/2013, when the strategy started trading. (ie., there are no realtime trades before 4/5/2013).
    3. Performance Report - (Realtime only) Trades, as obtained from the Performance Report from right-clicking popup menu.
    4. Performance Report - (Realtime only) Summary, as obtained from the Performance Report from right-clicking popup menu.
    The graphed chart trades (1), which match those of the spreadsheet (2) both report a (correct) net profit of $3506.55 for the 6 days. They were all day trades, exited the same day one way or another.

    On the other hand the performance reports, (3)(4) show a completely unreal and thorougly misleading report of Total Net Profit of $12904.70! The entries and exits have little, if any, correspondence to reality, whether in prices or entry/exit times. Those virtual entries and exits make little sense as I see them. The arrowed performance items in the summary are seriously out tune with reality. So, my question is: How does one get an accurate realtime only Trades Performance report? Strange to say, running a Historical only Performance Report, which does in this case match the actual trades taken, shows the exact correct report.

    Telling me to use the Historical report matched to the trade dates is not a solution, as I also sometimes take manual trades, which will not be reflected in a Historical only Strategy Report. In this particular case, there happen to be no manual trades obfuscating the issue, but that is only because I refrained from any manual trades during the initial test period for the strategy. This will happen with any strategy, as I have seen this discrepancy on many other strategies that I tested. I was theorizing that the manual trades were the culprit. This test run invalidates that hypothesis.

    I cannot provide the strategy code; I do not know if the same can be demonstrated using Market Replay. You may have to write a simple strategy and test it yourselves over the coming week in real time, but that is not for me to say. Heck, the ubiquitous SampleMACrossover Strategy, run in real time, should show the same issue.
    Attached Files
    Last edited by koganam; 04-13-2013, 11:19 AM. Reason: Corrected spelling.

    #2
    Originally posted by koganam View Post
    Please examine the attached pictures.[LIST=1]

    1) Picture of stategy trades on chart. (Realtime trades start on 4/5/2013; earlier trades are theoretical, historical trades, per the strategy setup).

    On the other hand the performance reports, (3)(4) show a completely unreal and thorougly misleading report of Total Net Profit of $12904.70! The entries and exits have little, if any, correspondence to reality, whether in prices or entry/exit times. Those virtual entries and exits make little sense as I see them. The arrowed performance items in the summary are seriously out tune with reality. So, my question is: How does one get an accurate realtime only Trades Performance report? Strange to say, running a Historical only Performance Report, which does in this case match the actual trades taken, shows the exact correct report.
    Koganam:

    I've been re-reading this all morning - You've probably thought of this...

    Is it possible that what you are seeing are a continuation of historical trades that might have happened, and not a switch over to live trades?

    I guess you could reenable your strategy in live right now, and see what historical trades show up for 4-5 to 4-12.

    I'm not sure what NT would do at that point (I've never run a live strategy).. would it show actual trades, historical trades that weren't taken from strategy startup, or both?

    Are the historical trades computed with COBC=TRUE? I suspect your strategy is not?

    Comment


      #3
      Originally posted by sledge View Post
      Koganam:

      I've been re-reading this all morning - You've probably thought of this...

      Is it possible that what you are seeing are a continuation of historical trades that might have happened, and not a switch over to live trades?
      Nope. Look at the very first trade in the Trades report. It is a supposedly day trade. Yet look at the chart (or spreadsheet), and there is no trade on that date that matches the entry/exit prices or times!!
      I guess you could reenable your strategy in live right now, and see what historical trades show up for 4-5 to 4-12.
      We can only see the charted trades if the Strategy is enabled, so the chart that I posted has had the strategy enabled since the trades were taken.

      ... Are the historical trades computed with COBC=TRUE? I suspect your strategy is not?
      Nope. COBC is true on all my strategy entries. I only calculate entries using COBC, because a bar is meaningless until it closes, especially on Range charts, which to me are the only sensible charts for trading. The message of Range bars is always unmistakable, and reflects the only reality: you make or lose money when that market moves through a range, not because some fixed time (whatever the value) has passed. Ergo, the only sensible thing to look at is how far the market has moved, regardless of time.
      Last edited by koganam; 04-13-2013, 09:56 AM.

      Comment


        #4
        Check out this thread:

        Comment


          #5
          Hello koganam,

          Thank you for your post.

          I will test this on my end to see if I can re-create the same incorrect real-time information for the strategy performance using the SampleMaCrossOver.

          I look forward to assisting you further.

          Comment


            #6
            Hello koganam,

            Thank you for your patience.

            I have been testing this item for the last two days and have not seen the same results as you have.

            From your Real-Time Performance screenshot I see that you are using 'Immediately submit live working historical orders' under Tools > Options > Strategies > NinjaScript > 'On starting a real-time strategy'.

            You have several trades with executions listed as 'Virtual Entry Execution'. These are seen when enabling your strategy with the setting listed above enabled.

            The fact you are seeing several of these 'Virtual Entry Executions' leans towards several disconnects occurring when running the strategy. These appear to throw off the exits and entries.

            Do you see any disconnect messages listed in the Log tab of the NinjaTrader Control Center?

            When enabling the strategy do you set 'Sync Account Position' to True or False?

            I look forward to assisting you further.

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello koganam,

              Thank you for your patience.

              I have been testing this item for the last two days and have not seen the same results as you have.

              From your Real-Time Performance screenshot I see that you are using 'Immediately submit live working historical orders' under Tools > Options > Strategies > NinjaScript > 'On starting a real-time strategy'.
              Yes. I must use that option because I am running multiple copies of 3 different strategies, each instance with different parameters, on the same /TF instrument, albeit each instance is running on a separate chart, as the chart periods and types are different.
              You have several trades with executions listed as 'Virtual Entry Execution'. These are seen when enabling your strategy with the setting listed above enabled.

              The fact you are seeing several of these 'Virtual Entry Executions' leans towards several disconnects occurring when running the strategy. These appear to throw off the exits and entries.

              Do you see any disconnect messages listed in the Log tab of the NinjaTrader Control Center?
              There are no disconnects. That was the first thing that I looked for.
              When enabling the strategy do you set 'Sync Account Position' to True or False?

              I look forward to assisting you further.

              Comment


                #8
                Hello koganam,

                Thank you for that information.

                When enabling the strategy do you set 'Sync Account Position' to True or False?

                In addition, please send me your log and trace files so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Mail to Support.

                Please place 'ATTN: Patrick - 826537' in the subject line and reference this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=57192

                I look forward to your response on this matter.

                Comment


                  #9
                  Originally posted by NinjaTrader_PatrickH View Post
                  Hello koganam,

                  Thank you for that information.

                  When enabling the strategy do you set 'Sync Account Position' to True or False?
                  .
                  Sync account position is false. If I must sync the position, I place a manual order, or else I switch the strategy to be realtime, so that I can bypass any trade that would have been taken, that is the cause of the difference in strategy position and account position. I cannot have NT sync automatically, as that removes my control.

                  In addition, please send me your log and trace files so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Mail to Support.

                  Please place 'ATTN: Patrick - 826537' in the subject line and reference this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=57192

                  I look forward to your response on this matter

                  Comment


                    #10
                    Originally posted by NinjaTrader_PatrickH View Post
                    Hello koganam,

                    Thank you for that information.

                    When enabling the strategy do you set 'Sync Account Position' to True or False?

                    In addition, please send me your log and trace files so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Mail to Support.

                    Please place 'ATTN: Patrick - 826537' in the subject line and reference this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=57192

                    I look forward to your response on this matter.
                    Patrick, have you been given the trace and log files that I sent?

                    Thanks.

                    Comment


                      #11
                      hi
                      I have struggled with this to no end for a year now.
                      In conclusion, I have found that any performance report from right clicking on anything will not produce a reliable report. But I have found a reliable workaround.

                      I create many sub accounts under the sim account creation tab under options. I have 200 sim accounts under my live account . I then place each strategy in its own account. I run the strategy live and all of the trades and trade history is saved in the database. I run the strategies from the strategy tab without a chart. You can use charts if you prefer.
                      I then go to the account performance tab and select each subaccount individually and do a performance report that way. It is reliable and I have found it to work perfectly.

                      This will insure that you have no corrupted trades showing in your report.

                      I suggested that Ninja announce this publicly and tell people about the possible problems with the report from right clicking on the strategy tab or right clicking on the chart.

                      Spread the word ! I now have reliable performance reports !


                      sincerely
                      shane

                      Comment


                        #12
                        Also - multiple exits on the same trade results in "more trades" showing up.

                        ie, enter 10 contracts in, 10 contracts out = 1 trade. Fine.

                        but enter 10 contracts in, 8 contracts out, 2 contracts out (on same trade) = 2 trades!

                        Assuming these were winner, now you show 3 winner trades. (In market replay you can get around this with fill all at once option).

                        Also assuming you have 10 contracts in, 8 at your first target, 2 at your last target = 2 trades also. Maybe the 8 were for 1 point, but the 2 was stopped out at -10 points = A total loser, but you're going to show 50% win loss ratio..







                        Originally posted by shanemcdonald View Post
                        hi
                        I have struggled with this to no end for a year now.
                        In conclusion, I have found that any performance report from right clicking on anything will not produce a reliable report. But I have found a reliable workaround.

                        I create many sub accounts under the sim account creation tab under options. I have 200 sim accounts under my live account . I then place each strategy in its own account. I run the strategy live and all of the trades and trade history is saved in the database. I run the strategies from the strategy tab without a chart. You can use charts if you prefer.
                        I then go to the account performance tab and select each subaccount individually and do a performance report that way. It is reliable and I have found it to work perfectly.

                        This will insure that you have no corrupted trades showing in your report.

                        I suggested that Ninja announce this publicly and tell people about the possible problems with the report from right clicking on the strategy tab or right clicking on the chart.

                        Spread the word ! I now have reliable performance reports !


                        sincerely
                        shane

                        Comment


                          #13
                          What settings do i use to make sure only real time trades print on chart?

                          Is there a "if LastBarOnChart {" kind of keyword?

                          Comment


                            #14
                            Hi NTbrass, thanks for your post.

                            There are two ways it can be done. The first is to stop plot executions all together through the Data Series menu and plot only when State == State.RealTime. The other way would be to ignore the historical data in your strategy, this would render the strategy unable to backtest:

                            Code:
                            OnBarUpdate()
                            {
                                if(State == State.Historical) return;
                            
                            ...
                            }
                            Please let me know if I can assist any further.
                            Chris L.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by trilliantrader, 04-18-2024, 08:16 AM
                            5 responses
                            22 views
                            0 likes
                            Last Post trilliantrader  
                            Started by Davidtowleii, Today, 12:15 AM
                            0 responses
                            3 views
                            0 likes
                            Last Post Davidtowleii  
                            Started by guillembm, Yesterday, 11:25 AM
                            2 responses
                            9 views
                            0 likes
                            Last Post guillembm  
                            Started by junkone, 04-21-2024, 07:17 AM
                            9 responses
                            70 views
                            0 likes
                            Last Post jeronymite  
                            Started by mgco4you, Yesterday, 09:46 PM
                            1 response
                            14 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Working...
                            X