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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          181 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          334 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          258 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          358 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          187 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X