mathpaquette / IQFeed.CSharpApiClient

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

Update interval doesn't work for DerivativeClient.ReqBarWatch #41

Closed PaulGlynn588 closed 5 years ago

PaulGlynn588 commented 5 years ago

You can request say 1 minute bars that are updated every 5 seconds. Currently it just ignores the update interval of 5 seconds.

The request is incorrectly formatted in DerivativeRequestFormatter.ReqBarWatch. The developer documentation says the format should be:

BW,[Symbol],[Interval],[BeginDate BeginTime],[MaxDaysOfDatapoints],[MaxDatapoints],[BeginFilterTime],[EndFilterTime],[RequestID],[Interval Type],[Reserved],[UpdateInterval]

The reserved field is not taken into account, so it should be:

$"BW,{symbol.ToUpper()},{interval},{beginDate?.ToString(DerivativeDatetimeFormat)},{maxDaysOfDatapoints},{maxDatapoints},{beginFilterTime?.ToString(DerivativeTimeFormat)},{endFilterTime?.ToString(DerivativeTimeFormat)},{requestId},{intervalType?.ToString().ToLower()},,{updateInterval}{IQFeedDefault.ProtocolTerminatingCharacters}";

Also there shouldn't be a comma before "{IQFeedDefault.ProtocolTerminatingCharacters}" for all the request types in DerivativeRequestFormatter.

mathpaquette commented 5 years ago

Thanks for reporting this! Ill give a look and fix this today!

Mathieu

From: PaulGlynn588 notifications@github.com Sent: July 22, 2019 12:47 PM To: mathpaquette/IQFeed.CSharpApiClient IQFeed.CSharpApiClient@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [mathpaquette/IQFeed.CSharpApiClient] Update interval doesn't work for DerivativeClient.ReqBarWatch (#41)

You can request say 1 minute bars that are updated every 5 seconds. Currently it just ignores the update interval of 5 seconds.

The request is incorrectly formatted in DerivativeRequestFormatter.ReqBarWatch. The devloper documentation says the format should be:

BW,[Symbol],[Interval],[BeginDate BeginTime],[MaxDaysOfDatapoints],[MaxDatapoints],[BeginFilterTime],[EndFilterTime],[RequestID],[Interval Type],[Reserved],[UpdateInterval]

The reserved field is not taken into account, so it should be:

$"BW,{symbol.ToUpper()},{interval},{beginDate?.ToString(DerivativeDatetimeFormat)},{maxDaysOfDatapoints},{maxDatapoints},{beginFilterTime?.ToString(DerivativeTimeFormat)},{endFilterTime?.ToString(DerivativeTimeFormat)},{requestId},{intervalType?.ToString().ToLower()},,{updateInterval}{IQFeedDefault.ProtocolTerminatingCharacters}";

Also there shouldn't be a comma before "{IQFeedDefault.ProtocolTerminatingCharacters}" for all the request types in DerivativeRequestFormatter.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mathpaquette/IQFeed.CSharpApiClient/issues/41?email_source=notifications&email_token=ABBICNZDFJGXGRHMMYYBHBTQAXQANA5CNFSM4IF2JPQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAVXJBQ, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABBICN6FL5INFTJ7UPLBLEDQAXQANANCNFSM4IF2JPQQ.

mathpaquette commented 5 years ago

@PaulGlynn588 please review PR