Пример #1
0
 public void OnInitialize()
 {
     if (IsDebug)
     {
         Log.Debug("OnInitialize()");
     }
     Strategy.Drawing.Color = Color.Black;
     orders.buyMarket       = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyMarket.Type  = OrderType.BuyMarket;
     orders.sellMarket      = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellMarket.Type = OrderType.SellMarket;
     orders.buyStop         = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyStop.Type    = OrderType.BuyStop;
     orders.sellStop        = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellStop.Type   = OrderType.SellStop;
     orders.buyLimit        = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyLimit.Type   = OrderType.BuyLimit;
     orders.sellLimit       = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellLimit.Type  = OrderType.SellLimit;
     Strategy.AddOrder(orders.buyMarket);
     Strategy.AddOrder(orders.sellMarket);
     Strategy.AddOrder(orders.buyStop);
     Strategy.AddOrder(orders.sellStop);
     Strategy.AddOrder(orders.buyLimit);
     Strategy.AddOrder(orders.sellLimit);
 }
Пример #2
0
 public void OnInitialize()
 {
     if (IsTrace)
     {
         Log.Trace(Strategy.FullName + ".Initialize()");
     }
     Strategy.Drawing.Color           = Color.Black;
     orders.buyMarket                 = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyMarket.TradeDirection  = TradeDirection.Exit;
     orders.buyMarket.Type            = OrderType.BuyMarket;
     orders.sellMarket                = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellMarket.TradeDirection = TradeDirection.Exit;
     orders.sellMarket.Type           = OrderType.SellMarket;
     orders.buyStop                  = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyStop.Type             = OrderType.BuyStop;
     orders.buyStop.TradeDirection   = TradeDirection.Exit;
     orders.sellStop                 = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellStop.Type            = OrderType.SellStop;
     orders.sellStop.TradeDirection  = TradeDirection.Exit;
     orders.sellStop.Tag             = "ExitCommon";
     orders.buyLimit                 = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.buyLimit.Type            = OrderType.BuyLimit;
     orders.buyLimit.TradeDirection  = TradeDirection.Exit;
     orders.sellLimit                = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     orders.sellLimit.Type           = OrderType.SellLimit;
     orders.sellLimit.TradeDirection = TradeDirection.Exit;
     Strategy.AddOrder(orders.buyMarket);
     Strategy.AddOrder(orders.sellMarket);
     Strategy.AddOrder(orders.buyStop);
     Strategy.AddOrder(orders.sellStop);
     Strategy.AddOrder(orders.buyLimit);
     Strategy.AddOrder(orders.sellLimit);
     position = Strategy.Position;
 }
Пример #3
0
 public void OnInitialize()
 {
     marketOrder = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     marketOrder.TradeDirection = TradeDirection.ExitStrategy;
     marketOrder.Tag            = "ExitStrategy";
     Strategy.AddOrder(marketOrder);
     breakEvenBuyStopOrder = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     breakEvenBuyStopOrder.TradeDirection = TradeDirection.ExitStrategy;
     breakEvenBuyStopOrder.Type           = OrderType.BuyStop;
     breakEvenBuyStopOrder.Tag            = "ExitStrategy";
     Strategy.AddOrder(breakEvenBuyStopOrder);
     breakEvenSellStopOrder = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     breakEvenSellStopOrder.TradeDirection = TradeDirection.ExitStrategy;
     breakEvenSellStopOrder.Type           = OrderType.SellStop;
     breakEvenSellStopOrder.Tag            = "ExitStrategy";
     Strategy.AddOrder(breakEvenSellStopOrder);
     buyStopLossOrder = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     buyStopLossOrder.TradeDirection = TradeDirection.ExitStrategy;
     buyStopLossOrder.Type           = OrderType.BuyStop;
     buyStopLossOrder.Tag            = "ExitStrategy";
     Strategy.AddOrder(buyStopLossOrder);
     sellStopLossOrder = Factory.Engine.LogicalOrder(Strategy.Data.SymbolInfo, Strategy);
     sellStopLossOrder.TradeDirection = TradeDirection.ExitStrategy;
     sellStopLossOrder.Type           = OrderType.SellStop;
     sellStopLossOrder.Tag            = "ExitStrategy";
     Strategy.AddOrder(sellStopLossOrder);
     if (IsTrace)
     {
         Log.Trace(Strategy.FullName + ".Initialize()");
     }
     Strategy.Drawing.Color = Color.Black;
 }