Market Settings
Inheritance: System.Windows.Forms.Form
示例#1
0
        /// <summary>
        /// Edit the Trading Charges
        /// </summary>
        void EditTradingCharges()
        {
            Trading_Charges tradingCharges = new Trading_Charges();

            tradingCharges.Spread     = Data.InstrProperties.Spread;
            tradingCharges.SwapLong   = Data.InstrProperties.SwapLong;
            tradingCharges.SwapShort  = Data.InstrProperties.SwapShort;
            tradingCharges.Commission = Data.InstrProperties.Commission;
            tradingCharges.Slippage   = Data.InstrProperties.Slippage;
            tradingCharges.ShowDialog();

            if (tradingCharges.DialogResult == DialogResult.OK)
            {
                Data.InstrProperties.Spread     = tradingCharges.Spread;
                Data.InstrProperties.SwapLong   = tradingCharges.SwapLong;
                Data.InstrProperties.SwapShort  = tradingCharges.SwapShort;
                Data.InstrProperties.Commission = tradingCharges.Commission;
                Data.InstrProperties.Slippage   = tradingCharges.Slippage;

                Instruments.InstrumentList[Data.InstrProperties.Symbol] = Data.InstrProperties.Clone();

                Calculate(false);

                SetInstrumentDataStatusBar();
            }
            else if (tradingCharges.EditInstrument)
            {
                ShowInstrumentEditor();
            }

            return;
        }
        /// <summary>
        /// Edit the Trading Charges
        /// </summary>
        void EditTradingCharges()
        {
            Trading_Charges tradingCharges = new Trading_Charges();
            tradingCharges.Spread      = Data.InstrProperties.Spread;
            tradingCharges.SwapLong    = Data.InstrProperties.SwapLong;
            tradingCharges.SwapShort   = Data.InstrProperties.SwapShort;
            tradingCharges.Commission  = Data.InstrProperties.Commission;
            tradingCharges.Slippage    = Data.InstrProperties.Slippage;
            tradingCharges.ShowDialog();

            if (tradingCharges.DialogResult == DialogResult.OK)
            {
                Data.InstrProperties.Spread     = tradingCharges.Spread;
                Data.InstrProperties.SwapLong   = tradingCharges.SwapLong;
                Data.InstrProperties.SwapShort  = tradingCharges.SwapShort;
                Data.InstrProperties.Commission = tradingCharges.Commission;
                Data.InstrProperties.Slippage   = tradingCharges.Slippage;

                Instruments.InstrumentList[Data.InstrProperties.Symbol] = Data.InstrProperties.Clone();

                Calculate(false);

                SetInstrumentDataStatusBar();
            }
            else if (tradingCharges.EditInstrument)
                ShowInstrumentEditor();

            return;
        }