Commit Graph

318 Commits

Author SHA1 Message Date
snugs ba710ae7b1 Change default min time in universe to 1 day 2015-12-17 14:56:24 -05:00
snugs 0f599f5697 Reverts preventing set cash in live mode
We were leaning on BrokerageData having project equity in there, but
this breaks home consumers who would expect the SetCash function to
just work
2015-12-15 14:39:38 -05:00
snugs 0fbab8a550 Check SymbolCache when adding securities, enables delisted 2015-12-15 08:58:15 -05:00
snugs ada41f7e8f Adds MinimumTimeInUniverse to UniverseSettings 2015-12-14 19:13:24 -05:00
snugs a29ebf0595 Rename SubscriptionSettings to UniverseSettings 2015-12-14 16:58:18 -05:00
snugs 957fba1ea5 Disable SetCash in live mode
If required, use Portfolio.SetCash, this is what the setup handler now uses
2015-12-11 16:41:30 -05:00
snugs 53a64ea3ba Use default market map in AddSecurity 2015-12-10 15:19:23 -05:00
snugs 8dad5f4c0a Adds IAlgorithm.SetDefaultMarkets 2015-12-10 15:19:21 -05:00
snugs bc6ffbce0c Set algorithm parameters from job packet 2015-12-10 13:45:40 -05:00
snugs b167b7725d Adds GetParameter and SetParameters to IAlgorithm 2015-12-10 13:45:39 -05:00
snugs f3834df1a0 Return Security instance from IAlgorithm.AddSecurity 2015-12-09 13:32:37 -05:00
snugs 565c3bc6f7 Adds AddRemoveSecurityRegressionAlgorithm 2015-12-09 13:32:34 -05:00
snugs fa12434f98 Remove locked check from AddSecurity
This now allows algorithms to add securities during a running algorithm
2015-12-09 13:32:31 -05:00
snugs 3a322e0877 Change IAlgorithm.Universes to use UniverseManager type 2015-12-09 13:32:29 -05:00
snugs 7e37804c7e Use Symbol.Create instead of SID.Generate* methods 2015-12-07 12:31:46 -05:00
snugs 796b9666db Adds QCAlgorithm.Universe for universe functions 2015-12-07 12:02:07 -05:00
snugs 242f479fb3 Remove SetUniverse, now only AddUniverse 2015-12-07 12:02:07 -05:00
snugs be950e756a Log full errors/stack traces
Many places in the code used Log.Error(err.Message) or equivalent which
strips out all the really useful information, such as the stack trace
and inner exceptions. Using Log.Error(exception) is the correct way to
log an error as it will correctly write all the message details, also,
by passing the full Exception object we can improve the logging in this
one place and all call sites will automatically benefit from the improvements
2015-12-02 12:35:33 -05:00
snugs c6d0fc673b Force custom securities through CreateSecurity
AddData<T> was never properly converted to go through the SecurityManager.CreateSecurity
method which led to custom symbols not being loaded into the symbol cache.
2015-12-02 10:58:26 -05:00
snugs 95bfe729a8 Adds ExchangeTimeZone to SubscriptionDataConfig 2015-12-01 12:03:00 -05:00
snugs 8621c3ad8e Review usages of GetExchangeHours, use correct tz property 2015-11-30 18:20:21 -05:00
snugs 75a81f581e Rename SecurityExchangeHoursProvider to MarketHoursDatabase 2015-11-30 16:50:09 -05:00
Stefano Raggi be65ccda10 Brokerage message events on IAlgorithm
Added the following virtual methods:
- OnBrokerageMessage(BrokerageMessageEvent)
- OnBrokerageDisconnect()
- OnBrokerageReconnect()
2015-11-26 22:35:25 +01:00
snugs 5161dc9dd0 Use Market string constants instead of literals 2015-11-23 13:55:58 -05:00
snugs 43fc0a2d6d Cleans up some methods accepts Symbol, sec type/market 2015-11-19 20:16:03 -05:00
snugs 9e660ffcbe Remove usages of Symbol implicits from non-algorithm projects 2015-11-18 18:15:31 -05:00
snugs f788e9595f Use string in AddData<T> 2015-11-18 17:05:33 -05:00
snugs 18edd22e68 Rename SymbolCache.Get to SymbolCache.GetSymbol 2015-11-18 12:55:49 -05:00
snugs b870c55328 Adds Symbol(string) function shortcut for SymbolCache.Get(string) 2015-11-12 13:55:44 -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
snugs 7b6c82841f Initial implementation of SecurityIdentifier 2015-11-12 13:55:42 -05:00
Stefano Raggi 01afc560f4 Added Settlement models
- New ISettlementModel interface with implementations:  ImmediateSettlementModel + DelayedSettlementModel
- SecurityPortfolioManager: UnsettledCashBook + ScanForCashSettlement
- Added tests for settlement models
- Added GetSettlementModel to IBrokerageModel
- Added AccountType argument to SetBrokerageModel()
- Added SetBrokerageModel(IBrokerageModel) overload
- Made BrokerageModel setter private
2015-11-11 22:18:34 -05:00
snugs d696f09b28 Adds IAlgorithm.Status
AlgorithmManager._algorithmState was removed and replaced with
pass through to IAlgorithm.Status
2015-11-09 11:18:41 -05:00
snugs 15a86a1dcf SetBenchmark use configured security type if exists 2015-11-03 14:31:35 -05:00
snugs 4521a9aea3 Improve disconnect handling logic
No need to kill the algorithm if there's no open exchanges, wait
at least 15 minutes before killing algo (same as before with IB)

This logic is now centralized via an IBrokerageMessageHandler

Includes two new BrokerageMessageType
    Disconnect
    Reconnect

These messages should be used when a disconnect happens and again when we're reconnected
to tell the message handler the current state
2015-10-29 20:18:22 -04:00
snugs 93fb8a1f59 Adds IBrokerageMessageHandler and DefaultBrokerageMessageHandler
Removed ISetupHandler.SetErrorHandler, this is replaced by

brokerage.Message += (sender, message) => algorithm.BrokerageMessageHandler.Handle(message)

allowing algorithm direct access to managing the brokerage messages
2015-10-29 20:14:31 -04:00
Stefano Raggi f506ad5036 Initial implementation of FxcmBrokerage 2015-10-23 17:29:53 -04:00
snugs df14e885ac Move OandaBrokerage model to Common
Also adds BrokerageName.OandaBrokerage and supports it from QCAlgorithm.SetBrokerageModel(...)
2015-10-23 16:00:07 -04:00
snugs 8014da3640 Adds Custom universe API methods 2015-10-21 13:05:17 -04:00
snugs f296d666ee Implements user defined universes
This places all security subscriptions within a universes
Subscriptions generated via calls to AddSecurity are place in a UserDefinedUniverse
UserDefinedUniverse will serve up a predetermined list of symbols on a requested interval
LiveTradingDataFeed - reworked custom enumerators to use RefreshEnumerator as wrapper for rate limitting
2015-10-21 13:05:17 -04:00
snugs 678cd38fc5 Add Time.MaxTimeSpan to mirror Time.EndOfTime for time spans 2015-10-21 13:05:13 -04:00
snugs 6f15f4139b Move all subscriptions into a universe 2015-10-21 13:05:11 -04:00
snugs 68676a3dab Change IUniverse -> abstract Universe class 2015-10-21 13:05:10 -04:00
snugs 0e2f1fc1c0 Fixes bone-head start/end bug :/ 2015-10-15 17:54:05 -04:00
snugs 1e4114dc1e Don't allow algo to set start/end dat in live mode
Start and end date in live mode should be set using current time values
2015-10-15 17:21:24 -04:00
snugs 18066b86a6 Various fixes for live coarse
Set Start/EndDate in live mode properly
Adds helper to create CoarseFundamental symbols
Dispose of removed subscriptions properly
Remove time slice rounding
Subscribe to the coarse symbols to get data into the exchange
2015-10-15 13:44:49 -04:00
snugs 8f325e9c39 Add qc- prefix to universe subscriptions 2015-10-07 12:54:31 -04:00
snugs 4eb29a23f5 Generalize IUniverse selection method 2015-10-07 12:54:30 -04:00
snugs c31eb7fa65 Adds support for multiple universes
This is a scaffolding step in that live will only use the first in the list
Also, there's no API helpers for doing this and it's assumed it's only coarse
fundamental data, the next change removes the coarse fundamental assumptions
2015-10-07 12:54:29 -04:00
snugs dec42959a8 Adds SubscriptionSettings and Configuration to IUniverse 2015-10-07 12:54:28 -04:00