TimeFrame


Summary

Contains supported timeframe values.

Syntax

public class TimeFrame : Object, IEquatable

Members

NameTypeSummary
Daily Field
Day2 Field
Day3 Field
Equals Method
GetHashCode Method
Hour Field
Hour12 Field
Hour2 Field
Hour3 Field
Hour4 Field
Hour6 Field
Hour8 Field
Minute Field
Minute10 Field
Minute15 Field
Minute2 Field
Minute20 Field
Minute3 Field
Minute30 Field
Minute4 Field
Minute45 Field
Minute5 Field
Minute6 Field
Minute7 Field
Minute8 Field
Minute9 Field
Monthly Field
Name Property
Parse Method
Range1 Field
Range10 Field
Range100 Field
Range1000 Field
Range10000 Field
Range150 Field
Range2 Field
Range20 Field
Range200 Field
Range2000 Field
Range3 Field
Range30 Field
Range300 Field
Range4 Field
Range5 Field
Range50 Field
Range500 Field
Range5000 Field
Range7500 Field
Range8 Field
Range80 Field
Range800 Field
Renko1 Field
Renko10 Field
Renko100 Field
Renko15 Field
Renko2 Field
Renko20 Field
Renko25 Field
Renko3 Field
Renko30 Field
Renko35 Field
Renko4 Field
Renko40 Field
Renko45 Field
Renko5 Field
Renko50 Field
Renko6 Field
Renko7 Field
Renko8 Field
Renko9 Field
ShortName Property
Tick Field
Tick10 Field
Tick100 Field
Tick1000 Field
Tick15 Field
Tick150 Field
Tick2 Field
Tick20 Field
Tick200 Field
Tick25 Field
Tick250 Field
Tick3 Field
Tick30 Field
Tick300 Field
Tick4 Field
Tick40 Field
Tick5 Field
Tick50 Field
Tick500 Field
Tick6 Field
Tick60 Field
Tick7 Field
Tick750 Field
Tick8 Field
Tick80 Field
Tick9 Field
Tick90 Field
ToString Method
TryParse Method
Weekly Field

Example 1

if (TimeFrame  < TimeFrame.Daily)
    Print("Intraday Trading");

Example 2

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-defiend 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)
        {
        }
    }
}
Reference