Deal
interface cAlgo.API Since 5.1
DesktopCLICloud
Represents a deal.
Definition
public interface Deal
Namespace: cAlgo.API · Group: Deals
Examples
Example 1
foreach (var position in Positions)
{
foreach (var deal in position.Deals)
Print("Position {0} deal {1}: {2} {3} {4} units at {5}, {6}", position.Id, deal.Id, deal.PositionImpact, deal.TradeType, deal.VolumeInUnits, deal.ExecutionPrice, deal.ExecutionTime);
}
for position in api.Positions:
for deal in position.Deals:
api.Print(f"Position {position.Id} deal {deal.Id}: {deal.PositionImpact} {deal.TradeType} {deal.VolumeInUnits} units at {deal.ExecutionPrice}, {deal.ExecutionTime}")
Example 2
foreach (var trade in History)
{
var deal = trade.ClosingDeal;
Print("Trade closing deal {0}: {1} units at {2}, status {3}", deal.Id, deal.VolumeInUnits, deal.ExecutionPrice, deal.Status);
}
for trade in api.History:
deal = trade.ClosingDeal
api.Print(f"Trade closing deal {deal.Id}: {deal.VolumeInUnits} units at {deal.ExecutionPrice}, status {deal.Status}")
Properties
| Name | Description |
|---|---|
ChannelDesktopCLICloudstring | Gets the channel. |
ClosedByDesktopCLICloudIReadonlyList<Deal> | If deal was an opening deal then this property will return the deals that closed current deal. |
ClosingDesktopCLICloudIReadonlyList<Deal> | If deal was a closing deal then this property will return the deals that were closed by current deal. |
CommentDesktopCLICloudstring | Gets the comment. |
ExecutionPriceDesktopCLIClouddouble? | Returns deal execution price if deal is filled otherwise null. |
ExecutionTimeDesktopCLICloudDateTime | Returns deal execution time. |
IdDesktopCLICloudlong | Unique deal Id. |
LabelDesktopCLICloudstring | Gets the label. |
OrderIdDesktopCLICloudint | Order Id. |
PositionIdDesktopCLICloudint | Position Id. |
PositionImpactDesktopCLICloudDealPositionImpact? | Returns deal position impact if deal is filled otherwise null. |
StatusDesktopCLICloudDealStatus | Returns status of deal. |
SymbolNameDesktopCLICloudstring | Gets the symbol name. |
TradeTypeDesktopCLICloudTradeType | Gets the TradeType. |
VolumeInUnitsDesktopCLIClouddouble | Deal filled volume amount in units. |