Exemplo n.º 1
0
 public PercentRiskProfile(BaseStrategy strategy, double cashAccountEquity, double percentRisk, double maxLots) : base(strategy)
 {
     this.cashAccountEquity = cashAccountEquity;
     this.percentRisk       = percentRisk;
     this.maxLots           = maxLots;
     this.strategy          = strategy;
 }
        public override PlayerAction GetTurn(GetTurnContext context)
        {
            int opponentMoney = (this.startGameMoney * 2) - context.MyMoneyInTheRound - context.MoneyLeft;

            var getActionContext = new GetActionContext(
                context.PreviousRoundActions,
                this.currentGameStackStage,
                this.roundsActions,
                context.RoundType,
                this.FirstCard,
                this.SecondCard,
                this.CommunityCards,
                context.SmallBlind,
                context.MoneyLeft,
                opponentMoney,
                context.CurrentPot,
                context.CanCheck,
                this.Name);

            PlayerAction action = null;

            if (action == null)
            {
                action = BaseStrategy.GetPlayerAction(getActionContext);
            }

            if (action.Type == PlayerActionType.Raise && action.Money == context.MoneyLeft)
            {
                this.lastMyPushMoney = context.MoneyLeft - context.MyMoneyInTheRound;
            }

            return(action);
        }
Exemplo n.º 3
0
 public void SetStrategy(BaseStrategy Strategy)
 {
     Console.Strategy = Strat = Strategy as ProgrammerMode;
     LoadDocument();
     CreateWatcher();
     //throw new NotImplementedException();
 }
Exemplo n.º 4
0
        internal void addStrategy(string name, BaseStrategy strategy)
        {
            //策略去重
            if (mStrategyMap.ContainsKey(name))
            {
                return;
            }

            //交易接口
            if (mTdProvider != null)
            {
                strategy.TdProvider = mTdProvider;
            }

            //行情映射
            mStrategyMap.Add(name, strategy);
            string[] instIDs = strategy.OnLoadInstrument();
            foreach (string instID in instIDs)
            {
                HashSet <BaseStrategy> strategySet;
                if (!mInstIDStrategyMap.TryGetValue(instID, out strategySet))
                {
                    strategySet = new HashSet <BaseStrategy>();
                }
                strategySet.Add(strategy);
                mInstIDStrategyMap[instID] = strategySet;
            }

            //启动策略
            strategy.SendStart();
        }
Exemplo n.º 5
0
 public void SetStrategy(BaseStrategy Strategy)
 {
     if (Strategy is DoormatBot.Strategies.Fibonacci)
     {
         this.Strategy = Strategy as DoormatBot.Strategies.Fibonacci;
     }
 }
Exemplo n.º 6
0
    public override void Ready()
    {
        Body = (KinematicBody)parent.GetParent();

        // Make body able to collide with grass.
        Body.SetCollisionMaskBit(1, true);

        Area area = (Area)Body.GetNode("Area");

        // Body collides with layers 0 and 1. Having body's mask match area's layer when they overlap and the area gets removed causes a Godot bug,
        // so disable that.
        area.SetCollisionLayerBit(0, false);
        area.SetCollisionLayerBit(31, true);

        strategies    = new List <BaseStrategy>();
        eatStrategy   = new EatStrategy(this);
        breedStrategy = new BreedStrategy(this);
        strategies.Add(eatStrategy);
        strategies.Add(breedStrategy);

        state = null;

        parent.RegisterListener("terrainInterference", OnTerrainInterference);

        Body.AddToGroup("animals");
        Body.AddToGroup("alive");

        foreach (BaseStrategy strategy in strategies)
        {
            strategy.Ready();
        }

        terrain = parent.GetNode(Game.TERRAIN_PATH) as Terrain;
    }
Exemplo n.º 7
0
        public void ProcessRequest(HttpContext context)
        {
            var response = context.Response;

            switch (context.Request.HttpMethod)
            {
            case "GET":
                strategy = new ReturnMessage(_result);
                break;

            case "PUT":
                AddSessionIfNeeded(context);
                strategy = new PushStack(_result);
                break;

            case "POST":
                strategy = new EditResult(_result);
                break;

            case "DELETE":
                AddSessionIfNeeded(context);
                strategy = new PopStack(_result);
                break;

            default:
                response.Write("Something happened. Sorry");
                break;
            }

            _result = strategy.Execute(context);
        }
        public List <UFIDA.U9.Cust.JSDY.BarCode.CompleteApplyBarCodeDTO> Do()
        {
            BaseStrategy selector = Select();
            List <UFIDA.U9.Cust.JSDY.BarCode.CompleteApplyBarCodeDTO> result = (List <UFIDA.U9.Cust.JSDY.BarCode.CompleteApplyBarCodeDTO>)selector.Execute(this);

            return(result);
        }
 public void SetStrategy(BaseStrategy Strategy)
 {
     if (Strategy is DoormatBot.Strategies.DAlembert)
     {
         this.Strategy = Strategy as DoormatBot.Strategies.DAlembert;
     }
 }
        internal static void SetAndValidateValue(BaseStrategy strategy)
        {
            strategy.EffectiveValidityTriggerTime = new DateTime(strategy.ValidityTriggerDate.Year, strategy.ValidityTriggerDate.Month, strategy.ValidityTriggerDate.Day)
                .AddHours(strategy.ValidityTriggerHour)
                .AddMinutes(strategy.ValidityTriggerMinute)
                .AddSeconds(strategy.ValidityTriggerSecond);

            strategy.EffectiveStartOfSessionTime = new DateTime(strategy.ValidityTriggerDate.Year,
                                                                strategy.ValidityTriggerDate.Month,
                                                                strategy.ValidityTriggerDate.Day)
                .AddSeconds(PstSessionTimeConstants.StockExchangeStartTimeSeconds);

            if (strategy is BaseOpeningStrategy)
            {
                BaseOpeningStrategy opS = strategy as BaseOpeningStrategy;
                LoggingUtility.WriteInfo(strategy.LoggingConfig,
                                         string.Format(
                                             "Queued order to {0} {1} after {2} for a portfolio of {3:c} with {4} positions",
                                             opS.OrderSide,
                                             strategy.Instrument.Symbol,
                                             strategy.EffectiveValidityTriggerTime,
                                             opS.GrandTotalPortfolioAmount,
                                             opS.NumberOfPortfolioPositions));
            }
            else
            {

                LoggingUtility.WriteInfo(strategy.LoggingConfig,
                                         string.Format("Queued order to close {0} after {1}",
                                                       strategy.Instrument.Symbol,
                                                       strategy.EffectiveValidityTriggerTime));
            }

            LoggingUtility.WriteVerbose(strategy.LoggingConfig, "Completed basic initializationation");
        }
Exemplo n.º 11
0
        private void loadStrategy()
        {
            //获取文件列表
            string[] files = new string[] { };
            try
            {
                files = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory + "\\strategys");
            }
            catch (Exception ex)
            {
                LogUtils.EnginLog(ex.StackTrace);
            }

            //加载策略
            foreach (string f in files)
            {
                Assembly assembly = Assembly.LoadFrom(f);
                Type[]   types    = assembly.GetTypes();
                foreach (Type t in types)
                {
                    if (!t.IsSubclassOf(typeof(BaseStrategy)))
                    {
                        continue;
                    }

                    BaseStrategy stg = Activator.CreateInstance(t) as BaseStrategy;
                    if (stg == null)
                    {
                        continue;
                    }

                    addStrategy(t.Name, stg);
                }
            }
        }
Exemplo n.º 12
0
 public Position(BaseStrategy strategy, Instrument instrument, long vol, DateTime lastTime)
 {
     mStrategy   = strategy;
     mInstrument = instrument;
     mVol        = vol;
     mLastTime   = lastTime;
 }
Exemplo n.º 13
0
        public UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTO Do()
        {
            BaseStrategy selector = Select();

            UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTO result = (UFIDA.U9.Cust.Pub.WSLogBP.RequestResultDTO)selector.Execute(this);

            return(result);
        }
Exemplo n.º 14
0
        public System.Boolean Do()
        {
            BaseStrategy selector = Select();

            System.Boolean result = (System.Boolean)selector.Execute(this);

            return(result);
        }
Exemplo n.º 15
0
        public System.Int64 Do()
        {
            BaseStrategy selector = Select();

            System.Int64 result = (System.Int64)selector.Execute(this);

            return(result);
        }
Exemplo n.º 16
0
 public MACross(BaseStrategy strategy, int maPeriodFast, int maPeriodSlow, MA_METHOD methodFast, MA_METHOD methodSlow, int maShift) : this(strategy)
 {
     this.maPeriodFast = maPeriodFast;
     this.maPeriodSlow = maPeriodSlow;
     this.methodFast   = methodFast;
     this.methodSlow   = methodSlow;
     this.maShift      = maShift;
 }
Exemplo n.º 17
0
        public System.String Do()
        {
            BaseStrategy selector = Select();

            System.String result = (System.String)selector.Execute(this);

            return(result);
        }
Exemplo n.º 18
0
 public void _SetActiveState(BaseStrategy strategy)
 {
     if (state != null)
     {
         state.active = false;
     }
     state = strategy;
 }
Exemplo n.º 19
0
        public UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTO Do()
        {
            BaseStrategy selector = Select();

            UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTO result = (UFIDA.U9.Cust.JSDY.BarCode.OperatorsDTO)selector.Execute(this);

            return(result);
        }
 public void SetStrategy(BaseStrategy Strategy)
 {
     if (Strategy is DoormatBot.Strategies.Martingale mart)
     {
         this.Strategy = mart;
     }
     StartControl.DataContext = Strategy;
     OnPropertyChanged(nameof(Strategy));
 }
Exemplo n.º 21
0
        /// <summary>
        /// Runs the strategy and displays the results.
        /// </summary>
        /// <param name="strategy">Strategy to be run./param>
        static void RunStrategy(BaseStrategy strategy)
        {
            Result result = strategy.RunTests();

            Console.WriteLine($"{strategy.Name}:");
            Console.WriteLine($"Average: {result.GetAverage()}");
            Console.WriteLine($"Maximum number of tries: {result.GetMax()}");
            Console.WriteLine($"Minimum number of tries: {result.GetMin()}\n");
        }
Exemplo n.º 22
0
        public void BaseStrategyTest()
        {
            var log = A.Fake<ILog>();
            var commandExecutor = A.Fake<ICommandExecutor>();
            var commandFabric = A.Fake<ICommandFabric>();

            var obj = new BaseStrategy(log, commandExecutor, commandFabric);

            Assert.IsNotNull(obj);
        }
Exemplo n.º 23
0
        public void runWithOpenEntrySellLeft()
        {
            IStrategy aStrategy = new BaseStrategy(new FixedRule(1), new FixedRule(3));
            var       trades    = manager.Run(aStrategy, OrderType.SELL, 0, 3).Trades;

            Assert.AreEqual(1, trades.Count);

            Assert.AreEqual(Order.sellAt(1, seriesForRun.GetBar(1).ClosePrice, Decimals.NaN), trades[0].GetEntry());
            Assert.AreEqual(Order.buyAt(3, seriesForRun.GetBar(3).ClosePrice, Decimals.NaN), trades[0].GetExit());
        }
Exemplo n.º 24
0
 public void SetStrategy(BaseStrategy Strategy)
 {
     if (Strategy is DoormatBot.Strategies.Labouchere)
     {
         this.Strategy = Strategy as DoormatBot.Strategies.Labouchere;
         Bets.Clear();
         if (this.Strategy != null && this.Strategy.BetList != null)
         {
             foreach (decimal x in this.Strategy?.BetList)
             {
                 Bets.Add(new LabBet {
                     Amount = x
                 });
             }
         }
         if (Bets.Count == 0)
         {
             Bets.Add(new LabBet {
                 Amount = 0.00000001m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000002m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000003m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000004m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000005m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000006m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000005m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000004m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000003m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000002m
             });
             Bets.Add(new LabBet {
                 Amount = 0.00000001m
             });
         }
         OnPropertyChanged(nameof(Bets));
         StartControl.DataContext = Strategy;
     }
 }
Exemplo n.º 25
0
 public Order(BaseStrategy strategy, Instrument instrument, DirectionType direction, double price, int volume)
 {
     this.mStrategy   = strategy;
     this.mInstrument = instrument;
     this.mDirection  = direction;
     this.mPrice      = price;
     this.mOrderTime  = DateTime.Now;
     this.mVolume     = volume;
     this.mVolumeLeft = volume;
     this.mStatus     = OrderStatus.Normal;
 }
Exemplo n.º 26
0
 public void SetStrategy(BaseStrategy Strategy)
 {
     if (Strategy is DoormatBot.Strategies.PresetList lst)
     {
         this.Strategy = lst;
     }
     this.DataContext         = this;
     StartControl.DataContext = this.Strategy;
     OnPropertyChanged(nameof(this.Strategy));
     tvBets.BestFitColumns();
 }
Exemplo n.º 27
0
        internal static void SetAndValidateValue(BaseStrategy strategy)
        {
            if (strategy.MinAllowedSlippage > strategy.MaxAllowedSlippage)
                throw new ArithmeticException(
                    string.Format("Min Allowed Slippage {0} cannot be more than Max Allowed Slippage {1}",
                                  strategy.MinAllowedSlippage, strategy.MaxAllowedSlippage));

            double[] arr = new double[] { strategy.MaxAllowedSlippage, strategy.MinAllowedSlippage };
            double minSlip = arr.Min();
            double maxSlip = arr.Max();
            strategy.EffectiveMaxAllowedSlippage = maxSlip;
            strategy.EffectiveMinAllowedSlippage = minSlip;
        }
Exemplo n.º 28
0
        private void AddStrategyToListView(StrategyDesc sd)
        {
            BaseStrategy strategy = (BaseStrategy)StrategyManager.Instance.AddMyStrategy(sd.dllPath, sd.clazz);

            // BaseStrategy strategy = new Stock.Strategy.RotationB.RotationBStrategy();
            StrategyManager.Instance.AddMyStrategy(strategy);
            System.Windows.Forms.ListViewItem lvi = new System.Windows.Forms.ListViewItem(new string[] {
                sd.name,
                sd.desc
            }, -1);
            lvi.Group = this.listView1.Groups[sd.group];
            lvi.Tag   = strategy.Control;
            this.listView1.Items.Add(lvi);
        }
Exemplo n.º 29
0
        private void AddStrategyToListView(StrategyDesc sd)
        {
            BaseStrategy strategy = (BaseStrategy)DllUtils.CreateInstance <IStrategy>(sd.Dll, sd.Clazz);

            strategy.Id = sd.Id;
            strategy.Init();
            StrategyManager.Instance.AddMyStrategy(strategy);
            System.Windows.Forms.ListViewItem lvi = new System.Windows.Forms.ListViewItem(new string[] {
                sd.Name,
                sd.Desc
            }, -1);
            lvi.Group = this.listView1.Groups[sd.Group];
            lvi.Tag   = strategy.Control;
            this.listView1.Items.Add(lvi);
        }
Exemplo n.º 30
0
        public void SetUp(MonsterStats monsterStats, BaseStrategy strategy, MapGrid mapGrid, MapBlockManager mapBlockManager,
                          GameDamageManager gameDamageManager)
        {
            _monsterStats      = monsterStats;
            _strategy          = strategy;
            _mapGrid           = mapGrid;
            _mapBlockManager   = mapBlockManager;
            _gameDamageManager = gameDamageManager;

            currentState = ActiveState.Action;

            _hp           = _monsterStats.hp;
            _uniqueUnitID = gameObject.GetInstanceID();

            SetAnimator(monsterStats.animator);
        }
Exemplo n.º 31
0
        public void testStrategies()
        {
            PeriodicalGrowthRateIndicator gri = new PeriodicalGrowthRateIndicator(this.closePrice, 5);

            // Rules
            IRule buyingRule  = new CrossedUpIndicatorRule(gri, Decimals.ZERO);
            IRule sellingRule = new CrossedDownIndicatorRule(gri, Decimals.ZERO);

            IStrategy strategy = new BaseStrategy(buyingRule, sellingRule);

            // Check trades
            int result    = seriesManager.Run(strategy).GetTradeCount();
            int expResult = 3;

            Assert.AreEqual(expResult, result);
        }
Exemplo n.º 32
0
        public void runOnSeriesSlices()
        {
            ITimeSeries series = new MockTimeSeries(new decimal[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },
                                                    new DateTime[] {
                new DateTime(2000, 1, 1, 0, 0, 0, 0),
                new DateTime(2000, 1, 1, 0, 0, 0, 0),
                new DateTime(2001, 1, 1, 0, 0, 0, 0),
                new DateTime(2001, 1, 1, 0, 0, 0, 0),
                new DateTime(2002, 1, 1, 0, 0, 0, 0),
                new DateTime(2002, 1, 1, 0, 0, 0, 0),
                new DateTime(2002, 1, 1, 0, 0, 0, 0),
                new DateTime(2003, 1, 1, 0, 0, 0, 0),
                new DateTime(2004, 1, 1, 0, 0, 0, 0),
                new DateTime(2005, 1, 1, 0, 0, 0, 0)
            });

            manager.SetTimeSeries(series);

            IStrategy aStrategy = new BaseStrategy(new FixedRule(0, 3, 5, 7), new FixedRule(2, 4, 6, 9));

            var trades = manager.Run(aStrategy, 0, 1).Trades;

            Assert.AreEqual(1, trades.Count);
            Assert.AreEqual(Order.buyAt(0, series.GetBar(0).ClosePrice, Decimals.NaN), trades[0].GetEntry());
            Assert.AreEqual(Order.sellAt(2, series.GetBar(2).ClosePrice, Decimals.NaN), trades[0].GetExit());

            trades = manager.Run(aStrategy, 2, 3).Trades;
            Assert.AreEqual(1, trades.Count);
            Assert.AreEqual(Order.buyAt(3, series.GetBar(3).ClosePrice, Decimals.NaN), trades[0].GetEntry());
            Assert.AreEqual(Order.sellAt(4, series.GetBar(4).ClosePrice, Decimals.NaN), trades[0].GetExit());

            trades = manager.Run(aStrategy, 4, 6).Trades;
            Assert.AreEqual(1, trades.Count);
            Assert.AreEqual(Order.buyAt(5, series.GetBar(5).ClosePrice, Decimals.NaN), trades[0].GetEntry());
            Assert.AreEqual(Order.sellAt(6, series.GetBar(6).ClosePrice, Decimals.NaN), trades[0].GetExit());

            trades = manager.Run(aStrategy, 7, 7).Trades;
            Assert.AreEqual(1, trades.Count);
            Assert.AreEqual(Order.buyAt(7, series.GetBar(7).ClosePrice, Decimals.NaN), trades[0].GetEntry());
            Assert.AreEqual(Order.sellAt(9, series.GetBar(9).ClosePrice, Decimals.NaN), trades[0].GetExit());

            trades = manager.Run(aStrategy, 8, 8).Trades;
            Assert.IsTrue(trades.isEmpty());

            trades = manager.Run(aStrategy, 9, 9).Trades;
            Assert.IsTrue(trades.isEmpty());
        }
Exemplo n.º 33
0
        public static void ExecOnInit([In, Out, MarshalAs(UnmanagedType.LPWStr)] string CSharpFullTypeName)
        {
            try
            {
                Type type = Type.GetType(CSharpFullTypeName);
                strategy = (BaseStrategy)Activator.CreateInstance(type);

                getThreadPool().QueueWorkItem(OnInitThread);
            }
            catch (ArgumentNullException)
            {
                LOG.Error(String.Format("Strategy Class {0} not found", CSharpFullTypeName));
            }
            catch (Exception e)
            {
                LOG.Error(e);
            }
        }
        public static BaseQuantityCalculator GetCalculator(BaseStrategy strategy)
        {
            BaseQuantityCalculator returnVal = null;

            switch ((strategy as BaseOpeningStrategy).PositionSizingCalculationStrategy)
            {
                case PositionSizingCalculationStrategy.FixedAmount:
                    returnVal = new FixedAmountQuantityCalculator(strategy);
                    break;
                case PositionSizingCalculationStrategy.CalculatedBasedOnRiskAmount:
                    returnVal = new CalculatedBasedOnRiskAmountQuantityCalculator(strategy);
                    break;
                default:
                    throw new NotImplementedException();
            }

            return returnVal;
        }
Exemplo n.º 35
0
        void CreateParsingStrategy(
            CreateParserParams parserParams,
            TextStreamPositioningParams textStreamPositioningParams,
            StrategiesCache strategiesCache,
            out BaseStrategy strategy)
        {
            bool useMultithreadedStrategy;

            if (multithreadingDisabled)
            {
                useMultithreadedStrategy = false;
            }
            else if (!isSequentialReadingParser)
            {
                useMultithreadedStrategy = false;
            }
            else
            {
                useMultithreadedStrategy = HeuristicallyDetectWhetherMultithreadingMakesSense(parserParams, textStreamPositioningParams);
            }

            //useMultithreadedStrategy = false;

            Lazy <BaseStrategy> strategyToTryFirst;
            Lazy <BaseStrategy> strategyToTrySecond;

            if (useMultithreadedStrategy)
            {
                strategyToTryFirst  = strategiesCache.MultiThreadedStrategy;
                strategyToTrySecond = strategiesCache.SingleThreadedStrategy;
            }
            else
            {
                strategyToTryFirst  = strategiesCache.SingleThreadedStrategy;
                strategyToTrySecond = strategiesCache.MultiThreadedStrategy;
            }

            strategy = strategyToTryFirst.Value;
            if (strategy == null)
            {
                strategy = strategyToTrySecond.Value;
            }
        }
 static VersionedMethods()
 {
     var version = new Version(NativeMethods.sqlite3_libversion());
     if (version >= new Version(3, 7, 15))
     {
         _strategy = new Strategy3_7_15();
     }
     else if (version >= new Version(3, 7, 14))
     {
         _strategy = new Strategy3_7_14();
     }
     else if (version >= new Version(3, 7, 10))
     {
         _strategy = new Strategy3_7_10();
     }
     else
     {
         _strategy = new BaseStrategy();
     }
 }
        internal static void SetAndValidateValue(BaseStrategy strategy)
        {
            if (strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.AdverseMarketMovementBased
                || strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.TimerAndAdverseMarketMovementBased)
            {
                if (strategy.AdverseMovementInPriceAtrThreshold <= 0)
                    throw new ArgumentOutOfRangeException(
                        "AdverseMovementInPriceAtrThreshold must be greater than 0 for retrial strategy AdverseMarketMovementBased");
            }
            strategy.EffectiveRetryIntervalInSeconds = (strategy.RetryTriggerIntervalMinute*60) +
                                                       strategy.RetryTriggerIntervalSecond;
            if (strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.TimerBased
                || strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.TimerAndAdverseMarketMovementBased)
            {
                if (strategy.EffectiveRetryIntervalInSeconds <= 0)
                    throw new ArgumentOutOfRangeException(
                        "Retry inverval must be greater than 0 for retrial strategy TimerBased");
            }

            if (strategy.OrderRetrialStrategy != Enums.OrderRetrialStrategy.None)
            {
                if (strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.AdverseMarketMovementBased || strategy.OrderRetrialStrategy == Enums.OrderRetrialStrategy.TimerAndAdverseMarketMovementBased)
                    LoggingUtility.WriteVerbose(strategy.LoggingConfig,
                                             string.Format(
                                                 "Order will be retried every {0} seconds based on {1} strategy for maximum of {2} times. Adverse movement ATR: {3}",
                                                 strategy.EffectiveRetryIntervalInSeconds,
                                                 strategy.OrderRetrialStrategy,
                                                 strategy.MaximumRetries,
                                                 strategy.AdverseMovementInPriceAtrThreshold));
                else
                    LoggingUtility.WriteVerbose(strategy.LoggingConfig,
                                             string.Format(
                                                 "Order will be retried every {0} seconds based on {1} strategy for maximum of {2} times",
                                                 strategy.EffectiveRetryIntervalInSeconds,
                                                 strategy.OrderRetrialStrategy,
                                                 strategy.MaximumRetries));

            }
        }
Exemplo n.º 38
0
 public BaseSignal(BaseStrategy strategy)
 {
     this.strategy = strategy;
 }
Exemplo n.º 39
0
 public BaseTakeProfit(BaseStrategy strategy)
 {
     this.strategy = strategy;
 }
Exemplo n.º 40
0
 public BaseFilter(BaseStrategy strategy)
 {
     this.strategy = strategy;
 }
 public RetracementEntryBasedOnAtrCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
 public BaseQuantityCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
 public OpeningGapStopCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
 public BaseStopPriceCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
Exemplo n.º 45
0
 public SlippageCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
 public BaseStrategyCalculator(BaseStrategy strategy)
 {
     this.baseStrat = strategy;
 }
Exemplo n.º 47
0
 public BaseStopLoss(BaseStrategy strategy)
 {
     this.strategy = strategy;
 }
 public OpeningGapOrProtectiveStopCalculator(BaseStrategy strategy)
     : base(strategy)
 {
     openGapCalc = new OpeningGapStopCalculator(strategy);
     intraStopCalc = new ProtectiveStopBasedOnAtrCalculator(strategy);
 }
Exemplo n.º 49
0
 public BaseRiskProfile(BaseStrategy strategy)
 {
     this.strategy = strategy;
 }
 public FixedAmountStopCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }
 public ProtectiveStopBasedOnAtrCalculator(BaseStrategy strategy)
     : base(strategy)
 {
 }