Skip to content

PlaceLimitOrderAsync Method (19)

PlaceLimitOrderAsync (1 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
callback Action The action when the position closes

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

PlaceLimitOrderAsync (2 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
callback Action The action when the position closes

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

PlaceLimitOrderAsync (3 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
callback Action The action when the position closes

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

PlaceLimitOrderAsync (4 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
stopLossPips double? Stop loss in pips
takeProfitPips double? Take profit in pips
expiration DateTime? Order expiry date and time
callback Action The action when the position closes

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

PlaceLimitOrderAsync (5 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
stopLossPips double? Stop loss in pips from target price
takeProfitPips double? Take profit in pips from target price
expiration DateTime? Order expiry date and time
comment string Order comment
callback Action The action when the position closes

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

PlaceLimitOrderAsync (6 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
stopLossPips double? Stop loss in pips from target price
takeProfitPips double? Take profit in pips from target price
expiration DateTime? Order expiry date and time
comment string Order comment
hasTrailingStop bool Enable/disable TrailingStop for position
callback Action The action when the position closes

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

PlaceLimitOrderAsync (7 of 19)

Summary

Place limit order in asynchronous execution mode

Signature

1
public TradeOperation PlaceLimitOrderAsync(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 Target price (or better) at which the order is filled
label string Label that represents the order
stopLossPips double? Stop loss in pips from target price
takeProfitPips double? Take profit in pips from target price
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 The action when the position closes

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

PlaceLimitOrderAsync (8 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (9 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (10 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (11 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (12 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (13 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (14 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (15 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (16 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (17 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (18 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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

PlaceLimitOrderAsync (19 of 19)

Signature

1
public TradeOperation PlaceLimitOrderAsync(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


Last update: July 1, 2022

Comments