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

# OnNextDataPoint()

## Definition

The **OnNextDataPoint()** method is called for each line of data contained in the file being imported. This method is only called if the import type determines that the file has a valid data point, and will continue to be called until it reaches the end of the file, or until the data point is no longer valid.

## Method Return Value

This method does not return a value.

## Syntax

See example below. The [NinjaScript code wizards](/developer/desktop-sdk/guides/ninjascript-editor-overview/ninjascript-wizard) automatically generate the method syntax for you.

## Examples

```csharp
private StreamReader reader;
  
protected override void OnNextDataPoint()
{
   if (reader == null)
       return;

   // Continually read data using the StreamReader defined above
   while (true)
   {
       DataPointString = reader.ReadLine();
       // Additional data formatting here
   }
}
```