• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PrintTo output2

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

    PrintTo output2

    I only want to print certain values into output2, I have default value setup as output1 but certain indicator values I just want them in the outpu2, what syntax to achieve this?


    #2
    Hello Boonfly8,

    The PrintTo can be set at any time. You can set this to one tab print something then set this to another tab and print something else.

    PrintTo = PrintTo.OutputTab2;

    Below is a public link to the help guide which includes an example.
    https://ninjatrader.com/support/help...us/printto.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thank you for your response. I think it would be best if I clarify further. On my OBU methods I have a lot of Print() right now for debugging but on some indicator outputs, I want to specifically print those to the output2 window, for better organization.

      For example, I have something like

      Print("Signal")
      Print" SMA value")
      Print("Stop loss in ticks")
      Print(ADX)
      Print(RSI)

      I would like to print ADX and RSI to the output2.

      I have tried settings the PrintTo, but it just dumps all the logs to the output2 window

      Comment


        #4
        Hello Boonfly8,

        So you are not having an issue printing to Tab2...

        Instead, you are having an issue with what is being printed.

        Are you trying to print the value of the most recent bar of the adx?

        Print(ADX()[0]);

        You need to use parenthesis when calling a method and you need to select a barsAgo index for the bar you want the value from.

        Below is a public link to the help guide on the ADX().
        https://ninjatrader.com/support/help..._index_adx.htm

        And a public link to a forum post with helpful information about getting started with NinjaScript.
        http://ninjatrader.com/support/forum...609#post503609
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea,

          I do not have an issue with the output2 window but rather I want some output value printed to output window2 in addition to the default window. For example, if I have these lines of output on OBU

          If (SMAFAST >= SMASLOW)
          {

          Print("Buy Signal at 8:30:00am)
          Print(Position.AveragePrice)
          Print" SMA value")
          Print("Stop loss in ticks")
          Print(ADX)
          Print(RSI)
          }

          the above is just pseudo code , but when the conditions meet, i purge those values, and on some values such as, for example, secondary indicators like ADX or RSI, I want them to print out to the second output window in addition to the first. So the second output window might look like

          Print("Buy Signal at 8:30:00am)
          Print(ADX)
          Print(RSI)

          Comment


            #6
            Hello Boonfly8,

            I'm not quite understanding the issue.

            You do can exactly that. Set the PrintTo to OutputTab1, print the values, set the PrintTo to OutputTab2, print the values..

            Are you getting an error when changing the tab and printing the values again?
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by U0000999, Yesterday, 05:17 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by asmmbillah, Today, 05:03 AM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by lordvader34, Today, 06:18 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by bc24fl, Today, 06:51 AM
            0 responses
            3 views
            0 likes
            Last Post bc24fl
            by bc24fl
             
            Started by vasagoo, Today, 06:21 AM
            0 responses
            10 views
            0 likes
            Last Post vasagoo
            by vasagoo
             
            Working...
            X