Commit Graph

13 Commits

Author SHA1 Message Date
Michael Handschuh 6362d101c1 Append type to custom data symbol
This is being done in an effort to prevent symbol collisions within the
custom data (SecurityType.Base) namespace. The custom data type's name,
is used for disambiguation. As written, this change will break several
user algorithms that still rely on using the implicit string -> Symbol
lift. Providing this type information is optional an currently only being
used by AddData<T> methods. Other consumers of SecurityType.Base symbols
arn't at risk for collision, such as the UserDefinedUniverse, ScheduledUniverse
and others that are LEAN controlled. In order to maintain backwards compatibility,
the SymbolCache was updated to do a hard search when the requested ticker was
not found, looking for the prefix ('ticker.').

Fixes #3332
2019-09-24 10:34:35 -03:00
Michael Handschuh d709d1c4e0 Update Common to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 14:13:24 -04:00
Michael Handschuh 3e93158713 Use proper exception types
The `NullReferenceException` type is intended to only be thrown by the CLR.
In most cases, it should be converted to an `ArgumentException` or an
`InvalidOperationException`, depending on if the null value is a parameter
to the current method or not.

The `Exception` type should never really be thrown as it doesn't provide any
additional information or hints as to the issue. It also forces users that
would like to handle expected exceptions to catch all exceptions. These are
converted to an exception type that more accurately describes the reason for
raising the exception: `KeyNotFoundException`, `InvalidOperationException`
2019-08-16 18:07:30 -03:00
Michael Handschuh 8ffeafae51 Adds SymbolCache.TryRemove methods 2016-04-07 14:18:10 -04:00
snugs 8a2c24f8a6 Update SymbolCache to check for SID string on resolution 2015-11-24 18:25:46 -05:00
snugs 87b0b4b064 Adds SymbolCache.Clear 2015-11-23 13:11:23 -05:00
snugs 1c3bfd6a4d Change error message in SymbolCache
Also fixes typo in doc
2015-11-19 19:12:48 -05:00
snugs 9e660ffcbe Remove usages of Symbol implicits from non-algorithm projects 2015-11-18 18:15:31 -05:00
snugs a38373ed29 Adds SymbolCache.TryGetSymbol and TryGetTicker 2015-11-18 12:55:50 -05:00
snugs 18edd22e68 Rename SymbolCache.Get to SymbolCache.GetSymbol 2015-11-18 12:55:49 -05:00
snugs 9f7e1964ff Make Symbol implicit operators inverse operations
Having a symbol implicit to string and then string to symbol must be
inverse operations, consider the case we pass Symbol data.Symbol to a
method expecting a string, and then that same method invokes another
method expecting a Symbol, we'll need it to resolve back to the original
symbol.
2015-11-18 12:55:48 -05:00
snugs 5ed2bc2ac1 Backwards compatible Symbol json
Rename SymbolCache.Add to SymbolCache.Set as well
2015-11-16 13:44:09 -05:00
snugs 8f9a228e0c Remove usages of Symbol implicits from engine
Breaks SymbolCache into its own file
2015-11-12 13:55:43 -05:00