Example #1
0
 private void AddDataSource(DataSource initial_source, Color color)
 {
     float min_y = 0;
     float max_y = 0;
     if (is_sigmoid)
     {
         min_y = 0;
         max_y = 1;
     }
     if (is_hyperbolic)
     {
         min_y = -1;
         max_y = 1;
     }
     display.DataSources.Add(initial_source);
     initial_source.AutoScaleY = false;
     initial_source.SetGridDistanceY(100);
     initial_source.OnRenderYAxisLabel = RenderYLabel;
     initial_source.GraphColor = color;
     //            initial_source.AutoScaleY = true;
     initial_source.SetDisplayRangeY(min_y, max_y);
     initial_source.XAutoScaleOffset = 0;
 }
        // ------------------------------------------------------------------------------------------------------
        private void _addChannelGraph(EEGChannelBuffer buf)
        {
            DataSource ds = new DataSource();
            display.DataSources.Add(ds);
            ds.OnRenderXAxisLabel += _onRenderXLabel;
            ds.OnRenderYAxisLabel = _onRenderYLabel;
            ds.Name = buf.Name;
            ds.Length = (int)buf.Length;
            ds.XAutoScaleOffset = 0;

            ds.AutoScaleX = true;
            ds.AutoScaleY = false;

            ds.SetDisplayRangeY(-300, 300);
            ds.SetGridDistanceY(100);

            channelGraphs.Add(new ChannelGraph(ds, buf));
        }
Example #3
0
        private void initGraph()
        {
            CowabungaStrategy cowabunga = Backtester.Program.testCowabunga(@"C:\Users\Ralf\Desktop\talib_test\DAT_ASCII_EURGBP_M1_2015.csv");

            display.SetDisplayRangeX(0, 10);
            display.PanelLayout = PlotterGraphPaneEx.LayoutMode.NORMAL;

            DataSource closingPrices = new DataSource();
            closingPrices.Length = cowabunga.ticks.Length;
            //closingPrices.Samples = new cPoint[cowabunga.ticks.Length];
            closingPrices.Name = "Closing Prices";
            closingPrices.AutoScaleY = true;
            closingPrices.SetDisplayRangeY(0.6f, 0.8f);
            closingPrices.SetGridDistanceY(1);

            closingPrices.OnRenderXAxisLabel = RenderXLabel;
            closingPrices.OnRenderYAxisLabel = RenderYLabel;

            for (int i = 0; i < cowabunga.ticks.Length; i++)
            {
                Tick tick = cowabunga.ticks[i];

                closingPrices.Samples[i].x = i;
                closingPrices.Samples[i].y = (float)tick.closePrice;
            }

            DataSource ema75source = new DataSource();
            ema75source.Name = "EMA 75";

            //setupDataSource(ema75source, cowabunga.ema75);

            display.DataSources.Add(closingPrices);
            //display.DataSources.Add(ema75source);

            ResumeLayout();
            display.Refresh();
        }