Skip to content

ToString Method

ToString

Summary

Returns a System.String that represents this instance.

Signature

1
public string ToString()

Return Value

string

Declaring Type

cAlgo.API.TimeFrame

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: March 23, 2023