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

# OnShare()

## Definition

This method is called when the user clicks OK on the Share window in **NinjaTrader**. This method can also be called by Alerts and general **NinjaScript** objects.

## Method Return Value

This method does not return a value.

## Parameters

| Parameter         | Description                                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **text**          | The message being sent to the social network or other Share provider. This is what appears in the textbox of the Share window. |
| **imageFilePath** | Optional path to screenshot or other image to be sent to the social network or other Share provider.                           |

## Syntax

You must override the method in your Share Service with the following syntax.

`public override void OnShare(string text, string imageFilePath)`

## Examples

```csharp
public override void OnShare(string text, string imgFilePath)
{
  // place your share service logic here
}
```