Esempio n. 1
0
        internal _QuoteInfo(string exchangeName, string dataSource, string symbolId, string symbolName, double price)
        {
            this.SymbolId   = symbolId;
            this.SymbolName = symbolName;
            this.DataSource = dataSource;

            AbstractExchange        cExchange = ProductManager.Manager.GetExchange(exchangeName);
            AbstractProductProperty cProperty = cExchange.GetProperty(symbolId, dataSource);

            IPriceScale cPriceScale = null;

            if (cProperty != null)
            {
                cPriceScale = cProperty.PriceScaleRule as IPriceScale;
            }

            double[] dScales = new double[] { 1, 1 };
            if (cPriceScale != null)
            {
                dScales = cPriceScale.GetPriceScale(price);
            }

            string sScale = dScales[0].ToString();
            int    iIndex = sScale.IndexOf('.');

            if (iIndex > -1)
            {
                __iDecimals = sScale.Length - iIndex - 1;
            }
        }
Esempio n. 2
0
        /// <summary>
        ///   建構子
        /// </summary>
        /// <param name="setting">圖表座標軸設定檔</param>
        /// <param name="scale">價格縮放規則介面(可以由此規則取得價格座標與最小跳動點)</param>
        internal AxisY(AxisSetting setting, IPriceScale scale)
        {
            __cSetting    = setting;
            __cPriceScale = scale;

            __dAxisMax = double.MinValue;
            __dAxisMin = double.MaxValue;
        }
Esempio n. 3
0
		/// <summary>
		///   從目標價格資訊設定價格座標
		/// </summary>
		/// <param name="price">目標價格</param>
		public void SetPriceScaleFromClosePrice(double price) {
			double[] dValues = new double[] { 1, 1 };
			IPriceScale cPriceScale = __cProperty.PriceScaleRule as IPriceScale;
			if (cPriceScale != null) {
				dValues = cPriceScale.GetPriceScale(price);
			}
			
			__dPriceScale = dValues[0];  //價格座標
			__dMinValue = dValues[1];    //最小跳動單位
		}
Esempio n. 4
0
        protected static AxisY CreateAxisY(AbstractPaintEngine engine, AxisSetting axisSetting, IPriceScale scale, ChartProperty property, Rectangle axisRectangle)
        {
            AxisY cAxisY = new AxisY(axisSetting, scale);

            cAxisY.AxisRectangle = axisRectangle;
            cAxisY.FontMetrics   = engine.GetFontMetrics("0", property.AxisFont);
            return(cAxisY);
        }