Commit Graph

24 Commits

Author SHA1 Message Date
Martin Molinero e1482c50c2 Validate TimeRules.Every TimeSpan
- Will verify `TimeSpan` is not zero or less, adding unit tests.
2019-06-28 13:02:21 -07:00
Martin Molinero defe063647 Adding ToString for ScheduledEvent 2018-12-18 16:58:27 -03:00
Martin Molinero 0933da9303 Refactor previous commits
- Removing `AccountCurrency` from `Cash` and `Brokerage` classes.
`ICurrencyConverter` will now provide the `AccountCurrency`
- Adding new static `OrderFee.Zero` which will return a 0 order fee in
`NullCurrency`
- Adding static `Currencies.USD` value, replacing all "USD".
- Addin new static `Currencies.NullCurrency`
- Updating Bitfinex `FeeModel` so it return fees in quote currency.
Adding unit tests
2018-12-13 11:30:40 -03:00
Martin Molinero 75ffa300f1 Adding new IAlgorithm.AccountCurrency
- Adding new `IAlgorithm.AccountCurrency { get; }` that will point to the
`Portfolio.CashBook.AccountCurrency`. Setter will be added in a
following PR.
- Base `Brokerage` class will now have a `AccountCurrency { get }`
pointing to the `IAccountCurrencyProvider`. Will be used by the different
brokerages implementations.
2018-12-10 11:59:02 -03:00
Michael Handschuh 20133d40d1 Add ICurrencyConverter to Security constructors
Security instances will require private access to this value in order to
compute close profit.

NOTE: The extent of these changes for simply adding a constructor argument
insinuates that we're missing an abstraction to manage the construction of
these objects, such as a factor object for Security. This will need some
careful TLC in the near future.
2018-10-10 11:17:12 -04:00
Stefano Raggi 63fd54097b Add schedule manager test for duplicate events 2018-03-08 09:02:20 +01:00
Stefano Raggi 91ba63529b Remove Guid string from ScheduledEvent.Name
Fixes #1674
2018-03-07 21:33:33 +01:00
Stefano Raggi a8fc134c57 Support for scheduled events with same names or date/time rules
Fixes #1061
2018-02-05 11:53:09 +01:00
Stefano Raggi df925c4e3c Add new scheduler DateRules
- MonthEnd(): fires on the last day of each month
- MonthEnd(Symbol): fires on the last tradeable date for the specified symbol of each month
- WeekStart(): fires on Monday each week
- WeekStart(Symbol): fires on the first tradeable date for the specified symbol of each week
- WeekEnd(): fires on Friday each week
- WeekEnd(Symbol): fire on the last tradeable date for the specified symbol of each week
2017-12-12 12:32:06 +01:00
jaredbroad 77a511f99c Remove associated tests for negative time rules 2017-02-10 11:29:34 -05:00
quant1729 ecb95bb59c Changed time rules to explicitly require a user to specify only positive numbers in offsets for both live and backtest modes. Tests. 2017-02-08 18:04:56 +08:00
quant1729 145ba7bd83 Updated code as per PR 2017-01-02 19:47:23 +01:00
Michael Handschuh 38248d641e Adds symbol properties to Security ctor 2016-02-16 13:26:02 -05:00
Michael Handschuh 0042586b6a Adds quote currency to Security ctor 2016-02-16 13:26:00 -05:00
Michael Handschuh 96a5e76729 Adds IBrokerageModel.GetLeverage(Security)
Also removes leverage as Security ctor parameter
2016-01-19 14:20:23 -05:00
snugs 95bfe729a8 Adds ExchangeTimeZone to SubscriptionDataConfig 2015-12-01 12:03:00 -05:00
snugs 75a81f581e Rename SecurityExchangeHoursProvider to MarketHoursDatabase 2015-11-30 16:50:09 -05: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 3ad5540a8a Remove dependency on Security from SubscriptionDataReader
Add dynamic data flag to config
Remove dynamic data flag from Security
Rename dynamically loaded flag to IsCustomData
Remove Security from SubscriptionDataReader ctor
2015-09-15 15:40:12 -04:00
snugs 836cbbaa38 Remove IsTradeBar/HasVolume from sub data config 2015-08-12 14:43:23 -04:00
snugs 8380da11cf Adds fluent interface for scheduled events
Algorithms can now use syntax like the following to define events:
Schedule.Event(name).{DateRuleMethod}.{TimeRuleMethod}.Run( lambda )

For example: Schedule.Event(tues).Every(DayOfWeek.Tuesday).AfterMarketOpen(SPY, 20).Run(MyTuesdayHandler);
2015-08-11 10:51:58 -04:00
snugs 730430b1bb Adds scheduling feature
Adds the ScheduleManager which allows an algorithm to add/remove scheduled events
Check out the ScheduledEventsAlgorithm for syntax
ScheduledEvents are at their core an IEnumerator<DateTime> that defines the event times coupled with a callback
IDateRule defines dates for events
ITimeRule defines time(s) on a given date for events
2015-08-10 10:56:14 -04:00