ErrorCode


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

NameTypeSummary
BadVolume FieldThe volume value is not valid
Disconnected FieldThe server is disconnected.
EntityNotFound FieldPosition does not exist.
MarketClosed FieldThe market is closed.
NoMoney FieldThere are not enough money in the account to trade with.
TechnicalError FieldA generic technical error with a trade request.
Timeout FieldOperation timed out.

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