Skip to content

NewOrderDialog

class cAlgo.API Since 5.2

DesktopCLICloud

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

Environment behaviour

CLI — not supported. No dialog can be shown in the CLI: ShowDialog returns without showing anything and the order settings are only stored.

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

Definition

public class NewOrderDialog

Namespace: cAlgo.API · Group: Dialogs

Examples

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();
    }
}
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()
{
  "AccessRights": "None"
}

Constructors

Name Description
NewOrderDialogDesktopCLICloud Creates a NewOrderDialog.

Methods

Name Description
ShowDialogDesktopCLICloudvoid Shows the dialog.

Properties

Name Description
CommentDesktopCLICloudstring Gets or sets the Comment.
ExpirationDesktopCLICloudDateTime? Gets or sets the Expiration.
HasTrailingStopDesktopCLICloudbool Gets or sets the HasTrailingStop.
MarketRangePipsDesktopCLIClouddouble? Gets or sets the MarketRangePips.
OrderTypeDesktopCLICloudOrderType Gets or sets the OrderType.
StopLimitRangePipsDesktopCLIClouddouble? Gets or sets the StopLimitRangePips.
StopLossPipsDesktopCLIClouddouble? Gets or sets the StopLossPips.
StopLossTriggerMethodDesktopCLICloudStopTriggerMethod? Gets or sets Trigger method for order StopLoss
StopOrderTriggerMethodDesktopCLICloudStopTriggerMethod? Gets or sets the HasTrailingStop.
SymbolNameDesktopCLICloudstring Gets or sets the SymbolName.
TakeProfitPipsDesktopCLIClouddouble? Gets or sets the TakeProfitPips.
TargetPriceDesktopCLIClouddouble? Gets or sets the TargetPrice.
TradeTypeDesktopCLICloudTradeType Gets or sets the TradeType.
VolumeDesktopCLIClouddouble? Gets or sets the Volume.