---
id: "T:cAlgo.API.NewOrderDialog"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# NewOrderDialog (class)

Represents a common dialog box that allows a user to create a new order.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No dialog can be shown in the CLI: ShowDialog returns without showing anything and the order settings are only stored.
- Cloud: No dialog can be shown in the cloud: ShowDialog returns without showing anything and the order settings are only stored.

## Definition

```csharp
public class NewOrderDialog
```

Available since cAlgo.API 5.2.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    protected override void OnStart()
    {
        var newOrderDialog = new NewOrderDialog
        {
            TradeType = TradeType.Sell,
            OrderType = OrderType.Limit,
            SymbolName = SymbolName,
            Volume = Symbol.VolumeInUnitsMin * 10,
            StopLossPips = 20,
            TakeProfitPips = 40
        };

        newOrderDialog.ShowDialog();
    }
}
```

Python:

```python
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        newOrderDialog = NewOrderDialog()
        newOrderDialog.TradeType = TradeType.Sell
        newOrderDialog.OrderType = OrderType.Limit
        newOrderDialog.SymbolName = api.SymbolName
        newOrderDialog.Volume = api.Symbol.VolumeInUnitsMin * 10
        newOrderDialog.StopLossPips = 20
        newOrderDialog.TakeProfitPips = 40

        newOrderDialog.ShowDialog()
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Constructors

- `public NewOrderDialog()` — Creates a NewOrderDialog. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/Constructor/index.md)

## Methods

- `public void ShowDialog()` — Shows the dialog. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/ShowDialog/index.md)

## Properties

- `public string Comment {get; set;}` — Gets or sets the Comment. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/Comment/index.md)
- `public DateTime? Expiration {get; set;}` — Gets or sets the Expiration. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/Expiration/index.md)
- `public bool HasTrailingStop {get; set;}` — Gets or sets the HasTrailingStop. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/HasTrailingStop/index.md)
- `public double? MarketRangePips {get; set;}` — Gets or sets the MarketRangePips. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/MarketRangePips/index.md)
- `public OrderType OrderType {get; set;}` — Gets or sets the OrderType. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/OrderType/index.md)
- `public double? StopLimitRangePips {get; set;}` — Gets or sets the StopLimitRangePips. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/StopLimitRangePips/index.md)
- `public double? StopLossPips {get; set;}` — Gets or sets the StopLossPips. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/StopLossPips/index.md)
- `public StopTriggerMethod? StopLossTriggerMethod {get; set;}` — Gets or sets Trigger method for order StopLoss [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/StopLossTriggerMethod/index.md)
- `public StopTriggerMethod? StopOrderTriggerMethod {get; set;}` — Gets or sets the HasTrailingStop. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/StopOrderTriggerMethod/index.md)
- `public string SymbolName {get; set;}` — Gets or sets the SymbolName. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/SymbolName/index.md)
- `public double? TakeProfitPips {get; set;}` — Gets or sets the TakeProfitPips. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/TakeProfitPips/index.md)
- `public double? TargetPrice {get; set;}` — Gets or sets the TargetPrice. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/TargetPrice/index.md)
- `public TradeType TradeType {get; set;}` — Gets or sets the TradeType. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/TradeType/index.md)
- `public double? Volume {get; set;}` — Gets or sets the Volume. [details](https://help.ctrader.com/ctrader-algo/references/Dialogs/NewOrderDialog/Volume/index.md)

