Hi All, 

Not sure if this is a bug or I missing a switch in the command:

  1. lean data generate --start 20000101 --symbol-count 1 --security-type Equity --resolution Daily --include-coarse TRUE --market USA --update

this command generates extra columns in addition to Date+OHLC that is causing the “(String '1002900' was not recognized as a valid DateTime.)” error, feel free to correct me if I'm wrong.

here's the error:

  1. 20220511 16:29:20.521 ERROR:: CoarseUniverseGeneratorProgram.Run(): CoarseUniverseGeneratorProgram.Run(): FAILED! System.AggregateException: One or more errors occurred. (String '1004300'
  2. was not recognized as a valid DateTime.) (String '1002900' was not recognized as a valid DateTime.)
  3. ---> System.FormatException: String '1004300' was not recognized as a valid DateTime.
  4. at QuantConnect.ToolBox.CoarseUniverseGenerator.CoarseUniverseGeneratorProgram.ParseDailyFile(FileInfo dailyFile) in
  5. /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:line 333
  6. at QuantConnect.ToolBox.CoarseUniverseGenerator.CoarseUniverseGeneratorProgram.<>c__DisplayClass9_0.<Run>b__0(SecurityIdentifierContext sidContext) in
  7. /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:line 164
  8. at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
  9. --- End of stack trace from previous location ---
  10. at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
  11. at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
  12. at System.Threading.Tasks.TaskReplicator.Replica.Execute()
  13. --- End of inner exception stack trace ---
  14. at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
  15. at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3
  16. bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
  17. --- End of stack trace from previous location ---
  18. at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
  19. at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3
  20. bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
  21. at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
  22. at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
  23. at QuantConnect.ToolBox.CoarseUniverseGenerator.CoarseUniverseGeneratorProgram.Run() in
  24. /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:line 138
  25. ---> (Inner Exception #1) System.FormatException: String '1002900' was not recognized as a valid DateTime.
  26. at QuantConnect.ToolBox.CoarseUniverseGenerator.CoarseUniverseGeneratorProgram.ParseDailyFile(FileInfo dailyFile) in
  27. /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:line 333
  28. at QuantConnect.ToolBox.CoarseUniverseGenerator.CoarseUniverseGeneratorProgram.<>c__DisplayClass9_0.<Run>b__0(SecurityIdentifierContext sidContext) in
  29. /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:line 164
  30. at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
  31. --- End of stack trace from previous location ---
  32. at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
  33. at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
  34. at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
  35. 20220511 16:29:20.523 TRACE:: RandomDataGeneratorProgram(): Press any key to exit...
+ Expand

 

this how the generated data looks like in the csv: (C:\LeanCLI\data\equity\usa\daily)

177660_1652287054.jpg

Please help…

Thanks

Author

DipTrader

May 2022