Skip to content

MarketSession

Summary

Represents the predefined market sessions.

Signature

1
public enum MarketSession

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.Robots
 {
     [Robot(AccessRights = AccessRights.FullAccess)]
     public class Test : Robot
     {
         [Parameter("Working Session", DefaultValue = MarketSession.London)]
         public MarketSession WorkingSession {get; set;}
         protected override void OnStart()
         {                       
             Print($"Current Sessions: {MarketSessions}");
         }
         protected override void OnTick()
         {
             if (!MarketSessions.HasFlag(WorkingSession))
                 return;
             // Do something on WorkingSession only
             Print("It's working session");
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 import clr
 clr.AddReference("cAlgo.API")
 # Import cAlgo API types
 from cAlgo.API import *
 # Import trading wrapper functions
 from robot_wrapper import *
 class Test():
     def on_start(self):
         print(f"Current Sessions: {api.MarketSessions}")
     def on_tick(self):
         # WorkingSession is a parameter of type MarketSession defined in C# file of cBot
         if api.MarketSessions.HasFlag(api.WorkingSession) == False:
             return
         # Do something on WorkingSession only
         print("It's working session")

Fields

None

Summary

None

Signature

1
MarketSession.None;

Return Value

MarketSession

Wellington

Summary

Wellington

Signature

1
MarketSession.Wellington;

Return Value

MarketSession

Tokyo

Summary

Tokyo

Signature

1
MarketSession.Tokyo;

Return Value

MarketSession

Sydney

Summary

Sydney

Signature

1
MarketSession.Sydney;

Return Value

MarketSession

Singapore

Summary

Singapore

Signature

1
MarketSession.Singapore;

Return Value

MarketSession

Frankfurt

Summary

Frankfurt

Signature

1
MarketSession.Frankfurt;

Return Value

MarketSession

London

Summary

London

Signature

1
MarketSession.London;

Return Value

MarketSession

NewYork

Summary

NewYork

Signature

1
MarketSession.NewYork;

Return Value

MarketSession