Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PrintTo = PrintTo.OutputTab2 doesn't work

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

    PrintTo = PrintTo.OutputTab2 doesn't work

    Hello

    I'm trying to print the outputs of a custom indicator in the tab 2 of the output window, but the code in SetDefaults doesn't work, as the the prints are still printed on window 1.

    Code:
    if (State == State.SetDefaults)
    {
         PrintTo = PrintTo.OutputTab2

    #2
    Hello itrader46,

    Thanks for your post.

    Here is an example you can replicate that demonstrates sending the Print to OutputTab2.

    Code:
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "PrintToExample";
                    Calculate                                    = Calculate.OnBarClose;
                    IsOverlay                                    = true;
                    DisplayInDataBox                            = true;
                    DrawOnPricePanel                            = true;
                    DrawHorizontalGridLines                        = true;
                    DrawVerticalGridLines                        = true;
                    PaintPriceMarkers                            = true;
                    ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                    //Disable this property if your indicator requires custom values that cumulate with each new market data event. 
                    //See Help Guide for additional information.
                    IsSuspendedWhileInactive                    = true;
    
                    PrintTo                                     = PrintTo.OutputTab2;
                }
                else if (State == State.Configure)
                {
                }
            }
    
            protected override void OnBarUpdate()
            {            
                Print (Time[0]+"  CB: "+CurrentBar);                
            }

    Comment


      #3
      I removed the indicator and reapplied it, then it worked. First time I only refreshed it with F5 and didn't work

      Comment


        #4
        Originally posted by itrader46 View Post
        I removed the indicator and reapplied it, then it worked. First time I only refreshed it with F5 and didn't work
        Remember it. It is important. It has messed me up a number of times. Usually if you change an internal NT parameter in SetDefaults, you will have to remove the indicator, and then add it back, for the change to take effect.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        91 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        48 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        105 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X