static void Main(string[] args) { var envName = Env.GetOption("-env", args); if (envName == null) { Console.WriteLine("Usage: ConsoleClient.exe -env <envName>"); return; } var clientSession = new ClientSession(args); clientSession.StartAndConnect("orchestra", "SimpleClient", envName, "orchestra"); //FxSwapUpdate(); //AccountCleanUp(); PubSubSessionFactory.CleanUp(); Console.WriteLine("Enter to Exit ..."); Console.ReadLine(); }
static public void Main(string[] args) { var scount = Env.GetOption("-count", args); var client = new ClientSession(args); client.StartAndConnect("ApplyTermination"); Logger.Info(".....Apply Termination Started ........................"); var trade =new Trade(); //Get the Trade for which to apply the Termaition var market = new Market(); //Should get the Real Market var asOfDate = new DateTime(); //negotiated Trade Date of the Termination/StepOut var effDate = new SimpleDate(23,2,2012); double fee =10000; //Total Proceeds (Fee > 0, you receive the Amount Fee < 0 you pay to the Counterpary) string party = "GS"; //Fill it in case this is a StepOut ApplyFullTermination(trade, fee, party, market, asOfDate, effDate); //Then you can save the Trade if (trade.Id <= 0) Env.Current.Trade.SaveTrade(trade); Console.WriteLine("Enter to Exit ..."); Console.ReadLine(); Environment.Exit(0); }
/* * Usage: * Interactive mode: Symmetry.OrcConsole.exe -env msuat -user orchestra -password orchestra [-home <OrchestradeRoot>] * Batch mode: Symmetry.OrcConsole.exe -env msuat -user orchestra -password orchestra [-home <OrchestradeRoot>] -script ScriptName * * ...where ScriptName is the name of a class in the Symmetry.OrcConsole.Scripts deriving from ScriptBase */ static void Main(string[] args) { try { string scriptName = null; if (args != null && args.Contains("-script")) { scriptName = args.SkipWhile(a => !a.Equals("-script", StringComparison.InvariantCultureIgnoreCase)).Skip(1).FirstOrDefault(); } var client = new ClientSession(args); client.StartAndConnect("Symmetry.OrcConsole"); if (!string.IsNullOrWhiteSpace(scriptName)) { ScriptBase.Logger.InfoFormat("Batch mode - running script {0}", scriptName); RunScript(scriptName, client); } else { Console.WriteLine("Symmetry.OrcConsole interactive mode - enter script name or 'list' to see available scripts."); string command = String.Empty; do { try { Console.Write("> "); command = Console.ReadLine(); if (command.Equals("exit", StringComparison.InvariantCultureIgnoreCase) || command.Equals("quit", StringComparison.InvariantCultureIgnoreCase)) { break; } else if (command.Equals("list", StringComparison.InvariantCultureIgnoreCase)) { Console.WriteLine("Listing all scripts in current assembly:"); var assembly = Assembly.GetExecutingAssembly(); foreach (var type in assembly.GetTypes()) { if (type.IsSubclassOf(typeof(ScriptBase)) && type.Namespace == typeof(ScriptBase).Namespace) { Console.WriteLine(type.Name); } } } else { RunScript(command, client); } } catch (Exception x) { ScriptBase.Logger.Error(x); } } while (true); } } catch (Exception x) { ScriptBase.Logger.Error(x); Environment.Exit(2); } PubSubSessionFactory.CleanUp(); Environment.Exit(0); }