Skip to content

Error

Summary

Encapsulates an error code.

Signature

1
public abstract interface Error

Namespace

cAlgo.API

Examples

1
2
3
4
5
 protected override void OnError(Error error)
 {
     // Print the error code
     Print("{0}", error.Code);
 }
1
2
3
 def on_error(self, error):
     # Print the error code
     print(error.Code)

Properties

Code

Summary

The encapsulated error code.

Signature

1
public abstract ErrorCode Code {get;}

Return Value

ErrorCode

Examples

1
2
3
4
5
6
 protected override void OnError(Error error)
 {
     // stop the robot if there is a volume error
     if (error.Code == ErrorCode.BadVolume)
         Stop();
 }
1
2
3
4
 def on_error(self, error):
     # stop the robot if there is a volume error
     if error.Code == ErrorCode.BadVolume:
         api.Stop()

TradeResult

Summary

The result of the trade that produced the error

Signature

1
public abstract TradeResult TradeResult {get;}

Return Value

TradeResult

Examples

1
2
3
4
5
 protected override void OnError(Error error)
 {
     var result = error.TradeResult;
     Print(result);
 }
1
2
3
 def on_error(self, error):
     result = error.TradeResult
     print(result)