ExecuteMarketOrderAsync Method (18)
ExecuteMarketOrderAsync (1 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, long volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | long | Volume (in units) of trade |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
marketRangePips | double? | |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (2 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | double | Volume (in units) of trade |
label | string | Label representing the order |
stopLossPips | double? | |
takeProfitPips | double? | |
marketRangePips | double? | |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (3 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, long volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, string comment, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | long | Volume (in units) of trade |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
marketRangePips | double? | |
comment | string | |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (4 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, string comment, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | double | Volume (in units) of trade |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
marketRangePips | double? | |
comment | string | Order comment |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (5 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, string comment, bool hasTrailingStop, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | double | Volume (in units) of trade |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
marketRangePips | double? | |
comment | string | Order comment |
hasTrailingStop | bool | Enable/disable TrailingStop for position |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (6 of 18)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbol | Symbol | |
volume | double | Volume (in units) of trade |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
marketRangePips | double? | |
comment | string | Order comment |
hasTrailingStop | bool | Enable/disable TrailingStop for position |
stopLossTriggerMethod | StopTriggerMethod? | Trigger method for position's StopLoss |
callback | Action | Event raised when position is opened |
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.
}
}
|
ExecuteMarketOrderAsync (7 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (8 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, string label, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
label | string | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (9 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (10 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, string label, double? stopLossPips, double? takeProfitPips, string comment, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
comment | string | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (11 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
comment | string | |
hasTrailingStop | bool | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (12 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, string symbolName, double volume, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbolName | string | |
volume | double | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
comment | string | |
hasTrailingStop | bool | |
stopLossTriggerMethod | StopTriggerMethod? | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (13 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, long volume, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | long | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (14 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | double | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (15 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, long volume, string label, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | long | |
label | string | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (16 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | double | |
label | string | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (17 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, long volume, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | long | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
ExecuteMarketOrderAsync (18 of 18)
Signature
| public TradeOperation ExecuteMarketOrderAsync(TradeType tradeType, Symbol symbol, double volume, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | |
symbol | Symbol | |
volume | double | |
label | string | |
stopLossPips | double? | |
takeProfitPips | double? | |
callback | Action | |
Return Value
TradeOperation
Declaring Type
cAlgo.API.Robot
Last update: March 23, 2023