Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancel/Stop/Break button not visible during backtesting

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

    Cancel/Stop/Break button not visible during backtesting

    Hello guys,

    during backtesting there is no button to Cancel/Stop/Break.

    I'm attaching example of strategy code that can help to reproduce on your side and screenshot of the issue.


    PHP Code:


    public class NTQuestionBacktestingCancelButtonNotVisible Strategy
        
    {
            private List<
    stringentryNames;

            protected 
    override void OnStateChange()
            {
                if (
    State == State.SetDefaults)
                {
                    
    Name "NTQuestionBacktestingCancelButtonNotVisible";
                    
    Calculate Calculate.OnBarClose;
                }
                else if (
    State == State.Configure)
                {
                    
    entryNames = new List<string>();
                }
            }

            protected 
    override void OnBarUpdate()
            {
                var 
    name "Long" CurrentBar;
                
    EnterLong(name);
                
    entryNames.Add(name);

                for (
    int i entryNames.Count-1>= 0i--)
                {
                    if(
    BarsSinceEntryExecution(entryNames[i]) >= 10)
                    {
                        
    ExitLong(entryNames[i]);
                        
    entryNames.RemoveAt(i);
                    }
                }
            }
        } 


    Please take look, thanks!


    Attached Files
    Last edited by login_dejavu; 04-10-2020, 01:51 PM. Reason: Baktesting, Strategy Analyzer

    #2
    Hello login_dejavu,

    Thanks for your message.

    The Strategy Analyzer implements an Abort button for Optimizations, but does not implement it for standard backtests. As such we are tracking interest to implement the Abort button in the Strategy Analyzer for standard backtests with the enhancement ticket ID SFT-1359. I've added a vote on your behalf.

    For any other community members that would like to have this implemented, please let us know you would like us to add a vote for you too.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks! Otherwise I forced to do ugly hacks like this

      PHP Code:

      if(CurrentBar && Time[0].Date != Time[1].Date)
      {    
          if(
      System.Diagnostics.Process.GetProcessesByName("Notepad").Length != 0)
                throw new 
      Exception("FORCED STOP");

      Last edited by login_dejavu; 04-11-2020, 06:14 AM.

      Comment


        #4
        I am sitting here in a backtest that I messed up in code and it is taking way too long. I need a way to abort the backtest and found this thread.

        Comment


          #5
          Hello bengalvfan,

          There is not Abort button with backtesting, just with optimizations. I have submitted a vote on your behalf to SFT-1359 so your interest is tracked as well.

          In the meantime, you could use the Windows Task Manager and expand the items under NinjaTrader (in the Processes tab) and you can select the Strategy Analyzer and End Task to close just that window.
          JimNinjaTrader Customer Service

          Comment


            #6
            Vote!
            I'have a backtest hanged that cannot abort.
            Thanks
            Francesco

            Comment


              #7
              Hello gneppe,

              Thanks for your post.

              Your vote has been added.

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

              Comment


                #8
                Please add mine too. There's no way to cancel a forever looping backtest or for example one where you earlier had something like a bool haltprogram = true; if (haltprogram) return; type thing going on in OnBarUpdate for testing and forgot to comment it out, or if you accidentally put a years worth of range instead of a day, or if you forgot o check / update some parameter, etc. then the only way to cancel it is to shut the platform down and restart.

                There are soo many very good reasons to have a button labelled "Woah! Woah! Woah! Hang on! Hang on!". Although I bet your developers will insist on a more concise label but that's the functionality that's missing.

                I went looking for the solution and found this thread.

                Mark
                Last edited by markdshark; 06-02-2023, 03:51 PM.

                Comment


                  #9
                  Vote! from me too

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  13 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X