Ejemplo n.º 1
0
 public BotWhithTwoTimeFrameUi(BotWhithTwoTimeFrame bot)
 {
     InitializeComponent();
     _painter = new ChartPainter("chart", bot.StartProgram);
     _painter.StartPaintPrimeChart(HostChart, Rectangle);
     _bot = bot;
 }
Ejemplo n.º 2
0
// управление

        /// <summary>
        /// начать прорисовывать данный чарт на окне
        /// </summary>
        public void StartPaint(WindowsFormsHost host, Rectangle rectangle)
        {
            try
            {
                ChartCandle.StartPaintPrimeChart(host, rectangle);
                ChartCandle.ProcessPositions(_myPosition);

                ChartCandle.ProcessCandles(_myCandles);

                for (int i = 0; _indicatorsCandles != null && i < _indicatorsCandles.Count; i++)
                {
                    ChartCandle.ProcessIndicator(_indicatorsCandles[i]);
                }

                for (int i = 0; _chartElements != null && i < _chartElements.Count; i++)
                {
                    ChartCandle.ProcessElem(_chartElements[i]);
                }

                ChartCandle.ClearAlerts(_alertArray);

                for (int i = 0; _alertArray != null && i < _alertArray.Count; i++)
                {
                    if (_alertArray[i].TypeAlert == AlertType.ChartAlert)
                    {
                        ChartCandle.PaintAlert((AlertToChart)_alertArray[i]);
                    }
                }
            }
            catch (Exception error)
            {
                SendErrorMessage(error);
            }
        }
Ejemplo n.º 3
0
        public PatternTraderUi(PatternTrader bot)
        {
            InitializeComponent();

            _bot = bot;

            _gridPatternsToOpen                   = new DataGridView();
            _gridPatternsToOpen.MouseClick       += _gridPatternsToOpen_MouseClick;
            _gridPatternsToOpen.CellValueChanged += _gridPatternsToOpen_CellValueChanged;

            _gridPatternsToClose                   = new DataGridView();
            _gridPatternsToClose.MouseClick       += _gridPatternsToClose_MouseClick;
            _gridPatternsToClose.CellValueChanged += _gridPatternsToClose_CellValueChanged;

            CreateGridPatternsGrid(_gridPatternsToOpen, HostGridPatternsToOpen);
            CreateGridPatternsGrid(_gridPatternsToClose, HostGridPatternToClose);

            _chartSingleOpenPattern = new ChartPainter("OpenSinglePattern");
            _chartSingleOpenPattern.IsPatternChart = true;
            _chartSingleClosePattern = new ChartPainter("CloseSinglePattern");
            _chartSingleClosePattern.IsPatternChart = true;

            _chartSingleOpenPattern.StartPaintPrimeChart(HostSinglePatternToOpen, new Rectangle());
            _chartSingleClosePattern.StartPaintPrimeChart(HostSinglePatternToClose, new Rectangle());

            InitializePrimeSettings();
            InitializePattarnsToOpenTab();
            InitializeTabClosePosition();

            PaintGridPatternsToOpen();
            PaintGridPatternsToClose();
            PaintClosePattern(0);
            PaintOpenPattern(0);
        }
Ejemplo n.º 4
0
        private void PaintActivTab(int tabNum)
        {
            if (_lastTabNum == tabNum)
            {
                return;
            }
            _lastTabNum = tabNum;

            if (_chart != null)
            {
                _chart.StopPaint();
                _chart.ClearDataPointsAndSizeValue();
                _chart.Delete();
            }


            if (tabNum < _panel.TabsSimple.Count)
            {
                _chart = new ChartPainter(_panel.NameStrategyUniq);
                _chart.ProcessCandles(_panel.TabsSimple[tabNum].CandlesFinishedOnly);
                _chart.StartPaintPrimeChart(ChartHostPanel, RectChart);
                _chart.ProcessPositions(_panel.TabsSimple[tabNum].PositionsAll);

                for (int i = 0; _panel.TabsSimple[tabNum].Indicators != null && i < _panel.TabsSimple[tabNum].Indicators.Count; i++)
                {
                    ChartArea area = _chart.CreateArea("Area" + _panel.TabsSimple[tabNum].Indicators[i].Name, 15);
                    _panel.TabsSimple[tabNum].Indicators[i].NameSeries = _chart.CreateSeries(area,
                                                                                             _panel.TabsSimple[tabNum].Indicators[i].TypeIndicator, _panel.TabsSimple[tabNum].Indicators[i].NameSeries);

                    _chart.ProcessIndicator(_panel.TabsSimple[tabNum].Indicators[i]);
                }
            }
            else
            {
                tabNum = tabNum - _panel.TabsSimple.Count;
                _chart = new ChartPainter(_panel.NameStrategyUniq);
                _chart.ProcessCandles(_panel.TabsIndex[tabNum].Candles);
                _chart.StartPaintPrimeChart(ChartHostPanel, RectChart);

                for (int i = 0; _panel.TabsIndex[tabNum].Indicators != null && i < _panel.TabsIndex[tabNum].Indicators.Count; i++)
                {
                    ChartArea area = _chart.CreateArea("Area" + _panel.TabsIndex[tabNum].Indicators[i].Name, 15);
                    _panel.TabsIndex[tabNum].Indicators[i].NameSeries = _chart.CreateSeries(area,
                                                                                            _panel.TabsIndex[tabNum].Indicators[i].TypeIndicator, _panel.TabsIndex[tabNum].Indicators[i].Name + i);

                    _chart.ProcessIndicator(_panel.TabsIndex[tabNum].Indicators[i]);
                }
            }
        }