Skip to content

TimeFrame

Summary

Contains supported timeframe values.

Signature

1
public class TimeFrame

Namespace

cAlgo.API

Methods

Name Description
Equals Defines whether the specified object is equal to this instance.
GetHashCode Returns the hash code for this instance.
ToString Returns a System.String that represents this instance.
Parse It parses a string and if it matched to a timeframe name it returns that time frame otherwise it throws FormatException
TryParse It parses a string and if it matched to a timeframe name it sets it to the passed timeFrame parameter

Properties

Name Description
Name { get; } Returns the name of timeframe
ShortName { get; } Returns the short name of timeframe

Fields

Name Description
Tick Tick / t1
Tick2 Tick2 / t2
Tick3 Tick3 / t3
Tick4 Tick4 / t4
Tick5 Tick5 / t5
Tick6 Tick6 / t6
Tick7 Tick7 / t7
Tick8 Tick8 / t8
Tick9 Tick9 / t9
Tick10 Tick10 / t10
Tick15 Tick15 / t15
Tick20 Tick20 / t20
Tick25 Tick25 / t25
Tick30 Tick30 / t30
Tick40 Tick40 / t40
Tick50 Tick50 / t50
Tick60 Tick60 / t60
Tick80 Tick80 / t80
Tick90 Tick90 / t90
Tick100 Tick100 / t100
Tick150 Tick150 / t150
Tick200 Tick200 / t200
Tick250 Tick250 / t250
Tick300 Tick300 / t300
Tick500 Tick500 / t500
Tick750 Tick750 / t750
Tick1000 Tick1000 / t1000
Minute Minute / m1
Minute2 Minute2 / m2
Minute3 Minute3 / m3
Minute4 Minute4 / m4
Minute5 Minute5 / m5
Minute6 Minute6 / m6
Minute7 Minute7 / m7
Minute8 Minute8 / m8
Minute9 Minute9 / m9
Minute10 Minute10 / m10
Minute15 Minute15 / m15
Minute20 Minute20 / m20
Minute30 Minute30 / m30
Minute45 Minute45 / m45
Hour Hour / h1
Hour2 Hour2 / h2
Hour3 Hour3 / h3
Hour4 Hour4 / h4
Hour6 Hour6 / h6
Hour8 Hour8 / h8
Hour12 Hour12 / h12
Daily Daily / D1
Day2 Day2 / D2
Day3 Day3 / D3
Weekly Weekly / W1
Monthly Monthly / Month1
Renko1 Renko1 / Re1
Renko2 Renko2 / Re2
Renko3 Renko3 / Re3
Renko4 Renko4 / Re4
Renko5 Renko5 / Re5
Renko6 Renko6 / Re6
Renko7 Renko7 / Re7
Renko8 Renko8 / Re8
Renko9 Renko9 / Re9
Renko10 Renko10 / Re10
Renko15 Renko15 / Re15
Renko20 Renko20 / Re20
Renko25 Renko25 / Re25
Renko30 Renko30 / Re30
Renko35 Renko35 / Re35
Renko40 Renko40 / Re40
Renko45 Renko45 / Re45
Renko50 Renko50 / Re50
Renko100 Renko100 / Re100
Renko150 Renko150 / Re150
Renko200 Renko200 / Re200
Renko300 Renko300 / Re300
Renko500 Renko500 / Re500
Renko800 Renko800 / Re800
Renko1000 Renko1000 / Re1000
Renko2000 Renko2000 / Re2000
Range1 Range1 / Ra1
Range2 Range2 / Ra2
Range3 Range3 / Ra3
Range4 Range4 / Ra4
Range5 Range5 / Ra5
Range8 Range8 / Ra8
Range10 Range10 / Ra10
Range20 Range20 / Ra20
Range30 Range30 / Ra30
Range50 Range50 / Ra50
Range80 Range80 / Ra80
Range100 Range100 / Ra100
Range150 Range150 / Ra150
Range200 Range200 / Ra200
Range300 Range300 / Ra300
Range500 Range500 / Ra500
Range800 Range800 / Ra800
Range1000 Range1000 / Ra1000
Range2000 Range2000 / Ra2000
Range5000 Range5000 / Ra5000
Range7500 Range7500 / Ra7500
Range10000 Range10000 / Ra10000
HeikinMinute HeikinMinute / Hm1
HeikinMinute2 HeikinMinute2 / Hm2
HeikinMinute3 HeikinMinute3 / Hm3
HeikinMinute4 HeikinMinute4 / Hm4
HeikinMinute5 HeikinMinute5 / Hm5
HeikinMinute6 HeikinMinute6 / Hm6
HeikinMinute7 HeikinMinute7 / Hm7
HeikinMinute8 HeikinMinute8 / Hm8
HeikinMinute9 HeikinMinute9 / Hm9
HeikinMinute10 HeikinMinute10 / Hm10
HeikinMinute15 HeikinMinute15 / Hm15
HeikinMinute20 HeikinMinute20 / Hm20
HeikinMinute30 HeikinMinute30 / Hm30
HeikinMinute45 HeikinMinute45 / Hm45
HeikinHour HeikinHour / Hh1
HeikinHour2 HeikinHour2 / Hh2
HeikinHour3 HeikinHour3 / Hh3
HeikinHour4 HeikinHour4 / Hh4
HeikinHour6 HeikinHour6 / Hh6
HeikinHour8 HeikinHour8 / Hh8
HeikinHour12 HeikinHour12 / Hh12
HeikinDaily HeikinDaily / HD1
HeikinDay2 HeikinDay2 / HD2
HeikinDay3 HeikinDay3 / HD3
HeikinWeekly HeikinWeekly / HW1
HeikinMonthly HeikinMonthly / HMonth1

Examples

1
2
 if (TimeFrame  < TimeFrame.Daily)
     Print("Intraday Trading");
 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
 {
     // This sample indicator shows how to get a time frame from user via parameters and the get that time frame bars
     // Also you can use the pre-defined time frames
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class TimeFrameSample : Indicator
     {
         // Getting time frame via a parameter from user
         [Parameter("Time Frame", DefaultValue = "Daily")]
         public TimeFrame UserSelectedTimeFrame { get; set; }
         protected override void Initialize()
         {
             Print("Name: ", UserSelectedTimeFrame.Name, " | Short Name: ", UserSelectedTimeFrame.ShortName);
             // Getting another time frame bars data, using user selected time frame
             var barsBasedOnUserSelectedTimeFrame = MarketData.GetBars(UserSelectedTimeFrame);
             // Getting another time frame bars data, using pre-defined TimeFrames
             var barsBasedOnOtherTimeFrame = MarketData.GetBars(TimeFrame.Day2);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Last update: December 5, 2022

Comments