Summary
Enumeration of standard error codes.
Remarks
Error codes are readable descriptions of the responses returned by the server.
Syntax
public sealed enum ErrorCode
Members
Name | Type | Summary |
---|---|---|
BadVolume | Field | The volume value is not valid |
Disconnected | Field | The server is disconnected. |
EntityNotFound | Field | Position does not exist. |
InvalidRequest | Field | The invalid request. |
InvalidStopLossTakeProfit | Field | The invalid Stop Loss or Take Profit. |
MarketClosed | Field | The market is closed. |
NoMoney | Field | There are not enough money in the account to trade with. |
TechnicalError | Field | A generic technical error with a trade request. |
Timeout | Field | Operation timed out. |
UnknownSymbol | Field | Unknown symbol. |
Example 1
protected override void OnError(Error error) { // Print the error to the log switch (error.Code) { case ErrorCode.BadVolume: Print("Bad Volume"); break; case ErrorCode.TechnicalError:Print("Technical Error"); break; case ErrorCode.NoMoney: Print("No Money"); break; case ErrorCode.Disconnected: Print("Disconnected"); break; case ErrorCode.MarketClosed: Print("Market Closed"); break; } }