CGC_Codes

abstractStrategy

Jun 7th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using QuantSys.Analytics.Timeseries.Indicators.Abstraction;
  3. using QuantSys.MarketData;
  4. using QuantSys.TradeEngine.AccountManagement;
  5.  
  6. namespace QuantSys.TradeEngine.Strategy
  7. {
  8.     public abstract class AbstractStrategy
  9.     {
  10.         public const double DEFAULT_LOT_SIZE = 10000;
  11.  
  12.  
  13.         public Dictionary<string, AbstractIndicator> indicatorList;
  14.         public Dictionary<string, AbstractChannel> channelList;
  15.  
  16.         public bool IsLive { get; set; }
  17.  
  18.         protected IAccountManager IAccountManager;
  19.        
  20.         public void SetAccountManager(IAccountManager am)
  21.         {
  22.             this.IAccountManager = am;
  23.         }
  24.         public AbstractStrategy()
  25.         {
  26.             indicatorList = new Dictionary<string, AbstractIndicator>();
  27.         }
  28.  
  29.         protected void AttachIndicator(string indicatorName, AbstractIndicator i)
  30.         {
  31.             indicatorList.Add(indicatorName, i);
  32.         }
  33.  
  34.         protected void AttachChannel(string indicatorName, AbstractChannel i)
  35.         {
  36.             channelList.Add(indicatorName, i);
  37.         }
  38.  
  39.         public abstract void OnTick(params Tick[] t);
  40.  
  41.        
  42.  
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment