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 PaulMohn, Today, 12:36 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by yertle, Yesterday, 08:38 AM
            8 responses
            36 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Started by rdtdale, Today, 01:02 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by alifarahani, Today, 09:40 AM
            3 responses
            16 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by RookieTrader, Today, 09:37 AM
            4 responses
            19 views
            0 likes
            Last Post RookieTrader  
            Working...
            X