Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradingsystemanalysis => Log not saved

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

    Tradingsystemanalysis => Log not saved

    Hi, if I run my strategy in back testing, only the last values are stored in the log. When the backtest is re-tested, the old values are overwritten and only zero values are displayed in the log. Why?

    Click image for larger version

Name:	Screenshot_3.jpg
Views:	76
Size:	104.6 KB
ID:	1156617

    #2
    Hello sidlercom80,

    Thank you for your post.

    Please test the SampleMACrossOver strategy that comes default with NinjaTrader in the Strategy Analyzer.

    Do you see the same behavior occur when backtesting the SampleMACrossOver strategy?

    If so, please provide the exact steps taken to reproduce the behavior so I may test it on my end.

    I look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi _BrandonH, no, it just doesn't seem to fit my strategy. With the SampleMACrossOver everything is ok. but where could be the problem, what should I look for?

      Comment


        #4
        Hello sidlercom80,

        Thank you for your note.

        I am unable to determine exactly what may be causing the behavior you are seeing. Ultimately, debugging steps should be taken to see how the strategy is behaving when running a backtest.

        To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
        https://ninjatrader.com/support/foru...121#post791121

        Please let me know if I may further assist
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Brandon you got me wrong The strategy is executed correctly, all the results are correct. The only problem is that the result is not stored in the log, but is overwritten during the retest. Only the most recent back test is always saved. The results of the back test of my strategy are not saved, but the results of SampleMACrossOver for example are saved.
          I made a short video, there you can see the problem: http://www.youtube.com/watch?v=ZV1ZptGtrNU

          Comment


            #6
            Hello sidlercom80,

            Thank you for your note.

            Since the behavior does not occur when testing the SampleMACrossover strategy this likely means there is an issue with your strategy that is causing the behavior.

            When working with any issue, it is important to take steps to isolate the issue so that the exact line causing the behavior can be found. This is a process of elimination and a process of debugging by adding prints.

            First, it's great to create a copy of the script so that the original work is kept safe. Once the copy is created, the copy can be modified in any way without losing the original work.

            Below is a link to a video that demonstrates making a copy of a script.
            https://www.youtube.com/watch?v=BA0W...utu.be&t=8m15s

            The next step is to start commenting out code. It is helpful to think about when the error is occurring to target areas, and comment code from everywhere else quickly. If at any point after removing some code, the error stops, add the last removed item back. This is likely where the issue is occurring in the script.

            Let us know if we may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by terkk, Today, 01:16 PM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Heath  
            Started by TraderElegante, Today, 12:14 PM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by dgee949, Today, 11:44 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_JustinD  
            Started by NinjaTrader_Kate, Today, 12:01 PM
            0 responses
            20 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by efeuvejota01, Today, 11:42 AM
            3 responses
            36 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X