Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Working with the console

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

    Working with the console

    last coding I did was APL and Fortran 77 about 30 years ago so...

    Is it possible to clear the output screen?

    Does NT support Console.Write and Console.Read?

    I tried one of the examples in the tutorials pages that you recommeneded but have nothing in the output screen

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Strategy;
    #endregion
    namespace NinjaTrader.Strategy
    {
    publicclass Test1 : Strategy
    {
    privatevoid Main()
    {
    Print(
    "Hello World");
    }
    }
    }

    I'm sure it's a simple mistake on my part but can you see what I've done wrong and why I get no output?

    Steve


    #2
    Hello,

    You can clear the output window with ClearOutputWindow():


    To Print() try using this code:

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Strategy;
    #endregion

    namespace NinjaTrader.Strategy
    {

    [Description("Enter the description of your strategy here")]
    publicclass Printing : Strategy
    {
    #region Variables

    privateint myInput0 = 1;
    #endregion
    protectedoverridevoid Initialize()
    {
    CalculateOnBarClose =
    false;
    }
    protectedoverridevoid OnBarUpdate()
    {
    Print(
    "hello world");
    }
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    475 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    315 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    253 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    340 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    305 views
    0 likes
    Last Post CarlTrading  
    Working...
    X