コード例 #1
0
		public __OPTIONS_Signal(object _ctx) 
			: base(_ctx) {

			this.GapPoint = 0;
			__cList = new List<Report>(4096);
			__cExchange = ProductManager.Manager.GetExchange("TWSE");
		}
コード例 #2
0
		public __WEEK_OPTIONS_Signal(object _ctx) 
			: base(_ctx) {
			
			this.Range = 150;
			
			__cList = new List<Report[]>(4096);
			__cExchange = ProductManager.Manager.GetExchange("TWSE");

			__cTReports = new TotalReport[7];
			for (int i = 0; i < 7; i++) {
				__cTReports[i] = new TotalReport();
			}
		}
コード例 #3
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="request">InstrumentDataRequest類別</param>
		public InstrumentSettings(ref InstrumentDataRequest request) {
			AbstractExchange cExchange = ProductManager.Manager.GetExchange(request.Exchange);

			__sSymbolId = request.Symbol;
			__sExchange = request.Exchange;
			__sDataSource = request.DataFeed;
			
			__dTimeZone = cExchange.TimeZone;
			__cProduct = cExchange.GetProduct(__sSymbolId);
			__cProperty = cExchange.GetProperty(__sSymbolId, __sDataSource);

			//如果沒有商品資訊就使用 request.Symbol 第一個字元當作搜尋條件來取代
			if (__cProduct == null) {
				List<Product> cProducts = cExchange.SearchProducts(new string(__sSymbolId[0], 1), false);
				foreach (Product cProduct in cProducts) {
					AbstractProductProperty cProperty = cExchange.GetProperty(cProduct.SymbolId);
					if (cProperty != null) {
						__cProduct = cProduct;
						__cProperty = cProperty;
						break;
					}
				}
			}

			__cOptionType = __cProperty.GetCallOrPut(__cProduct);     //取得選擇權 Call or Put 類型
			__dStrikePrice = __cProperty.GetStrikePrice(__cProduct);  //取得選擇權履約價格
				
			//取得合約到期日索引值
			IContractTime cContractTime = __cProperty.ContractRule as IContractTime;
			if (cContractTime != null) {
				__iContractIndex = cContractTime.GetContractIndex(__sSymbolId);
			}

			this.Create(ref request);
			__cResolution = request.Resolution;
		}
コード例 #4
0
		public __WeekOption_Signal(object _ctx) 
			: base(_ctx) {
			
			this.Range = 100;
			this.GapPoint = 8;

			__cExchange = ProductManager.Manager.GetExchange("TWSE");
			__cDownloanTime = DateTime.Today.AddSeconds(55800);  //調整為今日15:30
		}
コード例 #5
0
ファイル: ProductManager.cs プロジェクト: Zeghs/ZeroSystem
		internal void AddExchange(AbstractExchange exchange) {
			string sShortName = exchange.ShortName;
			lock (__cKeys) {
				if (!__cKeys.ContainsKey(sShortName)) {
					int iIndex = __cExchanges.Count;
					__cExchanges.Add(exchange);
					__cKeys.Add(sShortName, iIndex);
				}
			}
		}
コード例 #6
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="exchange">交易所類別</param>
		/// <param name="products">商品資訊列表</param>
		public ProductInformation(AbstractExchange exchange, List<Product> products) {
			__cExchange = exchange;
			__cProducts = products;
		}