Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TIP: Control Print to output window for hosted indicator script parent child

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

    TIP: Control Print to output window for hosted indicator script parent child

    I have script B, which I need to print to the output window to verify some operations during testing.
    I have script A, which calls script B, similar to how you can call a different indicator script
    Code:
    double mySMA = SMA(5)[0];
    But when script B is hosted (called from) script A I did not want script B to print to the output window, too much data...

    So I created a method in script B
    Code:
    // control printing output
            private void PrintThis(string PrintString)
            {   // if this indicator is hosted (called by) some other indicator, the PanelUI will be 0
                // this prevents printing to the output window if this script (child) is called from inside another script (ie parent)
                // only print if PanelUI > 0
                if (this.PanelUI > 0)
                {            
                    Print(this.Name +", "+ PrintString);
                }
            }​

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
80 views
1 like
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
40 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
63 views
2 likes
Last Post CaptainJack  
Started by CarlTrading, 03-30-2026, 11:51 AM
0 responses
63 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