IQFeed.CSharpApiClient icon indicating copy to clipboard operation
IQFeed.CSharpApiClient copied to clipboard

translate c# example to Python

Open mathpaquette opened this issue 4 years ago • 4 comments

Python is very popular these days and having the examples translated in would be useful for many.

The task is to translate these examples: https://github.com/mathpaquette/IQFeed.CSharpApiClient/tree/master/src/IQFeed.CSharpApiClient.Examples

We can merge them one by one so if you are welling to help, pick one and raise a PR. Thanks

mathpaquette avatar Aug 08 '20 11:08 mathpaquette

In re: to more python examples... I use IQFeed with Ninjatrader, and recently started manipulating data with python/pandas, and this package is great! I have figured out how to pull the daily, weekly, and monthly timeframes so far.

But am struggling with figuring out the code for intraday intervals (for example, 5min or 240min, etc).

Here is how I am pulling D/W/M timeframes:

daily = lookupClient.Historical.GetHistoryDailyDatapoints(ticker, 200) weekly = lookupClient.Historical.GetHistoryWeeklyDatapoints(ticker, 200) monthly = lookupClient.Historical.GetHistoryMonthlyDatapoints(ticker, 200)

for dailyMessages in daily: print(dailyMessages) for weeklyMessages in weekly: print(weeklyMessages) for monthlyMessages in monthly: print(monthlyMessages)

But I can't seem to figure out how to code the intervals to provide a successful data pull for intradays. An intraday example for a simple historical get history would be great (for example 5min timeframe).

Thanks for any assistance.

avalanche-zak avatar Aug 06 '22 06:08 avalanche-zak

Yes intraday would be awesome

R470R avatar Mar 22 '23 21:03 R470R

try as https://github.com/mathpaquette/IQFeed.CSharpApiClient/blob/master/src/IQFeed.CSharpApiClient.Examples/Examples/BasicFileHistorical/BasicFileHistoricalExample.cs

with lookupClient.Historical.GetHistoryIntervalDays("EURCAD.FXCM",3600,10,100)

worked for me

R470R avatar Mar 22 '23 22:03 R470R

timeframe must be in seconds ex 3600 is 1 hour

R470R avatar Mar 22 '23 22:03 R470R