ExecuteMarketRangeOrderAsync Method (6)
ExecuteMarketRangeOrderAsync (1 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbolName | string | Symbol name of trade |
volume | double | Volume (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
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.
}
}
|
ExecuteMarketRangeOrderAsync (2 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbolName | string | Symbol name of trade |
volume | double | Volume (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
label | string | Label representing the order |
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.
}
}
|
ExecuteMarketRangeOrderAsync (3 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, 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 (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
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.
}
}
|
ExecuteMarketRangeOrderAsync (4 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, Action<TradeResult> callback)
|
Parameters
Name | Type | Description |
tradeType | TradeType | Direction of trade |
symbolName | string | Symbol name of trade |
volume | double | Volume (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
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.
}
}
|
ExecuteMarketRangeOrderAsync (5 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, 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 (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
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.
}
}
|
ExecuteMarketRangeOrderAsync (6 of 6)
Summary
Execute a market order in asynchronous execution mode
Signature
| public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, 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 (in units) of trade |
marketRangePips | double | The market range (slippage) in Pips |
basePrice | double | Base price to calculate relative slippage price |
label | string | Label representing the order |
stopLossPips | double? | Stop loss in pips |
takeProfitPips | double? | Take profit in pips |
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.
}
}
|
Last update: January 30, 2023