static void Main(string[] args) { /* IMPORTANT INFORMATION * ===================== * * The purpose of this console application is to allow you to test/debug the Strategy * while you are developing it. * * Running this project will perform an EuroFX 6 month backtest on the Strategy, using 30 min bars. * * Once the backtest is finished, you will be able to launch the TradingMotionSDKToolkit * application to see the graphical result. * * If you want to debug your code you can place breakpoints on the Strategy subclass * and Debug the project. * * * REQUIRED CREDENTIALS: Edit your app.config and enter your login/password for accessing the TradingMotion API */ DateTime startBacktestDate = DateTime.Parse(DateTime.Now.AddMonths(-6).AddDays(-1).ToShortDateString() + " 00:00:00"); DateTime endBacktestDate = DateTime.Parse(DateTime.Now.AddDays(-1).ToShortDateString() + " 23:59:59"); TradingMotionAPIClient.Instance.SetUp("https://www.tradingmotion.com/api/webservice.asmx", ConfigurationManager.AppSettings["TradingMotionAPILogin"], ConfigurationManager.AppSettings["TradingMotionAPIPassword"]); //Enter your TradingMotion credentials on the app.config file HistoricalDataAPIClient.Instance.SetUp("https://barserver.tradingmotion.com/WSHistoricalDatav2/webservice.asmx"); AryaStrategy s = new AryaStrategy(new Chart(SymbolFactory.GetSymbol("URO"), BarPeriodType.Minute, 30), null); DebugStrategy.RunBacktest(s, startBacktestDate, endBacktestDate); }
public void SampleTextCopiedToFlyweightSymbols() { var symbolFacotry = new SymbolFactory(); char[] charArraySampleTekst = "alamakota".ToCharArray(); char[] newCharArray = new char[charArraySampleTekst.Length]; for (int i = 0; i < charArraySampleTekst.Length; i++) { var symbol = symbolFacotry.GetSymbol(charArraySampleTekst[i]).symbol; newCharArray[i] = symbolFacotry.GetSymbol(charArraySampleTekst[i]).symbol; } bool token = false; for (int i = 0; i < charArraySampleTekst.Length; i++) { token = newCharArray[i].Equals(charArraySampleTekst[i]); } Assert.True(token); }
public List <Symbol> Collect(string text) { List <Symbol> symbols = new List <Symbol>(); for (int i = 0; i < text.Length; ++i) { if (Char.IsWhiteSpace(text[i])) { continue; } Symbol v = null; Console.WriteLine(text[i] + " " + (int)text[i]); Symbol t = SymbolFactory.GetSymbol(text[i]); if (t == null) { t = SymbolFactory.GetSymbol(text, ref i); if (t == null) { throw new Exception("Could not produce a symbol from string starting at position " + (i + 1)); } } if (t is Quantifier) { ++i; v = SymbolFactory.GetSymbol(text, ref i); if (v == null) { throw new Exception("Invalid syntax after quantifier at position " + (i + 1)); } if (v is Variable == false) { throw new QuantifierRefersToConstantException(); } symbols.Add(v); } symbols.Add(t); } return(symbols); }