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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    127 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    105 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    85 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    105 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    86 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X