• 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

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

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bosajin, Today, 06:27 PM
      0 responses
      2 views
      0 likes
      Last Post bosajin
      by bosajin
       
      Started by saltminer, Today, 06:11 PM
      0 responses
      2 views
      0 likes
      Last Post saltminer  
      Started by epitoma, Today, 05:21 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by BatBart, Today, 01:24 PM
      1 response
      23 views
      0 likes
      Last Post NinjaTrader_Melissa  
      Started by ezrakoper, Today, 03:05 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X