Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print does not create text in Output Window

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

    Print does not create text in Output Window

    Hi,

    new to the NT, so what am I missing here? None of the print statements below creates any output in the Output Window during a backtest run (which creates the expected results).

    Best regards
    Gwaihir

    Code:
     
    publicclass bidlowprice : Strategy
    {
    #region Variables
    // Wizard generated variables
    privateint sellDelay = 2; // Default setting for SellDelay
    // User defined variables (add any user defined variables below)
    #endregion
    ///<summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    ///</summary>
    protectedoverridevoid Initialize()
    {
    CalculateOnBarClose = false;
    Print("XXX");
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    double diff = High[1] - Low[1];
    Print("test");
    Print(diff + " ," + High[0] + " ," + Low[0] + " ," + Low[1] + " ," + (Low[1] - diff));
    if (High[0] > (Low[1] - diff)
    && Low[0] < (Low[1] - diff))
    {
    EnterLong(DefaultQuantity, "");
    }
    // Condition set 2
    if (BarsSinceEntry() == SellDelay)
    {
    ExitLong("", "");
    }
    }
    #region Properties
    [Description("Delay before Stuff bought gets sold")]
    [Category("Parameters")]
    publicint SellDelay
    {
    get { return sellDelay; }
    set { sellDelay = Math.Max(0, value); }
    }
    #endregion
    }
    }

    #2
    Gwaihir, welcome to the forums at NT - did you open the output windows before you started the strategy / backtest?

    Any errors being thrown to the log tab?

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Gwaihir, welcome to the forums at NT - did you open the output windows before you started the strategy / backtest?
      Yes

      Any errors being thrown to the log tab?
      No

      Comment


        #4
        Ah, unlocking the code implies manually compiling it. Otherwise changes are ignored when the strategy is run. A tiny reminder like "strategy being backtested is not the one last saved" would be helpful though.

        Comment


          #5
          Correct and thanks for the suggestion Gwaihir.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X