Skip to content

ErrorCode

Summary

Enumeration of standard error codes.

Remarks

Error codes are readable descriptions of the responses returned by the server.

Signature

1
public enum ErrorCode

Namespace

cAlgo.API

Fields

Name Description
TechnicalError A generic technical error with a trade request.
BadVolume The volume value is not valid
NoMoney There are not enough money in the account to trade with.
MarketClosed The market is closed.
Disconnected The server is disconnected.
EntityNotFound Position does not exist.
Timeout Operation timed out.
UnknownSymbol Unknown symbol.
InvalidStopLossTakeProfit The invalid Stop Loss or Take Profit.
InvalidRequest The invalid request.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 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;
     }
 }

Last update: July 1, 2022

Comments