// Methods for individual states. Should be private or protected to hide them since they don't need to be called directly. // NOTE: NAMES NEED TO MATCH STATES EXACTLY OR EXCEPTIONS WILL BE GENERATED! #region State Methods private void GetHeadTimeStamp(FSM_EventArgs.GooContract_With_Payload e) { TWS.RequestHeadTimeStamp(e.Contract); }
private void DownloadHistoricalData(FSM_EventArgs.GooContract_With_Payload e) { // Submit a request for 24 hours of 1-min data TWS.RequestHistoricalData(e.Contract, e.Contract.HistRequestTimeStamp, TWSInfo.HistoricalDataStepSizes.Day_1, TWSInfo.BarSizeSetting.Min_1); }
private void FailedConnection(FSM_EventArgs.Payload_Only e) { TWS.Disconnect(); FireEvent(Events.Disconnected); }
private void Connected(FSM_EventArgs.Payload_Only e) { TWS.Connected(); }
private void TryConnection(FSM_EventArgs.Payload_Only e) { TWS.Connect(); }
private void btnReqData_Click(object sender, RoutedEventArgs e) { TWS.GetHistoricalData(sp500); TWS.GetHistoricalData(nq100); }
private void btnReqContracts_Click(object sender, RoutedEventArgs e) { sp500 = TWS.GetContractDetails("ES", "FUT", TWSInfo.Exchanges.Globex); nq100 = TWS.GetContractDetails("NQ", "FUT", TWSInfo.Exchanges.Globex); }