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 Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
656 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
371 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
109 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
574 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
579 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X