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

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

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