public SterMain() { TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); _dc.Parent = this; _dc.Dock = DockStyle.Fill; ContextMenu = new ContextMenu(); ContextMenu.MenuItems.Add("account", new EventHandler(setaccount)); ContextMenu.MenuItems.Add("report", new EventHandler(report)); try { TradeLink.API.TLServer tls; if (Properties.Settings.Default.TLClientAddress == string.Empty) { tls = new TradeLink.Common.TLServer_WM(); } else { tls = new TradeLink.Common.TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); } tl = new ServerSterling(tls, Properties.Settings.Default.Sleep, Properties.Settings.Default.OrderSleep, debug); tl.UseServerStops = Properties.Settings.Default.UseServerStops; tl.MinLotSize = Properties.Settings.Default.MinLotSize; tl.PostSymSubscribeWait = Properties.Settings.Default.PostSymbolSubscribeWait; tl.AutoSubscribeOrderSymbol = Properties.Settings.Default.AutosubscribeOrderSym; tl.OversellSplit = Properties.Settings.Default.OversellSplit; tl.RegSHOShorts = Properties.Settings.Default.RegSHOShorts; tl.LimitPositionUpdates = Properties.Settings.Default.PositionUpdateLimit; tl.isPaperTradeUsingBidAsk = Properties.Settings.Default.PaperTradeUseBidAsk; tl.isPaperTradeEnabled = Properties.Settings.Default.PaperTrade; tl.UseXmlMode = Properties.Settings.Default.UseXMLQuotes; tl.AutoCapAccounts = Properties.Settings.Default.AutoCapitilizeAccounts; tl.CoverEnabled = Properties.Settings.Default.CoverEnabled; tl.Accounts = Properties.Settings.Default.defaultaccount.Split(','); tl.CancelWait = Properties.Settings.Default.CancelWait; tl.VerboseDebugging = Properties.Settings.Default.VerboseDebugging; tl.FixOrderDecimalPlace = Properties.Settings.Default.FixOrderDecimalPlaces; tl.IgnoreOutOfOrderTicks = Properties.Settings.Default.IgnoreOutOfOrderTicks; tl.AutosetUnsetId = Properties.Settings.Default.AutoSeUnsetId; tl.SendCancelOnReject = Properties.Settings.Default.SendCancelOnRejects; tl.SendCancelOnError = Properties.Settings.Default.SendCancelOnError; tl.UseSubscribedSymbolForNotify = Properties.Settings.Default.UseSubscribedSymbolForNotify; tl.UseSterlingTickBuffer = Properties.Settings.Default.SterlingTickBuffering; tl.EnableImbalancesAndHalts = Properties.Settings.Default.EnableImbalancesAndHalts; tl.Start(); } catch (Exception ex) { const string URL = @"http://code.google.com/p/tradelink/wiki/SterConfig"; debug("problem connecting to sterling..."); debug("please check guide at: " + URL); System.Diagnostics.Process.Start(URL); debug(ex.Message + ex.StackTrace); } toolStrip1.BackColor = BackColor; FormClosing += new FormClosingEventHandler(SterMain_FormClosing); }
public SterMain() { TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); _dc.Parent = this; _dc.Dock = DockStyle.Fill; ContextMenu = new ContextMenu(); ContextMenu.MenuItems.Add("account", new EventHandler(setaccount)); ContextMenu.MenuItems.Add("report", new EventHandler(report)); try { TradeLink.API.TLServer tls; if (Properties.Settings.Default.TLClientAddress == string.Empty) { tls = new TradeLink.Common.TLServer_WM(); } else tls = new TradeLink.Common.TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); tl = new ServerSterling(tls, Properties.Settings.Default.Sleep,Properties.Settings.Default.OrderSleep,debug); tl.UseServerStops = Properties.Settings.Default.UseServerStops; tl.MinLotSize = Properties.Settings.Default.MinLotSize; tl.PostSymSubscribeWait = Properties.Settings.Default.PostSymbolSubscribeWait; tl.AutoSubscribeOrderSymbol = Properties.Settings.Default.AutosubscribeOrderSym; tl.OversellSplit = Properties.Settings.Default.OversellSplit; tl.RegSHOShorts = Properties.Settings.Default.RegSHOShorts; tl.LimitPositionUpdates = Properties.Settings.Default.PositionUpdateLimit; tl.isPaperTradeUsingBidAsk = Properties.Settings.Default.PaperTradeUseBidAsk; tl.isPaperTradeEnabled = Properties.Settings.Default.PaperTrade; tl.UseXmlMode = Properties.Settings.Default.UseXMLQuotes; tl.AutoCapAccounts = Properties.Settings.Default.AutoCapitilizeAccounts; tl.CoverEnabled = Properties.Settings.Default.CoverEnabled; tl.Accounts = Properties.Settings.Default.defaultaccount.Split(','); tl.CancelWait = Properties.Settings.Default.CancelWait; tl.VerboseDebugging = Properties.Settings.Default.VerboseDebugging; tl.FixOrderDecimalPlace = Properties.Settings.Default.FixOrderDecimalPlaces; tl.IgnoreOutOfOrderTicks = Properties.Settings.Default.IgnoreOutOfOrderTicks; tl.AutosetUnsetId = Properties.Settings.Default.AutoSeUnsetId; tl.SendCancelOnReject = Properties.Settings.Default.SendCancelOnRejects; tl.SendCancelOnError = Properties.Settings.Default.SendCancelOnError; tl.UseSubscribedSymbolForNotify = Properties.Settings.Default.UseSubscribedSymbolForNotify; tl.UseSterlingTickBuffer = Properties.Settings.Default.SterlingTickBuffering; tl.EnableImbalancesAndHalts = Properties.Settings.Default.EnableImbalancesAndHalts; tl.Start(); } catch (Exception ex) { const string URL = @"http://code.google.com/p/tradelink/wiki/SterConfig"; debug("problem connecting to sterling..."); debug("please check guide at: " + URL); System.Diagnostics.Process.Start(URL); debug(ex.Message+ex.StackTrace); } toolStrip1.BackColor = BackColor; FormClosing += new FormClosingEventHandler(SterMain_FormClosing); }