示例#1
0
 protected override void Create()
 {
     m_AverageFC = new AverageFC(this);
     m_MACrossLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MACrossLE", EOrderAction.Buy));
     m_Counter = new VariableObject <int>(this);
 }
 protected override void Create(){
     m_mypercentr = new VariableSeries<Double>(this);
     m_avg = new VariableSeries<Double>(this);
     m_PctRLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PctRLE", EOrderAction.Buy));
     m_setupl = new VariableObject<bool>(this);
 }
示例#3
0
 protected override void Create()
 {
     m_PivotHighVS = new PivotHighVS(this);
     m_PivExtSE    =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PivExtSE",
                                                         EOrderAction.SellShort));
 }
 protected override void Create(){
     m_AverageFC = new AverageFC(this);
     m_MACrossSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MACrossSE",
                                                               EOrderAction.SellShort));
     m_Counter = new VariableObject<int>(this);
 }
 protected override void Create(){
     m_AverageFC = new AverageFC(this);
     m_Avg = new VariableSeries<Double>(this);
     m_MACrossSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MACrossSX",
                                                               EOrderAction.BuyToCover, OrderExit.FromAll));
 }
示例#6
0
 protected override void Create()
 {
     m_RSI   = new RSI(this);
     m_myrsi = new VariableSeries <Double>(this);
     m_RsiLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "RsiLE", EOrderAction.Buy));
 }
示例#7
0
        protected override void Create()
        {
            // In this method we create orders and functions, required for further signal functioning
            buy_order  = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, "Long", EOrderAction.Buy));
            sell_order = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, "Short", EOrderAction.SellShort));

            m_RSI = new RSI(this);
        }
 protected override void Create()
 {
     m_AverageFC = new AverageFC(this);
     m_Avg       = new VariableSeries <Double>(this);
     m_MACrossSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MACrossSX",
                                                         EOrderAction.BuyToCover, OrderExit.FromAll));
 }
 protected override void Create(){
     m_MP = new VariableSeries<int>(this);
     m_PftClsSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PftClsSX",
                                                               EOrderAction.BuyToCover, OrderExit.FromAll));
     m_EntryPrice = new VariableObject<double>(this);
     m_cnt = new VariableObject<int>(this);
 }
 protected override void Create(){
     m_FastAverageFC = new AverageFC(this);
     m_MedAverageFC = new AverageFC(this);
     m_SlowAverageFC = new AverageFC(this);
     m_Cond = new VariableSeries<Boolean>(this);
     m_MA3CrsLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MA3CrsLE", EOrderAction.Buy));
 }
示例#11
0
 protected override void Create()
 {
     m_mypercentr = new VariableSeries <Double>(this);
     m_avg        = new VariableSeries <Double>(this);
     m_PctRLE     =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PctRLE", EOrderAction.Buy));
     m_setupl = new VariableObject <bool>(this);
 }
 protected override void Create(){
     m_ConsUpLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "ConsUpLE", EOrderAction.Buy));
     m_ConsDnSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "ConsDnSE",
                                                               EOrderAction.SellShort));
     m_ups_cnt = new VariableObject<int>(this);
     m_downs_cnt = new VariableObject<int>(this);
 }
示例#13
0
 protected override void Create()
 {
     m_MACD      = new MACD(this);
     m_XAverage  = new XAverage(this);
     m_my_MACD   = new VariableSeries <Double>(this);
     m_MACD_diff = new VariableSeries <Double>(this);
     m_MacdLE    =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MacdLE", EOrderAction.Buy));
 }
 protected override void Create(){
     m_FastAverageFC = new AverageFC(this);
     m_SlowAverageFC = new AverageFC(this);
     m_FastAvg = new VariableSeries<Double>(this);
     m_SlowAvg = new VariableSeries<Double>(this);
     m_MA2CrossSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MA2CrossSE",
                                                               EOrderAction.SellShort));
 }
 protected override void Create()
 {
     m_FastAverageFC = new AverageFC(this);
     m_SlowAverageFC = new AverageFC(this);
     m_FastAvg       = new VariableSeries <Double>(this);
     m_SlowAvg       = new VariableSeries <Double>(this);
     m_MA2CrossLE    =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MA2CrossLE", EOrderAction.Buy));
 }
示例#16
0
		protected override void Create() {
			// 初始化下單物件,Contracts.UserSpecified 可指定規模,OrderExit.FromAll 可一次全平
			BUY = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy, OrderExit.FromAll));
			SELL = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort, OrderExit.FromAll));
			BUY_C = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
			SELL_C = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));

			__cKD = new KD(this);
		}
 protected override void Create()
 {
     m_MP       = new VariableSeries <int>(this);
     m_PftClsSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PftClsSX",
                                                         EOrderAction.BuyToCover, OrderExit.FromAll));
     m_EntryPrice = new VariableObject <double>(this);
     m_cnt        = new VariableObject <int>(this);
 }
 protected override void Create()
 {
     m_MACD = new MACD(this);
     m_XAverage = new XAverage(this);
     m_my_MACD = new VariableSeries<Double>(this);
     m_MACD_diff = new VariableSeries<Double>(this);
     m_MacdSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MacdSE",
                                                         EOrderAction.SellShort));
 }
示例#19
0
        protected override void Create()
        {
            long_order        = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
            short_order       = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.SellShort));
            close_long_order  = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
            close_short_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));

            current_regression = new LinearRegValue(this);
            deviation          = new VariableSeries <double>(this);
        }
        protected override void Create()
        {
            buy       = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
            sellshort = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));

            sell        = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
            buytocover  = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));
            sell2       = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Sell));
            buytocover2 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.BuyToCover));
        }
 protected override void Create()
 {
     buyOrder  = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
     sellOrder = OrderCreator.MarketThisBar(new SOrderParameters(EOrderAction.Sell));
     cutlersRSIIndicatorMathDown = new CutlersRSIIndicatorMath(this, 1);
     cutlersRSIIndicatorMathFlat = new CutlersRSIIndicatorMath(this, 1);
     cutlersRSIIndicatorMathUp   = new CutlersRSIIndicatorMath(this, 1);
     xAverageLong  = new XAverageThatWorks(this, 1);
     xAverageShort = new XAverageThatWorks(this, 1);
 }
示例#22
0
 protected override void Create()
 {
     //buyOrder = OrderCreator.Limit(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
     buyOrderMarket   = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));           // we need "Default" in order for MM Signal to work
     sellOrderRsi     = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "RSI Exit", EOrderAction.Sell, OrderExit.FromAll));
     sellOrderCutLoss = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "Cut Loss Exit", EOrderAction.Sell, OrderExit.FromAll));
     rsi = new RSI(this);
     kRatioBarsMathShort = new K_RatioBarsMath(this);
     kRatioBarsMathLong  = new K_RatioBarsMath(this);
 }
 protected override void Create()
 {
     m_ConsUpLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "ConsUpLE", EOrderAction.Buy));
     m_ConsDnSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "ConsDnSE",
                                                         EOrderAction.SellShort));
     m_ups_cnt   = new VariableObject <int>(this);
     m_downs_cnt = new VariableObject <int>(this);
 }
 protected override void Create()
 {
     m_FastAverageFC = new AverageFC(this);
     m_MedAverageFC  = new AverageFC(this);
     m_SlowAverageFC = new AverageFC(this);
     m_Cond          = new VariableSeries <Boolean>(this);
     m_MA3CrsSE      =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "MA3CrsSE",
                                                         EOrderAction.SellShort));
 }
 protected override void Create()
 {
     m_Stochastic = new Stochastic(this);
     m_oFastK     = new VariableSeries <Double>(this);
     m_oFastD     = new VariableSeries <Double>(this);
     m_oSlowK     = new VariableSeries <Double>(this);
     m_oSlowD     = new VariableSeries <Double>(this);
     m_StochLE    =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "StochLE", EOrderAction.Buy));
 }
示例#26
0
        protected override void Create()
        {
            // create variable objects, function objects, order objects etc.
            buy_order   = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
            stop_loss   = OrderCreator.Stop(new SOrderParameters(Contracts.Default, "SL", EOrderAction.Sell));
            take_profit = OrderCreator.Limit(new SOrderParameters(Contracts.Default, "TP", EOrderAction.Sell));


            quotesBuffer   = new Queue <Quote>();
            strategyParams = new StrategyParams();
        }
示例#27
0
        protected override void Create()
        {
            Ratio         = new VariableSeries <double>(this);
            m_expAvgRatio = new XAverage(this);

            m_long  = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
            m_short = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));

            m_lx = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
            m_sx = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));
        }
示例#28
0
        protected override void Create()
        {
            BUY    = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
            SELL   = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));
            BUY_C  = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
            SELL_C = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));

            cText         = this.DrwText.Create(new ChartPoint(1, 50), "1234", true);
            cText.Size    = 13;
            cText.Color   = Color.Yellow;
            cText.BGColor = Color.Red;
            cText.SetFont(System.Drawing.FontStyle.Bold, true);
        }
        protected override void Create()
        {
            // create variable objects, function objects, order objects etc.
            spread_diff_func = new Function.Spread_Diff_Corrective_Function(this);

            long_order        = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
            close_long_order  = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
            short_order       = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.SellShort));
            close_short_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));

            enable_long           = true;
            enable_short          = true;
            first_difference      = false;
            liquidate_at_midpoint = true;
        }
        protected override void Create()
        {
            //create TA objects
            m_MA = new AverageFC(this);

            //orders
            m_BK =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BK", EOrderAction.Buy));
            m_SP =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SP", EOrderAction.Sell,
                                                                OrderExit.FromAll));
            m_SK =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SK",
                                                                EOrderAction.SellShort));
            m_BP =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BP",
                                                                EOrderAction.BuyToCover, OrderExit.FromAll));
        }
        protected override void Create()
        {
            momentum_fast = new VariableSeries <Double>(this);
            momentum_slow = new VariableSeries <Double>(this);

            long_order        = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
            short_order       = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.SellShort));
            close_long_order  = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
            close_short_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));

            enable_long  = true;
            enable_short = true;

            momentum_fast_length = 8;
            momentum_slow_length = 60;

            momentum_fast_offset = 1;
            momentum_slow_offset = 2;
        }
        protected override void Create()
        {

            //create TA objects
            m_MA = new AverageFC(this);

            //orders
            m_BK =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BK", EOrderAction.Buy));
            m_SP =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SP", EOrderAction.Sell,
                                                                      OrderExit.FromAll));
            m_SK =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SK",
                                                                      EOrderAction.SellShort));
            m_BP =
                OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BP",
                                                                      EOrderAction.BuyToCover, OrderExit.FromAll));
        }
示例#33
0
        protected override void Create()
        {
            current_regression = new LinearRegValue(this);
            past_regression    = new LinearRegValue(this);
            stdev     = new StandardDeviation(this);
            slope_roc = new VariableSeries <double>(this, regression_length);

            long_order        = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
            short_order       = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.SellShort));
            close_long_order  = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell));
            close_short_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover));

            enable_long  = true;
            enable_short = true;

            regression_length  = 250;
            bias_reset_zscore  = 0.25;
            take_profit_zscore = 0.85;
            zscore_multiple    = 10;

            trade_enabled = true;
        }
		private void CreateOrderService(Instrument buyBars, Instrument sellBars) {
			if(__cOrderService1 != null) {
				__cOrderService1.Dispose();
			}

#if __SIMULATE
			__cOrderService1 = OrderManager.Manager.CreateOrderService("Netwings.OrderService;Netwings.SimulateOrderService");
#else
			__cOrderService1 = OrderManager.Manager.CreateOrderService("Netwings.OrderService;Netwings.RealOrderService");
			SetPipeNumber(InputAttribute.GetParameters(__cOrderService1), 1, 1);

#endif
			__cOrderService1.onResponse += OrderService_onResponse;
			__cOrderService1.SetInstrument(buyBars);
			__cOrderService1.SetDefaultContracts(1);
			__cOrderService1.Initialize();

			IOrderCreator cOrderCreator1 = __cOrderService1 as IOrderCreator;
			__cBOrderO = cOrderCreator1.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, "CALL_BUY", EOrderAction.Buy, OrderExit.FromAll));
			__cBOrderC = cOrderCreator1.MarketThisBar(new SOrderParameters(Contracts.Default, "CALL_CLOSE", EOrderAction.Sell, OrderExit.FromAll));

			if (log.IsInfoEnabled) log.Info("[CreateOrderService] Set BUY \"Netwings.OrderService;Netwings.SimulateOrderService\" and create...");

			if(__cOrderService2 != null) {
				__cOrderService2.Dispose();
			}

#if __SIMULATE
			__cOrderService2 = OrderManager.Manager.CreateOrderService("Netwings.OrderService;Netwings.SimulateOrderService");
#else
			__cOrderService2 = OrderManager.Manager.CreateOrderService("Netwings.OrderService;Netwings.RealOrderService");
			SetPipeNumber(InputAttribute.GetParameters(__cOrderService2), 1, 2);
#endif
			__cOrderService2.onResponse += OrderService_onResponse;
			__cOrderService2.SetInstrument(sellBars);
			__cOrderService2.SetDefaultContracts(1);
			__cOrderService2.Initialize();

			IOrderCreator cOrderCreator2 = __cOrderService2 as IOrderCreator;
			__cSOrderO = cOrderCreator2.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, "PUT_SELL", EOrderAction.SellShort, OrderExit.FromAll));
			__cSOrderC = cOrderCreator2.MarketThisBar(new SOrderParameters(Contracts.Default, "PUT_CLOSE", EOrderAction.BuyToCover, OrderExit.FromAll));

			if (log.IsInfoEnabled) log.Info("[CreateOrderService] Set SELL \"Netwings.OrderService;Netwings.SimulateOrderService\" and create...");
		}
 protected override void Create(){
     m_RSI = new RSI(this);
     m_myrsi = new VariableSeries<Double>(this);
     m_RsiSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "RsiSE", EOrderAction.SellShort));
 }
示例#36
0
 protected override void Create()
 {
     // create variable objects, function objects, order objects etc.
     buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
     x         = new XAverageThatWorks(this);
 }
示例#37
0
 protected override void Create()
 {
     m_PivotLowVS = new PivotLowVS(this);
     m_PivExtLE   =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PivExtLE", EOrderAction.Buy));
 }
 protected override void Create(){
     m_CustomLX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "CustomLX", EOrderAction.Sell,
                                                               OrderExit.FromAll));
 }
 protected override void Create(){
     m_PivotHighVS = new PivotHighVS(this);
     m_PivExtSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PivExtSE",
                                                               EOrderAction.SellShort));
 }
 protected override void Create(){
     m_PivotLowVS = new PivotLowVS(this);
     m_PivExtLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "PivExtLE", EOrderAction.Buy));
 }
 protected override void Create()
 {
     buy       = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "LE", EOrderAction.Buy));
     sellshort = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "SE", EOrderAction.SellShort));
     barNumber = new VariableSeries <int>(this);
 }
示例#42
0
		protected override void Create() {
			// 初始化下單物件,Contracts.UserSpecified 可指定規模,OrderExit.FromAll 可一次全平
			BUY = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
			SELL = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));
			BUY_C = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
			SELL_C = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));
			__cBIAS = new BIAS(this, 2);
			__cBIAS.Length = 5;

			停損點數 *= 下單口數;
			基礎停利點 *= 下單口數;
			__cPrevDate = Bars.Time[0].AddDays(-1);

			IInstrument cBars = BarsOfData(2);
			int iIndex = -(cBars.FullSymbolData.Count - 1);

			log.InfoFormat("最新歷史KBars={0}", cBars.FullSymbolData.Time[iIndex].ToString("yyyy-MM-dd HH:mm:ss"));
			Output.WriteLine(string.Format("最新歷史KBars={0}", cBars.FullSymbolData.Time[iIndex].ToString("yyyy-MM-dd HH:mm:ss")));
		}
 protected override void Create(){
     m_KeyRevLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "KeyRevLE", EOrderAction.Buy));
 }
 protected override void Create(){
     m_InsBarSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "InsBarSE", EOrderAction.SellShort));
 }
 protected override void Create()
 {
     // create variable objects, function objects, order objects etc.
     spread_diff_func = new Function.Spread_Diff_Corrective_Function(this);
     buy_order        = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
 }
 protected override void Create(){
     m_TimeBarsSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "TimeBarsSX",
                                                               EOrderAction.BuyToCover, OrderExit.FromAll));
 }
 protected override void Create()
 {
     m_LossClsLX = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "LossClsLX", EOrderAction.Sell, OrderExit.FromAll));
 }
 protected override void Create() {
     // 初始化下單物件,Contracts.UserSpecified 可指定規模,OrderExit.FromAll 可一次全平
     多單 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
     多停 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
 }
示例#49
0
        protected override void Create() {
            // 初始化下單物件,Contracts.UserSpecified 可指定規模,OrderExit.FromAll 可一次全平,OrderExit.Total指定口數平倉
            多單 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
            空單 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));
            多停 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
            空停 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));
            多當沖 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
            空當沖 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));
            多隔沖 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
            空隔沖 = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));

            漲跌 = new VariableSeries<double>(this);
            漲跌幅 = new VariableSeries<double>(this);
            上影線 = new VariableSeries<double>(this);
            下影線 = new VariableSeries<double>(this);
            實體線 = new VariableSeries<double>(this);
            結算日集合 = new Dictionary<DateTime, bool>();
            順勢進場週間日集合 = new Dictionary<DayOfWeek, bool>();
            逆勢進場週間日集合 = new Dictionary<DayOfWeek, bool>();
            結算隔日進場月份集合 = new Dictionary<int, bool>();

            #region 初始化指標策略內部變數

            #endregion
        }
 protected override void Create()
 {
     m_OutBarSE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "OutBarSE",
                                                         EOrderAction.SellShort));
 }
示例#51
0
		protected override void Create() {
			// 初始化下單物件,Contracts.UserSpecified 可指定規模,OrderExit.FromAll 可一次全平
			多單 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.Buy));
			空單 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.UserSpecified, EOrderAction.SellShort));
			多沖 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.Sell, OrderExit.FromAll));
			空沖 = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, EOrderAction.BuyToCover, OrderExit.FromAll));

			__cService = OrderCreator as AbstractOrderService;

			__cTimer = new Timer(1);
			__cTimer.AutoReset = false;
			__cTimer.Elapsed += Timer_onElapsed;
			//__cTimer.Start();

			//bbb = BarsOfData(2);
			cBuilder.AppendLine("[F000]");

			__cKDSum = new VariableSeries<double>(this);

			__cMACD = new MACD(this);
			__cMACD.FastPeriod = 5;
			__cMACD.SlowPeriod = 10;
			__cMACD.MACDPeriod = 10;

			__cKD = new KD(this);
			__cKD.Length = 5;
		}
 protected override void Create()
 {
     m_CustomSX =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "CustomSX",
                                                         EOrderAction.BuyToCover, OrderExit.FromAll));
 }
 protected override void Create(){
     m_Stochastic = new Stochastic(this);
     m_oFastK = new VariableSeries<Double>(this);
     m_oFastD = new VariableSeries<Double>(this);
     m_oSlowK = new VariableSeries<Double>(this);
     m_oSlowD = new VariableSeries<Double>(this);
     m_StochLE =
         OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "StochLE", EOrderAction.Buy));
 }