예제 #1
0
 private void Executor_OnBarFinished(object sender, StrategyBarFinishedArguments arguments)
 {
     if (OnStrategyBarFinished != null)
     {
         OnStrategyBarFinished(sender, arguments);
     }
 }
예제 #2
0
        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;
            }
        }
예제 #3
0
 protected void DealBarFinishEvent(StrategyBarFinishedArguments barFinishedArguments)
 {
     if (OnBarFinished != null)
     {
         OnBarFinished(this, barFinishedArguments);
     }
 }
예제 #4
0
        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);
        }
예제 #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);
 }