cAlgo dates obfuscated?
cAlgo dates obfuscated?
27 Mar 2013, 16:45
I am working with DLL addins with cAlgo which requires passing datetimes between the CAlgo enviroment and the DLL. It appears for some reason the datetime strings are being obfuscated when I pass a datetime from a position object to a datetime which I pass to the DLL.
position.EntryTime = openedPosition.EntryTime.;
when I test gives me a datetime with every 1month set to 0.
F
Replies
fullmonte
27 Mar 2013, 17:05
OK. I have traced the problem to the Position object in CAlgo only, it does not replicate with other Datetime variables which is wierd.
@fullmonte
fullmonte
27 Mar 2013, 17:18
protected override void OnPositionOpened(Position openedPosition)
{
Log(openedPosition.EntryTime.ToString("dd/mm/yyyy hh:mm:ss.fff"));
}
gives you 06/00/2013 07:00:02.500, which is a big of a pain in the arse tbh since need to develop a work around
@fullmonte
cAlgo_Fanatic
27 Mar 2013, 17:49
Hello,
Try this string format: "dd/MM/yyyy hh:mm:ss.fff". You need capital MM for month. Lower mm is used for minutes in this case.
Please see: Custom Date and Time Format Strings for more examples.
@cAlgo_Fanatic
fullmonte
27 Mar 2013, 17:51
Turns out CAlgo is doing it to any exposed DateTime variable created by the server that is exported. Always the same pattern, month replaced with hour.
@fullmonte
cAlgo_Fanatic
29 Mar 2013, 12:17
Hello,
Did our previous reply help you resolve this issue? I'm assuming you meant to say month is replaced by hour in your last post.
@cAlgo_Fanatic
fullmonte
30 Mar 2013, 21:56
RE:
Hello,
Did our previous reply help you resolve this issue? I'm assuming you meant to say month is replaced by hour in your last post.
I am embarrassed but I believe it will fix the problem. Bloody datetime strings drive me mad.
@fullmonte
fullmonte
27 Mar 2013, 17:00
06/22/2013 08:22:15.000 the pattern is this, you are replacing the months with the minutes s0 3 is replaced with 22 here
06/20/2013 08:20:02.500 and 20 here
If this is intentional I will no longer be using cAlgo. Please confirm what is going on.
@fullmonte