Skip to content

MarketSessionChangedEventArgs

class cAlgo.API

DesktopCLICloud

The arguments for MarketSessionsChanged event.

Definition

public class MarketSessionChangedEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

protected override void OnStart()
{
    MarketSessionsChanged += OnMarketSessionsChanged;
}

private void OnMarketSessionsChanged(MarketSessionChangedEventArgs args)
{
    Print("Market sessions changed from {0} to {1}", args.PreviousSessions, args.NewSessions);
}
def on_start(self):
    api.MarketSessionsChanged += self.on_market_sessions_changed

def on_market_sessions_changed(self, args):
    api.Print(f"Market sessions changed from {args.PreviousSessions} to {args.NewSessions}")

Properties

Name Description
NewSessionsDesktopCLICloudMarketSession All current sessions including any new sessions that have just begun. The value of NewSessions is always equal to the value of the MarketSessions property of a cBot / indicator. Returns MarketSession.None if no new sessions started when the MarketSessionsChanged event was triggered.
PreviousSessionsDesktopCLICloudMarketSession Returns the previous value of the MarketSessions property before the MarketSessionsChanged event was triggered. Returns MarketSession.None if no previous sessions ended when the event was triggered.

See also