Skip to content

UserTimeOffsetChangedEventArgs

Summary

Represents the user time offset change event data.

Signature

1
public class UserTimeOffsetChangedEventArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 using cAlgo.API;
 namespace cAlgo
 {
     // This example shows how to use the UserTimeOffsetChangedEventArgs
     // Change your cTrader platform time offset/zone to see the print message
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class UserTimeOffsetChangedEventArgsSample : Indicator
     {
         protected override void Initialize()
         {
             Application.UserTimeOffsetChanged += OnApplicationUserTimeOffsetChanged;
         }
         private void OnApplicationUserTimeOffsetChanged(UserTimeOffsetChangedEventArgs obj)
         {
             Print("User time offset changed to: {0}", obj.UserTimeOffset);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
1
2
3
4
5
6
7
8
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         api.Application.UserTimeOffsetChanged += self.on_application_user_time_offset_changed
     def on_application_user_time_offset_changed(self, args):
         print(f"User time offset changed to: {args.UserTimeOffset}")

See Also

Properties

UserTimeOffset

Summary

Gets the user time offset.

Signature

1
public TimeSpan UserTimeOffset {get;}

Return Value

TimeSpan