> 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.

# PrintTo

## Definition

Determines either tab of the NinjaScript **Output window** the **Print()** and **ClearOutputWindow()** method targets.

## Property Value

An enum value representing the target Output Tab. The default value is **PrintTo.OutputTab1**.

Possible values are:

| Property               | Description                         |
| ---------------------- | ----------------------------------- |
| **PrintTo.OutputTab1** | Output Windows tab named "Output 1" |
| **PrintTo.OutputTab2** | Output Windows tab named "Output 2" |

## Syntax

`PrintTo`

## Examples

### Setting the default PrintTo in separate scripts (#1)

```csharp
protected override void OnStateChange()
{      
   if (State == State.SetDefaults)
   {
     Name = "Sample PrintTo Indicator #1";
     Description = @"Used to Print updates to Output 1";
 
     //Set this scripts Print() calls to the first output tab
     PrintTo = PrintTo.OutputTab1;
   }      
}
 
protected override void OnBarUpdate() 
{                  
   Print("This script will print messages to Output Tab 1");      
}
```

### Setting the default PrintTo in separate scripts (#2)

```csharp
protected override void OnStateChange()
{      
   if (State == State.SetDefaults)
   {
     Name = "Sample PrintTo Indicator #2";
    Description = "@Used to Print updates to Output 2";
 
     //Set this scripts Print() calls to the second output tab
     PrintTo = PrintTo.OutputTab2;
   }      
}
 
protected override void OnBarUpdate() 
{                  
   Print("This script will print messages to Output Tab 2");      
}
```

### Setting PrintTo conditionally in a single script

```csharp
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
   if(marketDataUpdate.MarketDataType == MarketDataType.Ask)
   {
     //Print Ask updates to Output 1
     PrintTo = PrintTo.OutputTab1;
     Print("Ask: " + marketDataUpdate.Price);
   }
   
   else if (marketDataUpdate.MarketDataType == MarketDataType.Bid)
   {
     //Print Bid updates to Output 2
     PrintTo = PrintTo.OutputTab2;
     Print("Bid: " + marketDataUpdate.Price);
   }
}
```