예제 #1
0
        public TradingSystemPivotPointsEMA(LocalMoneyManager localMoneyManager, Account account, Security security)
        {
            this.localMoneyManager = localMoneyManager;
            var securityTSLab = security as SecurityTSlab;

            sec                    = securityTSLab.security;
            this.security          = security;
            pivotPointsIndicator   = new PivotPointsIndicator();
            patternPivotPoints_1g2 = new PatternPivotPoints_1g2();
            patternPivotPoints_1l2 = new PatternPivotPoints_1l2();
        }
예제 #2
0
        public TradingSystemPivotPointsTwoTimeFrames(LocalMoneyManager localMoneyManager, Account account, Security security)
        {
            this.localMoneyManager = localMoneyManager;
            this.account           = account;
            var securityTSLab = security as SecurityTSlab;

            sec                        = securityTSLab.security;
            this.security              = security;
            pivotPointsIndicator       = new PivotPointsIndicator();
            pivotPointsIndicatorFilter = new PivotPointsIndicator();
            patternPivotPoints_1l2g3   = new PatternPivotPoints_1l2g3();
            patternPivotPoints_1g2     = new PatternPivotPoints_1g2();
            patternPivotPoints_1l2     = new PatternPivotPoints_1l2();
            patternPivotPoints_1g2g3   = new PatternPivotPoints_1g2g3();
            patternPivotPoints_1g2l3   = new PatternPivotPoints_1g2l3();
            patternPivotPoints_1l2l3   = new PatternPivotPoints_1l2l3();
        }
예제 #3
0
        public void Initialize(ISecurity[] securities, IContext ctx)
        {
            var logger        = new LoggerSystem(ctx);
            var securityFirst = securities.First();

            if (IsLaboratory(securityFirst))
            {
                account = new AccountLab(securityFirst);
            }
            else
            {
                account = new AccountReal(securityFirst);
            }

            var securityList = new List <Security>();

            this.securityFirst = new SecurityTSlab(securityFirst);
            securityList.Add(this.securityFirst);

            var globalMoneyManager = new GlobalMoneyManagerReal(account, riskValuePrcnt: 1.00);

            globalMoneyManager.Logger = logger;
            var localMoneyManagerRuble = new LocalMoneyManager(globalMoneyManager, account, Currency.Ruble);

            //tradingSystems = new List<TradingSystemPivotPointsTwoTimeFrames>();
            tradingSystems = new List <TradingSystemPivotPointsEMA>();

            double                      comission;
            AbsolutCommission           comis;
            TradingSystemPivotPointsEMA ts;

            //tradingSystems.Add(new TradingSystemPivotPointsTwoTimeFrames(localMoneyManagerRuble, account, this.securityFirst));
            ts        = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, this.securityFirst);//si-5min
            ts.Logger = logger;
            tradingSystems.Add(ts);
            comission = 1.15 * 2;
            //comission = 1 * 2;
            comis = new AbsolutCommission()
            {
                Commission = comission
            };
            comis.Execute(securities[0]);

            ////tradingSystems.Add(new TradingSystemPivotPointsTwoTimeFrames(localMoneyManagerRuble, account, new Se)curityTSlab(securities[1])));
            //ts = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, new SecurityTSlab(securities[1]));//sbrf-5min
            //tradingSystems.Add(ts);
            //ts.Logger = logger;
            //tradingSystems.Add(ts);
            //comission = 2.02 * 2;
            ////comission = 2 * 2;
            //comis = new AbsolutCommission() { Commission = comission };
            //comis.Execute(securities[1]);

            //ts = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, new SecurityTSlab(securities[2]));//gazr-5min
            //tradingSystems.Add(ts);
            //ts.Logger = logger;
            //tradingSystems.Add(ts);
            //comission = 2.02 * 2;
            ////comission = 2 * 2;
            //comis = new AbsolutCommission() { Commission = comission };
            //comis.Execute(securities[1]);

            //ts = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, new SecurityTSlab(securities[3]));//lkoh-5min
            //tradingSystems.Add(ts);
            //ts.Logger = logger;
            //tradingSystems.Add(ts);
            //comission = 2.02 * 2;
            ////comission = 2 * 2;
            //comis = new AbsolutCommission() { Commission = comission };
            //comis.Execute(securities[1]);

            //ts = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, new SecurityTSlab(securities[4]));//mxi-5min
            //tradingSystems.Add(ts);
            //ts.Logger = logger;
            //tradingSystems.Add(ts);
            //comission = 2.02 * 2;
            ////comission = 2 * 2;
            //comis = new AbsolutCommission() { Commission = comission };
            //comis.Execute(securities[1]);

            //ts = new TradingSystemPivotPointsEMA(localMoneyManagerRuble, account, new SecurityTSlab(securities[5]));//silv-5min
            //tradingSystems.Add(ts);
            //ts.Logger = logger;
            //tradingSystems.Add(ts);
            //comission = 2.02 * 2;
            ////comission = 2 * 2;
            //comis = new AbsolutCommission() { Commission = comission };
            //comis.Execute(securities[1]);



            //tradingSystem.Logger = logger;
            account.Logger = logger;
            this.ctx       = ctx;
            context        = new ContextTSLab(ctx);
            var acc = account as AccountLab;

            acc.Initialize(securityList);
        }