Skip to content

Watchlists

Summary

Represents the Watchlists interface - allows getting all the watchlists and symbols in them, and receiving the relevant events.

Signature

1
public abstract interface Watchlists

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 using cAlgo.API;
 using System.Linq;
 namespace cAlgo
 {
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class WatchlistSample : Indicator
     {
         protected override void Initialize()
         {
             Print("Number of Watchlists: ", Watchlists.Count());
             foreach (var watchlist in Watchlists)
             {
                 Print("Watchlist Name: {0} | Symbols #: {1}", watchlist.Name, watchlist.SymbolNames.Count);
             }
         }
         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):
         print(f"Number of Watchlists: {len(list(api.Watchlists))}")
         for watchlist in api.Watchlists:
             print(f"Watchlist Name: {watchlist.Name} | Symbols #: {watchlist.SymbolNames.Count}")

See Also

Properties

Item

Signature

1
public abstract Watchlist Item {get;}

Return Value

Watchlist

Events

Added

Summary

Occurs when a new watchlist is added.

Signature

1
public abstract event Action<WatchlistAddedEventArgs> Added;

Removed

Summary

Occurs when a watchlist is removed.

Signature

1
public abstract event Action<WatchlistRemovedEventArgs> Removed;

WatchlistSymbolAdded

Summary

Occurs when a new symbol is added to the watchlist.

Signature

1
public abstract event Action<WatchlistSymbolAddedEventArgs> WatchlistSymbolAdded;

WatchlistSymbolRemoved

Summary

Occurs when a symbol is removed from the watchlist.

Signature

1
public abstract event Action<WatchlistSymbolRemovedEventArgs> WatchlistSymbolRemoved;

WatchlistRenamed

Summary

Occurs when the name of the watchlist is changed.

Signature

1
public abstract event Action<WatchlistRenamedEventArgs> WatchlistRenamed;