> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# ClearOutputWindow()

## Definition

Clears all data from the NinjaTrader **Output Window**.

The ClearOutputWindow() method only targets the Output tab most recently determined by set **PrintTo** property.

## Method Return Value

This method does not return a value.

## Syntax

`ClearOutputWindow()`

## Examples

```csharp
protected override void OnStateChange()
{       
   if (State == State.SetDefaults)
   {
     Name = "Examples Indicator";   
     Description = @"An indicator used to demonstrate various NinjaScript methods and properties";                    
   }
   else if (State == State.Configure)
   {                
     AddDataSeries(BarsPeriodType.Minute, 5);                
   }   
   
   else if(State == State.DataLoaded)
   {
     //clear the output window as soon as the bars data is loaded
     ClearOutputWindow();         
   }
}
```