Skip to content

TicksTickEventArgs

Summary

Provides data for the tick event.

Signature

1
public class TicksTickEventArgs

Namespace

cAlgo.API

Properties

Name Description
Ticks { get; } Gets the Ticks data.

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 += Ticks_Tick;
         }
         private void Ticks_Tick(TicksTickEventArgs obj)
         {
             // Printing Last tick inside Ticks collection
             Print(obj.Ticks.LastTick);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also


Last update: July 1, 2022

Comments