mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

Streaming.Derivative #146

Closed fs4590 closed 1 year ago

fs4590 commented 1 year ago

i am trying to get 1000 tick bar interval using Streaming.Derivative . using the below code but it seems i cant get the right paramater for teh BW call ,

Dynamically add IQFeed.CSharpApiClient DLL

assembly_path = r"C:\projects\IQFeed.CSharpApiClient" import sys sys.path.append(assembly_path) import clr clr.AddReference("IQFeed.CSharpApiClient") import IQFeed.CSharpApiClient

Step 1 - Run IQConnect launcher

from IQFeed.CSharpApiClient import IQFeedLauncher dtn_product_id = "dtn_product_id " dtn_login="dtn_login" dtn_password=" dtn_password" IQFeedLauncher.Start(dtn_login, dtn_password, dtn_product_id) sym1= '@NQU22' from IQFeed.CSharpApiClient.Streaming.Derivative import DerivativeClientFactory import time DerivativeClient = DerivativeClientFactory.CreateNew() def DerivativeMessageHandler(msg): print(msg) DerivativeClient.System += DerivativeMessageHandler DerivativeClient.Error += DerivativeMessageHandler DerivativeClient.IntervalBar += DerivativeMessageHandler

DerivativeClient.ProcessMessages += DerivativeMessageHandler

DerivativeClient.Connect() DerivativeClient.ReqBarWatch(sym1,1000,None,None,None,None,None,"T",None) time.sleep(5)


but this is teh output i get Error: INVALID PARAMETERS FOR BW REQUEST Type: SERVER CONNECTED, Message: S,SERVER CONNECTED

can someone tell me what i am doing wrong please