public Replay() { if (Properties.Settings.Default.TLClientAddress== string.Empty) tl = new TLServer_WM() ; else tl = new TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); tl.newProviderName = Providers.TradeLink; tl.newSendOrderRequest += new OrderDelegateStatus(tl_gotSrvFillRequest); tl.newOrderCancelRequest += new LongDelegate(tl_OrderCancelRequest); tl.newAcctRequest += new StringDelegate(tl_gotSrvAcctRequest); tl.newPosList += new PositionArrayDelegate(tl_gotSrvPosList); tl.newFeatureRequest+=new MessageArrayDelegate(GetFeatures); tl.newUnknownRequest += new UnknownMessageDelegate(tl_newUnknownRequest); h.GotTick += new TickDelegate(h_GotTick); SimBroker.UseBidAskFills = Properties.Settings.Default.UseBidAskFills; SimBroker.GotOrder += new OrderDelegate(SimBroker_GotOrder); SimBroker.GotFill += new FillDelegate(SimBroker_GotFill); SimBroker.GotOrderCancel += new OrderCancelDelegate(SimBroker_GotOrderCancel); h.GotDebug+=new DebugDelegate(_dw.GotDebug); // setup playback _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged += new ProgressChangedEventHandler(_playback_ProgressChanged); status(Util.TLSIdentity()); // setup our special book used to hold bids and offers from historical sources // (this is for determining top of book between historical sources and our own orders) HISTBOOK.Execute = false; // make sure our special book is never executed by simulator HISTBOOK.Notify = false; // don't notify }
public Replay() { InitializeComponent(); tl.newSendOrderRequest += new OrderDelegate(tl_gotSrvFillRequest); tl.newDayHighRequest += new DecimalStringDelegate(tl_DayHighRequest); tl.newDayLowRequest += new DecimalStringDelegate(tl_DayLowRequest); tl.newOrderCancelRequest += new UIntDelegate(tl_OrderCancelRequest); tl.newAcctRequest += new StringDelegate(tl_gotSrvAcctRequest); tl.newPosList += new PositionArrayDelegate(tl_gotSrvPosList); tl.newFeatureRequest+=new MessageArrayDelegate(GetFeatures); h.GotTick += new TickDelegate(h_GotTick); h.SimBroker.GotOrder += new OrderDelegate(SimBroker_GotOrder); h.SimBroker.GotFill += new FillDelegate(SimBroker_GotFill); h.SimBroker.GotOrderCancel += new OrderCancelDelegate(SimBroker_GotOrderCancel); h.CacheWait = 500; // setup playback _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged += new ProgressChangedEventHandler(_playback_ProgressChanged); status(Util.TLSIdentity()); // setup our special book used to hold bids and offers from historical sources // (this is for determining top of book between historical sources and our own orders) HISTBOOK.Execute = false; // make sure our special book is never executed by simulator HISTBOOK.Notify = false; // don't notify }
public Replay() { if (Properties.Settings.Default.TLClientAddress == string.Empty) { tl = new TLServer_WM(); } else { tl = new TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); } TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); tl.newProviderName = Providers.TradeLink; tl.newSendOrderRequest += new OrderDelegateStatus(tl_gotSrvFillRequest); tl.newOrderCancelRequest += new LongDelegate(tl_OrderCancelRequest); tl.newAcctRequest += new StringDelegate(tl_gotSrvAcctRequest); tl.newPosList += new PositionArrayDelegate(tl_gotSrvPosList); tl.newFeatureRequest += new MessageArrayDelegate(GetFeatures); tl.newUnknownRequest += new UnknownMessageDelegate(tl_newUnknownRequest); h.GotTick += new TickDelegate(h_GotTick); SimBroker.UseBidAskFills = Properties.Settings.Default.UseBidAskFills; SimBroker.GotOrder += new OrderDelegate(SimBroker_GotOrder); SimBroker.GotFill += new FillDelegate(SimBroker_GotFill); SimBroker.GotOrderCancel += new OrderCancelDelegate(SimBroker_GotOrderCancel); h.GotDebug += new DebugDelegate(_dw.GotDebug); // setup playback _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged += new ProgressChangedEventHandler(_playback_ProgressChanged); status(Util.TLSIdentity()); // setup our special book used to hold bids and offers from historical sources // (this is for determining top of book between historical sources and our own orders) HISTBOOK.Execute = false; // make sure our special book is never executed by simulator HISTBOOK.Notify = false; // don't notify }
private void playbut_Click(object sender, EventArgs e) { if (!Directory.Exists(tickfolder)) { status("Tick folder " + tickfolder + " doesn't exist, stopping."); return; } highs = new Dictionary <string, decimal>(); lows = new Dictionary <string, decimal>(); TickFileFilter tff = new TickFileFilter(); tff.DateFilter(Util.ToTLDate(monthCalendar1.SelectionEnd), DateMatchType.Day | DateMatchType.Month | DateMatchType.Year); h.FileFilter = tff; _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged += new ProgressChangedEventHandler(_playback_ProgressChanged); _playback.RunWorkerAsync(new PlayBackArgs((int)trackBar1.Value / 5, daystartpicker.Value)); status("Playback started..."); playbut.Enabled = false; stopbut.Enabled = true; trackBar1.Enabled = false; }
private void playbut_Click(object sender, EventArgs e) { status("preparing simulation"); if (_playback.IsBusy) { status("simulation already in progress"); return; } // setup simulation (portfolio realistic) h = new MultiSimImpl(tickfolder,FileFilter); // bind events h.GotTick += new TickDelegate(h_GotTick); h.GotDebug += new DebugDelegate(_dw.GotDebug); // setup playback _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged += new ProgressChangedEventHandler(_playback_ProgressChanged); // clear highs and lows highs = new Dictionary<string, decimal>(); lows = new Dictionary<string, decimal>(); // start playback var delayscale = (int)((double)trackBar1.Value / 5); _playback.RunWorkerAsync(new PlayBackArgs(delayscale)); // notify user status("Playback started..."); // update user interface options playbut.Enabled = false; stopbut.Enabled = true; trackBar1.Enabled = false; }
private void playbut_Click(object sender, EventArgs e) { if (!Directory.Exists(tickfolder)) { status("Tick folder " + tickfolder + " doesn't exist, stopping."); return; } highs = new Dictionary<string, decimal>(); lows = new Dictionary<string, decimal>(); TickFileFilter tff = new TickFileFilter(); tff.DateFilter(Util.ToTLDate(monthCalendar1.SelectionEnd),DateMatchType.Day|DateMatchType.Month|DateMatchType.Year); h.FileFilter = tff; _playback = new Playback(h); _playback.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_playback_RunWorkerCompleted); _playback.ProgressChanged+=new ProgressChangedEventHandler(_playback_ProgressChanged); _playback.RunWorkerAsync(new PlayBackArgs((int)trackBar1.Value/5,daystartpicker.Value)); status("Playback started..."); playbut.Enabled = false; stopbut.Enabled = true; trackBar1.Enabled = false; }