Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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?
    BertrandNinjaTrader Customer Service

    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.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          27 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 04-23-2024, 09:53 PM
          2 responses
          49 views
          0 likes
          Last Post wzgy0920  
          Started by Kensonprib, 04-28-2021, 10:11 AM
          5 responses
          193 views
          0 likes
          Last Post Hasadafa  
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,235 views
          0 likes
          Last Post xiinteractive  
          Working...
          X