Skip to content

TicksTickEventArgs

Summary

Provides data for the tick event.

Signature

1
public class TicksTickEventArgs

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
 using cAlgo.API;
 using cAlgo.API.Internals;
 namespace cAlgo
 {
     // This sample indicator shows how to use TicksTickEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class TicksTickEventArgsSample : 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);
             // Subscribing to upcoming ticks
             _ticks.Tick += OnTicksTick;
         }
         private void OnTicksTick(TicksTickEventArgs obj)
         {
             // Printing Last tick inside Ticks collection
             Print(obj.Ticks.LastTick);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 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)
         # Subscribing to upcoming ticks
         self.ticks.Tick += self.on_ticks_tick
     def on_ticks_tick(self, args):
         # Printing Last tick inside Ticks collection
         print(args.Ticks.LastTick)

See Also

Properties

Ticks

Summary

Gets the Ticks data.

Signature

1
public Ticks Ticks {get;}

Return Value

Ticks