Skip to content

BarsHistoryLoadedEventArgs

Summary

Provides data for the history loaded event.

Signature

1
public class BarsHistoryLoadedEventArgs

Namespace

cAlgo.API

Properties

Name Description
Bars { get; } Gets the bar objects data.
Count { get; } Gets the number of bars.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample indicator shows how to use BarsHistoryLoadedEventArgs
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class BarsHistoryLoadedEventArgsSample : Robot
     {
         protected override void OnStart()
         {
             Bars.HistoryLoaded += Bars_HistoryLoaded;
             // You can load more bars by calling this method or LoadMoreHistory
             Bars.LoadMoreHistoryAsync();
         }
         // This method will be called if you scroll left on your chart and load more data
         // Or if you call the Bars.LoadMoreHistory/LoadMoreHistoryAsync methods
         // BarsHistoryLoadedEventArgs has two properties
         // BarsHistoryLoadedEventArgs.Bars refers to the bars object that it's history is loaded
         // BarsHistoryLoadedEventArgs.Count gives you the number of bars that has been loaded
         private void Bars_HistoryLoaded(BarsHistoryLoadedEventArgs obj)
         {
             Print("Loaded Bars Count: {0}", obj.Count);
         }
     }
 }

See Also


Last update: December 5, 2022

Comments