Skip to content

TicksHistoryLoadedEventArgs

Summary

Provides data for the tick history loaded event.

Signature

1
public class TicksHistoryLoadedEventArgs

Namespace

cAlgo.API

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
25
26
27
28
29
30
31
32
33
34
 using cAlgo.API;
 using cAlgo.API.Internals;
 namespace cAlgo
 {
     // This sample indicator shows how to use TicksHistoryLoadedEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class Test : Indicator
     {
         private Ticks _ticks;
         [Parameter("Symbol Name", DefaultValue = "EURUSD")]
         public string InputSymbolName { get; set; }
         protected override void Initialize()
         {
             // Getting a symbol ticks data
             _ticks = MarketData.GetTicks(InputSymbolName);
             _ticks.HistoryLoaded += OnTicksHistoryLoaded;
             // You can also pass a callback method instead of subscribing to HistoryLoaded event
             //_ticks.LoadMoreHistoryAsync(OnTicksHistoryLoaded);
             _ticks.LoadMoreHistoryAsync();
             _ticks.Reloaded += OnTicksReloaded;
         }
         private void OnTicksReloaded(TicksHistoryLoadedEventArgs obj)
         {
             Print("Ticks got reloaded");
         }
         private void OnTicksHistoryLoaded(TicksHistoryLoadedEventArgs obj)
         {
             Print("New ticks loaded: #", obj.Count);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 from System import Action
 class Test():    
     def initialize(self):
         # Getting a symbol ticks data
         # InputSymbolName is a parameter of type string defined in C# file of indicator
         self.ticks = api.MarketData.GetTicks(api.InputSymbolName)
         self.ticks.HistoryLoaded += self.on_ticks_history_loaded
         # You can also pass a callback method instead of subscribing to HistoryLoaded event
         self.ticks.LoadMoreHistoryAsync(Action[TicksHistoryLoadedEventArgs](self.on_ticks_history_loaded))
         self.ticks.LoadMoreHistoryAsync()
         self.ticks.Reloaded += self.on_ticks_reloaded
     def on_ticks_history_loaded(self, args):
         print("New ticks loaded: #", args.Count)
     def on_ticks_reloaded(self, args):
         print("Ticks got reloaded")

See Also

Properties

Ticks

Summary

Gets the tick data.

Signature

1
public Ticks Ticks {get;}

Return Value

Ticks

Count

Summary

Gets the number of the ticks.

Signature

1
public int Count {get;}

Return Value

int