void StockChartUC_Load(object sender, EventArgs e)
        {
            if (StockMarketView.defaultViewModel == null)
            {
                return;
            }

            stockBarCheckItem.ImageOptions.SvgImage                = SvgResources.GetSvgImage("Stock");
            candleStickBarCheckItem.ImageOptions.SvgImage          = SvgResources.GetSvgImage("Candles");
            volumesBarCheckItem.ImageOptions.SvgImage              = SvgResources.GetSvgImage("Bars");
            barCheckItem3.ImageOptions.SvgImage                    = SvgResources.GetSvgImage("6m");
            barCheckItem4.ImageOptions.SvgImage                    = SvgResources.GetSvgImage("1y");
            barCheckItem5.ImageOptions.SvgImage                    = SvgResources.GetSvgImage("1-5y");
            barCheckItem6.ImageOptions.SvgImage                    = SvgResources.GetSvgImage("2y");
            barCheckItem7.ImageOptions.SvgImage                    = SvgResources.GetSvgImage("4y");
            barCheckItemRemoveIndicator.ImageOptions.SvgImage      = SvgResources.GetSvgImage("Remove");
            barCheckItemTrendLine.ImageOptions.SvgImage            = SvgResources.GetSvgImage("TrendLine");
            barCheckItemFibonacciArcs.ImageOptions.SvgImage        = SvgResources.GetSvgImage("FibonacciArcs");
            barCheckItemFibonacciFans.ImageOptions.SvgImage        = SvgResources.GetSvgImage("FibonacciFans");
            barCheckItemFibonacciRetracement.ImageOptions.SvgImage = SvgResources.GetSvgImage("FibonacciRetracement");
            //StockMarketView.defaultViewModel.model.InitServer();
            OnPeriodChanged(barCheckItem7, null);
            for (int i = 0; i < 6; i++)
            {
                repositoryItemCheckedComboBoxEditAdvancedIndicators.Items[i].CheckState = CheckState.Checked;
            }

            barEditItemAdvancedIndicators.EditValue = "Default";
        }
        public SplashScreen1()
        {
            InitializeComponent();
            labelControl1.Text += DateTime.Now.Year.ToString();
            ISvgPaletteProvider palette = SvgPaletteHelper.GetSvgPalette(this.TargetLookAndFeel.ActiveLookAndFeel, DevExpress.Utils.Drawing.ObjectState.Normal);
            SvgImage            svg     = SvgResources.GetSvgImage("DX Logo");

            pictureBox1.Image = new SvgBitmap(svg).Render(palette);
            svg = SvgResources.GetSvgImage("App Logo");
            pictureBox2.Image = new SvgBitmap(svg).Render(palette);
        }
Exemple #3
0
        void StockWorkspacesUC_Load(object sender, EventArgs e)
        {
            if (StockMarketView.defaultViewModel == null)
            {
                return;
            }
            StockMarketView.defaultViewModel.CurrentPriceIndexChanged += defaultViewModel_CurrentPriceIndexChanged;
            StockMarketView.defaultViewModel.PropertyChanged          += defaultViewModel_PropertyChanged;
            //watchList
            watchListGridView.OptionsBehavior.AutoPopulateColumns         = false;
            watchListGridView.OptionsBehavior.CacheValuesOnRowUpdating    = CacheRowValuesMode.Disabled;
            watchListGrid.MainView.DataController.AllowIEnumerableDetails = false;
            watchListGridView.FocusRectStyle = XtraGrid.Views.Grid.DrawFocusRectStyle.None;
            watchListGrid.DataSource         = StockMarketView.defaultViewModel.WatchListBindingData;
            GridColumn col = watchListGridView.Columns.Add();

            col.FieldName = "CompanyName";
            col.Caption   = "Symbol";
            col.Visible   = true;
            col           = watchListGridView.Columns.Add();
            col.FieldName = "Price";
            col.Caption   = "Last Price";

            //col.ColumnEdit = new ArrowButtonRepositoryItem();
            col.DisplayFormat.FormatType   = FormatType.Numeric;
            col.DisplayFormat.FormatString = "c";
            col.Visible   = true;
            col           = watchListGridView.Columns.Add();
            col.FieldName = "Volume";
            col.DisplayFormat.FormatType   = FormatType.Numeric;
            col.DisplayFormat.FormatString = "n0";
            col.Visible   = true;
            col           = watchListGridView.Columns.Add();
            col.FieldName = "Volume Dynamics";
            RepositoryItemSparklineEdit rise = new RepositoryItemSparklineEdit();

            col.ColumnEdit  = rise;
            col.UnboundType = Data.UnboundColumnType.Object;
            AreaSparklineView view = new AreaSparklineView();

            view.HighlightMaxPoint = true;
            view.HighlightMinPoint = true;
            rise.View   = view;
            col.Visible = true;


            col           = watchListGridView.Columns.Add();
            col.FieldName = "Rise";
            col.Name      = "Rise";
            col.Visible   = false;

            //col = watchListGridView.Columns.Add();
            //col.FieldName = "TotalRise";
            //col.Name = "TotalRise";
            //col.Visible = false;


            //FormatConditionRuleIconSet val = new FormatConditionIconSetPositiveNegativeTriangles() { RangeDescription = "0, >0" };

            //watchListGridView.FormatRules.Add(new GridFormatRule() { Rule =   val, Column = watchListGridView.Columns["Rise"], ColumnApplyTo=watchListGridView.Columns[1]});
            var rule = watchListGridView.FormatRules.AddIconSetRule(watchListGridView.Columns["Rise"], new FormatConditionIconSetPositiveNegativeTriangles()
            {
                RangeDescription = "<0, 0, >0"
            });

            rule.ColumnApplyTo = watchListGridView.Columns[1];
            rule.Enabled       = true;


            watchListGridView.BestFitColumns();
            watchListGridView.FocusedRowChanged += new XtraGrid.Views.Base.FocusedRowChangedEventHandler(watchListGridView_FocusedRowChanged);
            //watchListGridView.CustomDrawCell += watchListGridView_CustomDrawCell;
            watchListGridView.CustomUnboundColumnData += watchListGridView_CustomUnboundColumnData;

            //chart
            stockChartUC.stockChart.Series["Price"].DataSource         = StockMarketView.defaultViewModel.StockChartBindingData;
            stockChartUC.stockChart.Series["Price"].ArgumentDataMember = "Date";
            stockChartUC.stockChart.Series["Price"].ValueDataMembers.AddRange(new string[] { "Low", "High", "Open", "Close" });

            stockChartUC.stockChart.Series["Volume"].DataSource         = StockMarketView.defaultViewModel.StockChartBindingData;
            stockChartUC.stockChart.Series["Volume"].ArgumentDataMember = "Date";
            stockChartUC.stockChart.Series["Volume"].ValueDataMembers.AddRange(new string[] { "Volume" });
            //volumeChart
            volumeChart.Series[0].DataSource          = StockMarketView.defaultViewModel.VolumeChartBindingData;
            volumeChart.Series[0].ArgumentDataMember  = "CompanyName";
            volumeChart.Series[0].ToolTipPointPattern = "Argument: {A}&#x0a;Value: {V}";
            volumeChart.Series[0].ValueDataMembers.AddRange(new string[] { "Volume" });

            //transationsGrid
            transactionGridView.OptionsBehavior.AutoPopulateColumns = false;
            transactionGrid.DataSource = StockMarketView.defaultViewModel.TransactionGridBindingData;
            var fceAsk = new FormatConditionRuleExpression()
            {
                Expression = "Ask > 0", PredefinedName = "Red Fill"
            };

            transactionGridView.FormatRules.AddRule(new GridFormatRule()
            {
                ApplyToRow = true, Rule = fceAsk
            });

            var fceBid = new FormatConditionRuleExpression()
            {
                Expression = "Bid > 0", PredefinedName = "Green Fill"
            };

            transactionGridView.FormatRules.AddRule(new GridFormatRule()
            {
                ApplyToRow = true, Rule = fceBid
            });

            StockMarketView.defaultViewModel.WatchListChanged += defaultViewModel_WatchListChanged;

            helpBarItemButton.ImageOptions.SvgImage  = SvgResources.GetSvgImage("Help");
            bbiSwatches.ImageOptions.SvgImage        = SvgResources.GetSvgImage("Swatches");
            bsiConnectedStatus.ImageOptions.SvgImage = SvgResources.GetSvgImage("Connected");
        }