Skip to content

Balance Property

Summary

Returns the balance of the current account.

Signature

1
public abstract double Balance {get;}

Return Value

double

Declaring Type

cAlgo.API.Internals.IAccount

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 double balancebefore;
 double balanceafter;
 protected override void OnStart()
 {
    // store the balance upon start up of the robot
    balancebefore = Account.Balance;
 }
 protected override void OnStop()
 {
     // Store the balance upon stop of the robot.
     balanceafter = Account.Balance;
     // print the difference
    Print("The difference of balancebefore and balanceafter is: {0}", balancebefore-balanceafter);
 }
1
2
 if ( Account.Balance < 0 )
     Stop();

Last update: July 1, 2022

Comments