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() help

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

    Print() help

    I am just playing around with the indicator editor and I have put Print() throughout my indicator but it doesn't write it anywhere on my screen when I apply it. I have Print("test"); in my Initialize and OnBarUpdate. Yes I am a noob. Can someone please help. Here is a snippet of my initialize.

    protectedoverridevoid Initialize()
    {
    Print(
    "Test");

    }

    #2
    Print() prints output to the Output Window. To open the Output Window go to Tools->Output Window.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Ah ok cool. Say I wanted it printed in a panel is that possible?

      Comment


        #4
        Yup. Please use either DrawText() or DrawTextFixed().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Awesome it worked great. I guess the rest of my programming is crap lol.

          Here it is:

          When I write this
          DrawTextFixed("tag2",Close[0].ToString("0.00"), TextPosition.TopRight);
          I get the previous bars close

          When I do this one
          DrawTextFixed("tag2",Close[1].ToString("0.00"), TextPosition.TopRight);
          I get nothing.

          Sorry for all the noob questions.

          Comment


            #6
            Close[0] will give you the most recent bar's close. If you have CalculateOnBarClose = true then it essentially will return the previous bar's close because the current bar has not closed yet for calculations.

            Close[1] will give you the previous bar's close, but you need to watch out for the indexing. Please see this tip about this: http://www.ninjatrader-support.com/v...ead.php?t=3170
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by naanku, Today, 07:25 PM
            0 responses
            6 views
            0 likes
            Last Post naanku
            by naanku
             
            Started by milfocs, Today, 07:23 PM
            0 responses
            5 views
            0 likes
            Last Post milfocs
            by milfocs
             
            Started by PaulMohn, Today, 06:59 PM
            0 responses
            7 views
            0 likes
            Last Post PaulMohn  
            Started by bortz, 11-06-2023, 08:04 AM
            48 responses
            1,753 views
            0 likes
            Last Post carnitron  
            Started by Jonker, 04-27-2024, 01:19 PM
            3 responses
            24 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X