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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        41 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X