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:	221
Size:	104.6 KB
ID:	1156617
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #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?
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      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
          sidlercom80
          NinjaTrader Ecosystem Vendor - Sidi Trading

          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 michi08, 10-05-2018, 09:31 AM
            2 responses
            737 views
            0 likes
            Last Post Denver_Wayne  
            Started by sightcareclickhere, Today, 01:55 PM
            0 responses
            1 view
            0 likes
            Last Post sightcareclickhere  
            Started by Mindset, 05-06-2023, 09:03 PM
            9 responses
            258 views
            0 likes
            Last Post ender_wiggum  
            Started by Mizzouman1, Today, 07:35 AM
            4 responses
            18 views
            0 likes
            Last Post Mizzouman1  
            Started by philmg, Today, 01:17 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X