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

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 bmartz, 03-12-2024, 06:12 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    13 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X