public CommandLineInterface(string title) { Name = title; RootMenu = new Menu("Main menu", "JQuants main menu", "Main menu provides access to the Logging, Trading\n" + "and other main system moudles"); CurrentMenu = RootMenu; SystemMenu = new Menu("Commnad line interface system menu", "", ""); SystemMenu.AddCommand("help", "List commands", "", PrintCommandsFull); SystemMenu.AddCommand("..", "One level up", "", OneLevelUp); SystemMenu.AddCommand("~", "Go to the main menu (root)", "", GotoRootMenu); }
protected void LoadCommandLineInterface_feed() { Menu menuFeed = cli.RootMenu.AddMenu("feed", "Trading data feeds", " Get data from the data feeds, TA screens"); menuFeed.AddCommand("get", "Get price/volume series", " Get price/volume daily series for the specified stock symbol. Args: symbol [fromDate[toDate]]", feedGetSeriesCallback); menuFeed.AddCommand("gf", "Write price/volume series to file", " Get price/volume daily series for the specified stock symbol and write to file. Args: symbol filename [fromDate[toDate]]", feedGetToFileCallback); menuFeed.AddCommand("rf", "Get price/volume series from file", " Load price/volume daily series for the specified file. Args: filename", feedGetSeriesFromFileCallback); menuFeed.AddCommand("fisher", "Fisher transform", "Apply Fisher transform to the latest loaded series", feedFisherTransformCallback); }
protected void LoadCommandLineInterface_ms() { Menu menuMarketSim = cli.RootMenu.AddMenu("ms", "Market simulation", " Run market simulation"); menuMarketSim.AddCommand("maof", "Run MarketSimulationMaof. Usage: maof create <backlogfile> [speedup] | start | stop", "Create Maof Event Generator, connect to the Maof Market simulation", debugMarketSimulationMaofCallback ); menuMarketSim.AddCommand("stat", "Show statistics for the running market simulation. Usage: stat core|book|queue", "Display number of events, number of placed orders at different layers of the market simulaiton", debugMarketSimulationMaofStatCallback ); menuMarketSim.AddCommand("secs", "Show list of securities. Usage secs maof|core|book|queue", "Display list of securities including number of orders", debugMarketSimulationMaofSecsCallback ); menuMarketSim.AddCommand("trace", "Enable trace for specific security. Usage: trace <securityId> <enable|disable>", "Enable/disable debug trace for specific security. " + "Security identifier can be a unique number, \n" + "or things like 'C1800Oct', 'call 1800 Oct', 'call1800Oct', etc. ", debugMarketSimulationMaofTraceCallback ); menuMarketSim.AddCommand("w", "Add security to the watch list. Usage: w [add|rmv|legend|list] <securityId> ", "Add (remove) specific security to (from) watch list, pint list of watched securities.\n" + "Security identifier can be a unique number, \n" + "or things like 'C1800Oct', 'call 1800 Oct', 'call1800Oct', etc. ", debugMarketSimulationMaofWatchCallback ); menuMarketSim.AddCommand("p", "Place order. Usage: p [buy|sell] <securityId> [limit] [quantity]", "Place order for specific security. " + "Security identifier can be a unique number, " + "or things like 'C1800Oct', 'call 1800 Oct', 'call1800Oct', etc. ", debugMarketSimulationMaofPlaceOrderCallback ); menuMarketSim.AddCommand("c", "Cancel order. Usage: c <securityId>", "Cancels previously placed order. " + "Security identifier can be a unique number, \n" + "or things like 'C1800Oct', 'call 1800 Oct', 'call1800Oct', etc. ", debugMarketSimulationMaofCancelOrderCallback ); }
protected void LoadCommandLineInterface_sa() { Menu menuAlgo = cli.RootMenu.AddMenu("algo", "Algo debug", "Semiautomatic traidng routines"); menuAlgo.AddCommand("start", "Create algo", "Create algo, connect to the data feed - DataCollector.rezefProducer. Args: " + #if USEFMRSIM "<logFile> [speedup]", #else "", #endif algoStart); menuAlgo.AddCommand("stop", "Graceful stop", "Stop the FSM gracefuly - takes care to close all pending orders", algoStop); menuAlgo.AddCommand("stopu", "Immediate stop", "Gets out immediately. Does not clean up the pending orders if any", algoStop); menuAlgo.AddCommand("stat", "Show algo statistics counters", "Show traffic related and trades related statistics", algoStat); menuAlgo.AddCommand("s", "Skip trigger", "Skip the trigger, go on with looking for triggers", algoSkip); menuAlgo.AddCommand("p", "Launch paper trade", "Simulated paper trading using either real time data or playback log", algoPaper); menuAlgo.AddCommand("o", "Launch real trade", "Real cash order using based on real-time data feed", algoReal); menuAlgo.AddCommand("sm", "Toggle Algo FSM mode. Usage: sm a|s ", "Set mode: semiautomatic or automatic", algoSetMode); }
protected void LoadCommandLineInterface_oper() { Menu menuOperations = cli.RootMenu.AddMenu("oper", "Operations", " Login, start stream&log"); menuOperations.AddCommand("Login", "Login to the remote server", "The call will block until login succeeds", operLoginCallback ); menuOperations.AddCommand("Logout", "Perform the logout process", "The call will block until logout succeeds", operLogoutCallback ); menuOperations.AddCommand("StartLog", "Log data stream - choose MF|RZ|MDD.", "Start market data stream and run logger. In sim mode playback file can be specified", operLogCallback ); menuOperations.AddCommand("StopLog", "Stop log - MF|MDD|RZ, to stop stream type Y", "Stop logger - Maof(MF) | Madad (MDD)| Rezef(RZ) and, optionally, the stream [Y]", operStopLogCallback); menuOperations.AddCommand("StopStream", "Stop the data stream - MF | MDD | RZ", "Stop data stream - Maof(MF) | Madad (MDD) | Rezef (RZ)", StopStreamCallBack ); menuOperations.AddCommand("ShowLog", "Show existing loggers", "List of created loggers with the statistics", debugLoggerShowCallback ); menuOperations.AddCommand("AS400TimeTest", "Ping the server", "Ping AS400 server in order to get latency", debugGetAS400DTCallback); }
protected void LoadCommandLineInterface_dbg() { Menu menuDebug = cli.RootMenu.AddMenu("dbg", "System debug info", "Created objetcs, access to the system statistics"); //test Orders FSM Menu menuDbgOrdersFSM = menuDebug.AddMenu("OFSM", "Test RZ Orders FSM", "Test Rezef Orders FSM API and performance"); menuDbgOrdersFSM.AddCommand("start", "create Rezef orders FSM", "create a new instance of orders FSM", debugOFSM_Create); menuDbgOrdersFSM.AddCommand("send", "send a test order, usage: send B/S id Q P", "sends a single test order to the sim/real taskbar", debugOFSM_Send); menuDbgOrdersFSM.AddCommand("cancel", "cancel sent test order", "cancel previously created test order", debugOFSM_Cancel); menuDbgOrdersFSM.AddCommand("update", "update sent test order, usage: update [q newQ] [p newP]", "update previously sent test order", debugOFSM_Update); menuDbgOrdersFSM.AddCommand("remove", "cleanup inactive order", "remove canceled/executed order from the FSM", debugOFSM_Remove); menuDbgOrdersFSM.AddCommand("stop", "stop Rezef Orders FSM", "stop the FSM after trading was completed", debugOFSM_Stop); Menu menuDbgFuncs = menuDebug.AddMenu("dbgUF", "Test vatious UserClass functions", "Test UserClass functions and get their output"); menuDbgFuncs.AddCommand("Perms", "check my permissions", "Get and print the list of my account permissions", debugUserPermissions); menuDbgFuncs.AddCommand("Acc", "check my accounts", "Get and print account details", debugUserAcc); Menu menuDbgOrderStream = menuDebug.AddMenu("OrderStream", "Test orders Stream", "Start/stop orders stream, retrieve orders info from it"); menuDbgOrderStream.AddCommand("start", "Start orders stream - MF|RZ|ALL (by default)", "Start streaming orders data from the server", debugStartOrderStream); menuDbgOrderStream.AddCommand("stop", "stop orders stream - - MF|RZ|ALL (by default)", "Start streaming orders data from the server", debugStopOrderStream); menuDbgOrderStream.AddCommand("O", "list MF/RZ/ALL orders", "retrieve orders list from the remote server. O MF|RZ|ALL (or nothing)", debugListOrders); Menu menuHttp = menuDebug.AddMenu("http", "HTTP server", "Start/stop embedded HTTP server, get traffic statistics"); menuHttp.AddCommand("start", "Start HTTP server", "Create instance of HTTP server and start the server", debugHttpStart); menuHttp.AddCommand("stop", "Stop HTTP server", "Stop previously started server", debugHttpStop); menuHttp.AddCommand("stat", "Show HTTP server traffic counters", "Show connections, incoming and outgoing traffic, errors", debugHttpStat); menuDebug.AddCommand("sh161", "Get TA25 Index weights", "Get TA25 Index weights", debugLogSH161DataCallback ); menuDebug.AddCommand("AS400TimeTest", "ping the server", "ping AS400 server in order to get latency and synchronize local amachine time with server's", debugGetAS400DTCallback); menuDebug.AddCommand("fmrPing", "Start FMR ping thread", " Ping AS400 server continuosly [login|logout|stat|kill]", debugFMRPingCallback); menuDebug.AddCommand("threadPoolShow", "Show thread pools", " List of created thread pools", debugThreadPoolShowCallback ); menuDebug.AddCommand("timerShow", "Show timers", " List of created timers and timer tasks", debugTimerShowCallback ); menuDebug.AddCommand("threadShow", "Show threads", " List of created threads and thread states", debugThreadShowCallback); menuDebug.AddCommand("mbxShow", "Show mailboxes", " List of created mailboxes with the current status and statistics", debugMbxShowCallback ); menuDebug.AddCommand("poolShow", "Show pools", " List of created pools with the current status and statistics", debugPoolShowCallback ); #if USEFMRSIM menuDebug.AddCommand("loggerTest", "Run simple test of the logger", " Create a Collector and start a random data simulator", debugLoggerTestCallback ); #endif menuDebug.AddCommand("loggerShow", "Show existing loggers", " List of created loggers with the statistics", debugLoggerShowCallback ); menuDebug.AddCommand("prodShow", "Show producers", " List of created producers", debugProducerShowCallback ); menuDebug.AddCommand("veriShow", "Show data verifiers", " List of created data verifiers", debugVerifierShowCallback ); }
protected void LoadCommandLineInterface_test() { Menu menuTests = cli.RootMenu.AddMenu("tst", "Short tests", " Infrastructure/API tests"); menuTests.AddCommand("GC", "Run garbage collector", " Forces garnage collection", debugGcCallback); menuTests.AddCommand("mbxTest", "Run simple mailbox tests", " Create a mailbox, send a message, receive a message, print debug info", debugMbxTestCallback); menuTests.AddCommand("mbxShow", "Show mailboxes", " List of created mailboxes with the current status and statistics", debugMbxShowCallback); menuTests.AddCommand("threadTest", "Run simple thread", " Create a mailbox thread, send a message, print debug info", debugThreadTestCallback); menuTests.AddCommand("threadShow", "Show threads", " List of created threads and thread states", debugThreadShowCallback); menuTests.AddCommand("poolTest", "Run simple pool tests", " Create a pool, add object, allocate object, free object", debugPoolTestCallback); menuTests.AddCommand("poolShow", "Show pools", " List of created pools with the current status and statistics", debugPoolShowCallback); menuTests.AddCommand("timerTest", "Run simple timer tests", " Create a timer task, two timer lists, start two timers, clean up", debugTimerTestCallback); menuTests.AddCommand("timerShow", "Show timers", " List of created timers and timer tasks", debugTimerShowCallback); menuTests.AddCommand("threadPoolTest", "Run simple thread pool tests", " Create a thread pool, start a couple of jobs, destroy the pool", debugThreadPoolTestCallback); menuTests.AddCommand("threadPoolShow", "Show thread pools", " List of created thread pools", debugThreadPoolShowCallback); menuTests.AddCommand("cbtest", "Cyclic buffer class test", " Create a cyclic buffer, check functionality", debugCyclicBufferTestCallback); menuTests.AddCommand("rtclock", "RT clock test", " Calls PreciseTime periodically and checks that the returned time is reasonable", debugRTClockCallback); menuTests.AddCommand("rtclock_1", "RT clock test", " Calls PreciseTime in tight loop and checks that the returned time is reasonable", debugRTClock1Callback); menuTests.AddCommand("rtclock_2", "RT clock test", " Calls PreciseTime and print out ticks", debugRTClock2Callback); menuTests.AddCommand("logTest", "File logger test", " Create a logger, add a couple of entries and get out", debugFileLoggerTestCallback); menuTests.AddCommand("jsonTest", "Test JSON support", " Create set of objects, call Utils.GetJSON(), print the output", debugJsonTestCallback); }