Closed dutchy54321 closed 1 year ago
i know the startDate and endDate are just strings
startDate = "20221013" endDate = "20221014"
should work but they do not. So something is wrong here.
this should work:
startDate = "20221013"
endDate = "20221014"
ticksFilename = lookupClient.Historical.File.GetHistoryTickTimeframe("@ES#",startDate,endDate,None,None,None,1)
but it does not work. So why not?
also passing them as type DateTime does not work. So I tested all types, str, int, datetime, nothing works
>>> d1 = datetime.datetime(2022, 10, 13, 9, 30, 0)
>>> d2 = datetime.datetime(2022, 10, 13, 9, 30, 0)
>>> d1
datetime.datetime(2022, 10, 13, 9, 30)
>>> d2
datetime.datetime(2022, 10, 13, 9, 30)
>>> ticksFilename = lookupClient.Historical.File.GetHistoryTickTimeframe("@ES#",d1,d2,None,None,None,1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: No method matches given arguments for GetHistoryTickTimeframe: (<class 'str'>, <class 'datetime.datetime'>, <class 'datetime.datetime'>, <class 'NoneType'>, <class 'NoneType'>, <class 'NoneType'>, <class 'int'>)
>>> type(d1)
<class 'datetime.datetime'>
well figured out the type needs to be: type: <class 'System.DateTime'>
for completion, the answer to my question is you need to load:
clr.AddReference('System.Collections')
from System import DateTime
then you can fill in the beginDate and endDate using:
d1 = DateTime(2022,10,17,9,10,10)
d2 = DateTime(2022,10,18,8,0,0)
ticksFilename = lookupClient.Historical.File.GetHistoryTickTimeframe(sym,d1,d2,None,None,None,1)
the parameters used in DatetTime are Year, Month, Day, Hour, Minute, Second
works great
@dutchy54321 please update the examples !
hi Math, you mean I post some Python code examples where I use your CSharp plugin?
so I have some testcode
now these two work:
1)
ticksFilename = lookupClient.Historical.File.GetHistoryTickDatapoints("@ES#",500,1)
2)
ticksFilename = lookupClient.Historical.File.GetHistoryTickDays("@ES#",3,None,None,None,1)
But I can not make the friqqin beginDate and endDate work. I tried many setups, here is 1:
or this:
what the hell is the trick here? Starting to PISS me off. because one can not get any reply on this. What the hell is the trick here?