Exemple #1
0
        public ActionResult GetForex(string id)
        {
            CurrenciesForList CurrenciesForBase = new CurrenciesForList();

            id = id.Replace("-", "/");
            CurrenciesForBase = ForexAPI.Currency_History_Caller(id);
            return(View(CurrenciesForBase));
        }
Exemple #2
0
        internal override void OnRemmoteAdvisorInit(RemoteAdvisor rmAdviser)
        {
            try
            {
                Meta = rmAdviser;
                ForexAPI fAPI = new ForexAPI(Meta, rmAdviser.MagicNumber);

                OrderOperation = fAPI;
                Account        = fAPI;
                History        = fAPI;
                this.Symbol    = rmAdviser.Symbol();

                if (this.param != null)
                {
                    throw new ApplicationException("Param was initalized");
                }
                this.param = new StrategyParameter();

                foreach (string paramKey in rmAdviser.Parameters.Keys)
                {
                    if (paramKey == "NewsFilePath")
                    {
                        this.param.NewsFilePath = rmAdviser.Parameters[paramKey];
                        continue;
                    }
                    if (paramKey.EndsWith("String"))
                    {
                        this.param.Add(paramKey, rmAdviser.Parameters[paramKey]);
                        continue;
                    }
                    if (paramKey == "InvertedMetaStrategy")
                    {
                        rmAdviser.IsInverted = rmAdviser.Parameters[paramKey] == "1" || rmAdviser.Parameters[paramKey] == "true";
                        continue;
                    }

                    this.param[paramKey] = Int32.Parse(rmAdviser.Parameters[paramKey]);
                }


                this.logger = new MetaStrategyLogger(Meta);

                onStart(0);
                this.Meta.Print("onStart finidshed successfully");
            }
            catch (Exception exc)
            {
                string excString = "Start up exception: " + exc.ToString();
                Meta.Comment(excString);
                Meta.Print(excString);
            }
        }