Esempio n. 1
0
        public override void OnLoad(ProjectProperties properties)
        {
            var strategies = new List <Strategy>();

            foreach (var symbol in properties.Starter.SymbolProperties)
            {
                symbol.LimitOrderQuoteSimulation = LimitOrderQuoteSimulation.OppositeQuoteTouch;
                var strategy = new SimplexStrategy();
                strategy.SymbolDefault = symbol.Symbol;
                strategy.IsActive      = true;
                strategy.IsVisible     = true;
                strategies.Add(strategy);
            }

            if (strategies.Count == 1)
            {
                TopModel = strategies[0];
            }
            else
            {
                var portfolio = new Portfolio();
                foreach (var strategy in strategies)
                {
                    portfolio.AddDependency(strategy);
                }
                TopModel = portfolio;
            }
        }
Esempio n. 2
0
 public override void OnInitialize()
 {
     Performance.Equity.GraphEquity = true;
     gbpUsd                  = Strategies[0] as SimplexStrategy;
     gbpUsd.Name             = "Simplex Strategy";
     gbpUsd.GetHedgePosition = GetGbpUsd;
     gbpUsd.GetRatio         = GetRatio;
     eurUsd                  = Strategies[1] as SimplexStrategy;
     eurUsd.Name             = "Simplex Strategy";
     eurUsd.GetHedgePosition = GetEurUsd;
     eurUsd.GetRatio         = GetRatio;
     eurGbp                  = Strategies[2] as SimplexStrategy;
     eurGbp.Name             = "Simplex Strategy";
     eurGbp.GetHedgePosition = GetEurGbp;
     eurGbp.GetRatio         = GetRatio;
 }