Skip to content

PlaceStopOrderAsync Method (21)

PlaceStopOrderAsync (1 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (2 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (3 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (4 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (5 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
comment string Order comment
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (6 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
comment string Order comment
hasTrailingStop bool Enable/disable TrailingStop for position
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (7 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
comment string Order comment
hasTrailingStop bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? Trigger method for position's StopLoss
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (8 of 21)

Summary

Place stop order in asynchronous execution mode

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType Direction of trade
symbolName string Symbol name of trade
volume double Volume of trade
targetPrice double Price at which the order becomes market order
label string Label representing the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
comment string Order comment
hasTrailingStop bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it's a StopOrder
callback Action Action when order is placed

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 namespace cAlgo.Robots
 {
 [Robot]
 public class myCBot : Robot
 {
     protected override void OnStart()
     {
         //This method is called when the cBot is being started, once.
     }
     protected override void OnBar()
     {
         // Called on each incoming Bar.
     }
     protected override void OnTick()
     {
         // Called on each incoming tick.
     }
     protected override void OnError(Error error)
     {
         Print("There has been an Error");
     }
     protected override void OnStop()
     {
         //This method is called when the cBot is being stoped.
     }
}

PlaceStopOrderAsync (9 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, long volume, double targetPrice, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume long
targetPrice double
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (10 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (11 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, long volume, double targetPrice, string label, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume long
targetPrice double
label string
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (12 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (13 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, long volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume long
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (14 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (15 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, long volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume long
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (16 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (17 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, long volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume long
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
comment string
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (18 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
comment string
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (19 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
comment string
hasTrailingStop bool
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (20 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
comment string
hasTrailingStop bool
stopLossTriggerMethod StopTriggerMethod?
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot

PlaceStopOrderAsync (21 of 21)

Signature

1
public TradeOperation PlaceStopOrderAsync(TradeType tradeType, Symbol symbol, double volume, double targetPrice, string label, double? stopLossPips, double? takeProfitPips, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, Action<TradeResult> callback)

Parameters

Name Type Description
tradeType TradeType
symbol Symbol
volume double
targetPrice double
label string
stopLossPips double?
takeProfitPips double?
expiration DateTime?
comment string
hasTrailingStop bool
stopLossTriggerMethod StopTriggerMethod?
stopOrderTriggerMethod StopTriggerMethod
callback Action

Return Value

TradeOperation

Declaring Type

cAlgo.API.Robot


Last update: July 1, 2022

Comments