protected override void OnStrategyChanged()
        {
            base.OnStrategyChanged();
            TripleRsiIndicatorStrategy          s    = ((TripleRsiIndicatorStrategy)Strategy);
            List <TripleRsiStrategyHistoryItem> list = new List <TripleRsiStrategyHistoryItem>();

            if (s.RsiFastIndicator == null)
            {
                this.tripleRsiStrategyHistoryItemBindingSource.DataSource = list;
                return;
            }

            lock (s.RsiFastIndicator.Result) {
                lock (s.RsiMiddleIndicator.Result) {
                    lock (s.RsiSlowIndicator.Result) {
                        for (int i = 0; i < s.RsiFastIndicator.Count; i++)
                        {
                            TripleRsiStrategyHistoryItem item = new TripleRsiStrategyHistoryItem();
                            item.Time       = s.RsiFastIndicator.Result[i].Time;
                            item.RsiFast    = s.RsiFastIndicator.Result[i].Value;
                            item.RsiMiddle  = s.RsiMiddleIndicator.Result[i].Value;
                            item.RsiSlow    = s.RsiSlowIndicator.Result[i].Value;
                            item.TimeToBuy  = s.TimeToBuy(item.RsiFast, item.RsiMiddle, item.RsiSlow);
                            item.TimeToSell = s.TimeToSell(item.RsiFast, item.RsiMiddle, item.RsiSlow);
                            list.Add(item);
                        }
                    }
                }
            }

            this.tripleRsiStrategyHistoryItemBindingSource.DataSource = list;
        }
Exemple #2
0
        void comboBoxEdit1_EditValueChanged(object sender, EventArgs e)
        {
            TripleRsiIndicatorStrategy s    = (TripleRsiIndicatorStrategy)Strategy;
            CandleStickIntervalInfo    info = comboBoxEdit1.EditValue as CandleStickIntervalInfo;

            if (info != null)
            {
                s.CandleStickIntervalMin = (int)info.Interval.TotalMinutes;
            }
            else
            {
                s.CandleStickIntervalMin = (int)TimeSpan.FromHours(4).TotalMinutes;
            }
        }