Skip to content

NewOrderDialog

Summary

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

Signature

1
public class NewOrderDialog

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public 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();
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 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()

Methods

ShowDialog

Summary

Shows the dialog.

Signature

1
public void ShowDialog()

Return Value

void

SetProperty

Signature

1
private void SetProperty(T& field, T value)

Parameters

Name Type Description
field T&
value T

Return Value

void

GetProperty

Signature

1
private T GetProperty(T& field)

Parameters

Name Type Description
field T&

Return Value

T

Properties

OrderType

Summary

Gets or sets the OrderType.

Signature

1
public OrderType OrderType {get; set;}

Return Value

OrderType

TradeType

Summary

Gets or sets the TradeType.

Signature

1
public TradeType TradeType {get; set;}

Return Value

TradeType

SymbolName

Summary

Gets or sets the SymbolName.

Signature

1
public string SymbolName {get; set;}

Return Value

string

Volume

Summary

Gets or sets the Volume.

Signature

1
public double? Volume {get; set;}

Return Value

double?

TargetPrice

Summary

Gets or sets the TargetPrice.

Signature

1
public double? TargetPrice {get; set;}

Return Value

double?

StopLimitRangePips

Summary

Gets or sets the StopLimitRangePips.

Signature

1
public double? StopLimitRangePips {get; set;}

Return Value

double?

StopLossPips

Summary

Gets or sets the StopLossPips.

Signature

1
public double? StopLossPips {get; set;}

Return Value

double?

TakeProfitPips

Summary

Gets or sets the TakeProfitPips.

Signature

1
public double? TakeProfitPips {get; set;}

Return Value

double?

Expiration

Summary

Gets or sets the Expiration.

Signature

1
public DateTime? Expiration {get; set;}

Return Value

DateTime?

Comment

Summary

Gets or sets the Comment.

Signature

1
public string Comment {get; set;}

Return Value

string

HasTrailingStop

Summary

Gets or sets the HasTrailingStop.

Signature

1
public bool HasTrailingStop {get; set;}

Return Value

bool

StopLossTriggerMethod

Summary

Gets or sets Trigger method for order StopLoss

Signature

1
public StopTriggerMethod? StopLossTriggerMethod {get; set;}

Return Value

StopTriggerMethod?

StopOrderTriggerMethod

Summary

Gets or sets the HasTrailingStop.

Signature

1
public StopTriggerMethod? StopOrderTriggerMethod {get; set;}

Return Value

StopTriggerMethod?

MarketRangePips

Summary

Gets or sets the MarketRangePips.

Signature

1
public double? MarketRangePips {get; set;}

Return Value

double?