Example #1
0
 private void Executor_OnBarFinished(object sender, StrategyBarFinishedArguments arguments)
 {
     if (OnStrategyBarFinished != null)
     {
         OnStrategyBarFinished(sender, arguments);
     }
 }
        private void RealTimeReader_OnBar(object sender, IForwardOnBarArgument argument)
        {
            OnBar_ReferedStrategies(this.Strategy, argument);
            IKLineData_Extend mainKLineData = argument.MainBar.KLineData;

            if (this.strategyExecutorInfo != null)
            {
                this.strategyExecutorInfo.CurrentKLineData = mainKLineData;
            }
            if (HasBarFinishedEvent())
            {
                if (tempBarFinishedArguments == null)
                {
                    tempBarFinishedArguments = new StrategyBarFinishedArguments(this.strategyExecutorInfo);
                }
                DealBarFinishEvent(tempBarFinishedArguments);
            }
            if (HasDayFinishedEvent() && mainKLineData.IsDayEnd())
            {
                if (tempDayFinishedArguments == null)
                {
                    tempDayFinishedArguments = new StrategyDayFinishedArguments(this.strategyExecutorInfo);
                }
                DealDayFinishEvent(tempDayFinishedArguments);
            }

            this.strategyExecutorInfo.CurrentKLineData = mainKLineData;
            this.strategyExecutorInfo.CurrentDay       = mainKLineData.GetTradingTime().TradingDay;

            if (mainKLineData.IsDayStart())
            {
                this.strategyExecutorInfo.CurrentDayIndex++;
                //this.strategyExecutorInfo.CurrentDay = mainKLineData.GetTradingTime().TradingDay;
            }
        }
Example #3
0
 protected void DealBarFinishEvent(StrategyBarFinishedArguments barFinishedArguments)
 {
     if (OnBarFinished != null)
     {
         OnBarFinished(this, barFinishedArguments);
     }
 }
        private void InitStrategyExecutorInfo()
        {
            this.strategyExecutorInfo                 = new StrategyExecutorInfo(codePeriod, dataPackage.GetTradingDays().Count);
            this.strategyExecutorInfo.CurrentDay      = dataPackage.GetTradingDays()[0];
            this.strategyExecutorInfo.CurrentDayIndex = 0;

            this.tempBarFinishedArguments = new StrategyBarFinishedArguments(this.strategyExecutorInfo);
            this.tempDayFinishedArguments = new StrategyDayFinishedArguments(this.strategyExecutorInfo);
        }
Example #5
0
 private void Executor_OnBarFinished(object sender, StrategyBarFinishedArguments arguments)
 {
     //Console.WriteLine(arguments.ExecutorInfo.CurrentKLineData.GetCurrentBar() + " Finished");
 }
 private void Executor_OnBarFinished(object sender, StrategyBarFinishedArguments arguments)
 {
     DealBarFinishEvent(arguments);
 }