Skip to content

ProgressBar

class cAlgo.API Since 5.1

DesktopCLICloud

Progress bar control.

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public class ProgressBar : ControlBase

Namespace: cAlgo.API · Group: Controls · Inherits: ControlBase

Examples

Example 1

using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    private ProgressBar _progressBar;

    protected override void OnStart()
    {
        _progressBar = new ProgressBar
        {
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
            Width = 200,
            Height = 100,
            Minimum = 0,
            Maximum = 100
        };

        Chart.AddControl(_progressBar);

        Timer.Start(1);
    }

    protected override void OnTimer()
    {
        _progressBar.Value += 5;
    }
}
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        self.progressBar = ProgressBar()
        self.progressBar.HorizontalAlignment = HorizontalAlignment.Center
        self.progressBar.VerticalAlignment = VerticalAlignment.Center
        self.progressBar.Width = 200
        self.progressBar.Height = 100
        self.progressBar.Minimum = 0
        self.progressBar.Maximum = 100
        api.Chart.AddControl(self.progressBar)
        api.Timer.Start(1)

    def on_timer(self):
        self.progressBar.Value += 5
{
  "AccessRights": "None"
}

Example 2

using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    protected override void OnStart()
    {
        var progressBar = new ProgressBar
        {
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
            Width = 200,
            Height = 30,
            IsIndeterminate = true
        };

        Chart.AddControl(progressBar);
    }
}
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        progressBar = ProgressBar()
        progressBar.HorizontalAlignment = HorizontalAlignment.Center
        progressBar.VerticalAlignment = VerticalAlignment.Center
        progressBar.Width = 200
        progressBar.Height = 30
        progressBar.IsIndeterminate = True
        api.Chart.AddControl(progressBar)
{
  "AccessRights": "None"
}

Constructors

Name Description
ProgressBarDesktopCLICloud Initializes a new instance of the ProgressBar class.

Properties

Name Description
IsIndeterminateDesktopCLICloudbool Gets / sets whether the ProgressBar shows actual values or generic, continuous progress feedback.
MaximumDesktopCLIClouddouble Get / set progress bar maximum value amount if type is Determinate (default is 100).
MinimumDesktopCLIClouddouble Get / set progress bar minimum value amount if type is Determinate (default is 0).
ValueDesktopCLIClouddouble Get / set progress bar value amount if type is Determinate.

Inherited members

From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible