Beispiel #1
0
        //After CLose time set hard stop losses at last position entry price with Buffer
        override protected bool ExcuteRuleLogic()
        {
            if (MarketInfo.IsBotTradingOpen())
            {
                //SellLimitOrdersTrader.SetBollingerBandDefault(Bot.MarketData.GetSeries());

                //Price moves TriggerOrderPlacementPips UP from open then look to set SELL LimitOrders
                if (BotState.OpenPrice + SellLimitOrdersTrader.EntryTriggerOrderPlacementPips < Bot.Symbol.Bid)
                {
                    if (SellLimitOrdersTrader.IsOutSideBollingerBand())
                    {
                        SellLimitOrdersTrader.PlaceSellLimitOrders();
                        BotState.OrdersPlaced = true;
                        ExecuteOnceOnly();
                        return(true);
                    }
                }
                //Price moves 5pts DOWN from open then look to set BUY LimitOrders
                else if (BotState.OpenPrice - BuyLimitOrdersTrader.EntryTriggerOrderPlacementPips > Bot.Symbol.Ask)
                {
                    if (BuyLimitOrdersTrader.IsOutSideBollingerBand())
                    {
                        BuyLimitOrdersTrader.PlaceBuyLimitOrders();
                        BotState.OrdersPlaced = true;
                        ExecuteOnceOnly();
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #2
0
 //Get the Opening price for the trading period
 override protected bool ExcuteRuleLogic()
 {
     if (BotState.IsOpenTime)
     {
         //Price moves TriggerOrderPlacementPips UP from open then look to set SELL LimitOrders
         if (BotState.OpenPrice + SellLimitOrdersTrader.EntryTriggerOrderPlacementPips < Bot.Symbol.Bid)
         {
             SellLimitOrdersTrader.PlaceSellLimitOrders();
             BotState.OrdersPlaced = true;
             ExecuteOnceOnly();
             return(true);
         }
         //Price moves 5pts DOWN from open then look to set BUY LimitOrders
         else if (BotState.OpenPrice - BuyLimitOrdersTrader.EntryTriggerOrderPlacementPips > Bot.Symbol.Ask)
         {
             BuyLimitOrdersTrader.PlaceBuyLimitOrders();
             BotState.OrdersPlaced = true;
             ExecuteOnceOnly();
             return(true);
         }
     }
     return(false);
 }