Skip to content

TimeFrames

Summary

Represents collection of all time frames including custom time frames.

Signature

1
public abstract interface TimeFrames

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 using cAlgo.API;
 using System.Linq;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public class TestExample : Robot
 {
     protected override void OnStart()
     {
         Print($"TimeFrames Count: {TimeFrames.Count()}");
         foreach (var timeFrame in TimeFrames)
         {
             Print($"Name: {timeFrame.Name}, ShortName: {timeFrame.ShortName}");
         }
         TimeFrames.Added += args => Print($"TimeFrames added: {string.Join(", ", args.TimeFrames.Select(timeFrame => timeFrame.Name))}");
         TimeFrames.Removed += args => Print($"TimeFrames removed: {string.Join(", ", args.TimeFrames.Select(timeFrame => timeFrame.Name))}");
     }
 }

See Also

Events

Added

Summary

Occurs when new TimeFrames are added.

Signature

1
public abstract event Action<TimeFramesAddedEventArgs> Added;

Removed

Summary

Occurs when TimeFrames are removed.

Signature

1
public abstract event Action<TimeFramesRemovedEventArgs> Removed;