Commit Graph

97 Commits

Author SHA1 Message Date
Martin Molinero dbddeded9b Address reviews
- Add missing documentation on `CashAmount` equality operators
- Make `Holding.ConversionRate` nullable
2018-12-27 17:41:47 -03:00
Martin Molinero be5a8e820c Revert Holding change 2018-12-27 16:30:54 -03:00
Martin Molinero 8e41371e19 Non-Usd brokerage support
- `GetCashBalance()` will return a `List<CashAmount>`, will not need to
set conversion rates, which requires knowing what the account currency is.
- Removing `Global.Holding` conversion rate field. It wasn't being used
and required knowing what the account currency is.
- Adding equality operators for `CashAmount`. Adding unit tests.
2018-12-27 12:13:43 -03:00
Michael Handschuh ca747b3667 Add split warning events
This follows the pattern used by delisting events, where we send a warning event
before the start of trading on the trading day before the split will happen. This
change also adds a SplitType enum having a Warning and SplitOccurred values.
2018-01-22 22:06:30 -05:00
Jared Broad c475bde19e Increase timeout and add initialized check 2017-10-23 22:03:33 -04:00
Jared ef9a841ae1 Merge branch 'master' into gdax 2017-10-13 21:43:19 -04:00
Jared Broad b7e83fc501 Added professional plan 2017-10-11 20:29:43 -04:00
Atif Aziz 8df7fc187d Fix hour format of DateFormat.JsonFormat
Fixes #1183
2017-10-05 16:25:08 +02:00
jameschch@outlook.com 32f723d07b Fixes crypto rounding 2017-09-27 22:10:28 +01:00
12112 83fdf9c386 crypto wip 2017-07-14 16:53:42 +01:00
Stefano Raggi 2fb4847b41 Handle subscriptions for existing brokerage Option holdings 2017-05-19 15:50:45 +02:00
Anshul d2a10ef69a Code refactor, create test for individual symbols 2017-05-18 14:19:55 -04:00
Victor Baybekov 419f33ae73 Implement IEX IDataQueueHandler #773 2017-03-16 17:12:17 +03:00
quant1729 ea88b2aca4 Updated unrealized PnL rounding (2 digits) 2017-01-18 13:52:21 +08:00
quant1729 d803d812d7 Fixing wrong rounding of UnP/L in Holding class 2017-01-10 22:17:40 +08:00
quant1729 e96ddaf852 Updated Holding class with two new fields: MarketValue and UnrealizedPnL 2016-12-15 10:13:12 +01:00
quant1729 3819561a82 Merge branch 'futures' into master-futures-merged
Conflicts:
	Common/QuantConnect.csproj
	Tests/RegressionTests.cs
2016-12-01 17:32:40 +01:00
Stefano Raggi efc60aaa22 Added GetCurrencySymbol to handle unknown currencies
Also added missing CNH symbol and USDCNH pair
2016-11-16 00:39:43 +01:00
quant1729 1305d96edd Open interest support: backtesting, converters, live data handlers (IQFeed/IB), live trading (IB). First cut. Regression Test. 2016-11-15 21:33:33 +01:00
quant1729 1141cd21e6 Merge branch 'futures' into master
Conflicts:
	Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj
	Algorithm/QCAlgorithm.cs
	Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
	Common/QuantConnect.csproj
	Common/Securities/Option/Option.cs
	Data/equity/usa/factor_files/aapl.csv
	Data/symbol-properties/symbol-properties-database.csv
	Engine/DataFeeds/Enumerators/Factories/BaseDataSubscriptionEnumeratorFactory.cs
	Engine/DataFeeds/Enumerators/Factories/OptionChainUniverseSubscriptionEnumeratorFactory.cs
	Engine/DataFeeds/SubscriptionDataReader.cs
	ToolBox/QuantConnect.ToolBox.csproj
2016-11-07 16:18:11 +01:00
devalkeralia 47fb27df9b Fixed christmas dates 2016-11-04 18:38:37 -04:00
devalkeralia 90218bf571 Extended the holiday dates until 2023 2016-11-04 17:58:45 -04:00
Andrew f494653ec2 Live Algorithm Management with QC Api v2 (#577)
* Recommitted. Fixed missing code

* Renamed tests for Api to ApiTests

* Renamed Live to LiveAlgorithm

* Add LiveAlgorithm configuration classes for supported brokerages

The QuantConnect api v2 enables users to launch live algorithms with one of the supported brokerages. The LiveAlgorithmSettings class adds brokerage specific configuration classes that will allow algorithms to be configured to run live on a specific brokerage.

* Projects can now be updated via the Api v2

* Projects can be created via the Api with LiveAlgorithmSettings class

* Renamed CreateLive to CreateLiveAlgorithm in IApi

* Added tests for luanching live algorithms via api V2 for brokerages

* Created ProjectUpdateResponse to represent api response when project is updated

The new class ProjectUpdateResponse derives from RestReponse and adds a field, Files, that represents the project files associated with a project.   This new class is now what the Api method returns.  A new test, Update_ProjectFiles_Successfully, tests updating the files for a project via the Api

* Refactored ApiTests and expanded ApiTest docs

* Renamed brokerage specific classes that derive from BaseLiveAlgorithmSettings

* Refactored Oanda and Tradier LiveAlgorithm settings

Tradier and Oanda do not required certain parameters like password and username to trade live, however, they are required for the QC Api v2.  A new constructor was added to BaseLiveAlgorithmSettings that does not take in these parameters and sets the unneeded parameters to blank strings.  Tradier and Oanda LiveAlgorithmSettings  implement this new constructor.

* Minor tweaks to OandaLiveAlgorithmSettings

* Brokerage Api tests now use appropriate algorithms

Some brokerage tests were using algorithms that traded securities that did not pertain to the brokerage.  This has been corrected.

* Refactored naming of certain Api methods to be more consistent

* Added extra parameters to Api method ListLiveAlgorithms

* Added class that represents chart data from "live/read" api endpoint

* Minor change to LiveAlgorithmResults

* Version is now an optional parameter for LiveAlgorithmApiSettingsWrapper

* Minor formatting changes to long method signatures in Api.cs

* IApi now accepts versionId for CreateLiveAlgorithm

* Removed BrokerageName from LiveAlgorithmSettings.

* Fixed spelling mistake

* Added custom JsonConverter for LiveAlgorithmResults

In order to properly deserialize the results of an algorithm from the api endpoint "live/read", a custom deserializer is added to deal with null ChartPoints.  In order to deserialize ChartPoints that are null, ChartPoint has been changed from a struct to a class.

* Fixed type-o in ApiTests

* Add Ignore NUnit attribute to ApiTests

* Removed ApiAlgorithmStatus

In order to better align with the rest of the project, ApiAlgorithmStatus has been replaced by the existing AlgorithmStatus enum.  Only certain values of AlgorithmStatus can be used with the Api.  Unsuported values throw an ArgumentException error.

* Changed Resolution field in LiveAlgorithmResults from string to enum

* BrokerageEnvironment enum added to represent live/paper trading

* Environment set based on user in InteractiveBrokersLiveAlgorithmSettings

* Minor tweaks to BaseLiveAlgorithmSettings constructor

* Environment is hard coded for TradierLiveAlgorithmSettings

* Updated ApiTests to reflect changes to LiveAlgorithmSettings

* ApiConnection uses OrderJsonConverter to deserialize orders

* AlgorithmStatus is now nullable for ListLiveAlgorithms

* Tweaked account variable for InteractiveBrokersLiveAlgorithmSettings

* Replaced null comparisons with call to HasValue for LiveAlgo status
2016-10-03 15:03:37 -04:00
quant1729 f89ea2183f Added real-time support for futures. Tested with IQFeed, IB. 2016-09-28 19:10:03 +02:00
quant1729 dd72878d2c Implementing futures support. Future, FutureCache, Futures Chain, Futures Universe classes and more 2016-09-26 13:56:02 +02:00
quant1729 2dce74e26d - Extended Option security and Option holding classes
- Updated IB fee model to support option exercise
- Added support for splits for options. Not tested on real data yet.
- Added option exercise functionality for long positions. Unit Tests. Not tested on real data yet.
- Added option assignment functionality for short positions. Assignment event. Unit Tests.
- Added basic option assignment simulator for backtesting brokerage. Simulates assignments for deep ITM short positions close to expiration. Unit Tests.
2016-08-31 18:00:00 +02:00
Michael Handschuh 0db7c7d95f Adds various option data types
FirstOrderGreeks
OptionChain/s
OptionContract/s
QuoteBars
MarketDataType.OptionChain
2016-04-07 13:39:22 -04:00
Michael Handschuh 5906cdffa5 Simplifies some if/switches for ConversionRate 2016-02-16 13:26:04 -05:00
Michael Handschuh a6a6699b3a Removes Cfd.QuoteCurrencySymbol/Forex.QuoteCurrencySymbol 2016-02-16 13:26:03 -05:00
Stefano Raggi f620743126 Removes SecurityHolding argument from Holding constructor 2016-02-02 01:25:28 +01:00
Stefano Raggi ffb5ceae18 Adds Security argument to Holding class
Also removed Security get property from SecurityHolding
2016-02-01 23:29:09 +01:00
Stefano Raggi 932b757a1b Remove Cfd.GetQuoteCurrency(Symbol) 2016-01-24 16:29:52 +01:00
Stefano Raggi 6bea453b23 Move CurrencyPairs and CurrencySymbols into Currencies class 2016-01-21 17:57:49 +01:00
Stefano Raggi 45a19479da Adds CFD support to Holding class 2016-01-20 22:28:11 +01:00
QuantConnect 33c8376c65 Version bump and Holding Symbol json encoding change 2015-12-08 13:33:04 -05:00
snugs 80d894c41e Change Holding.Symbol to be of type Symbol 2015-11-18 12:55:40 -05:00
snugs a4a195880e Adds SecurityIdentifier type 2015-11-12 13:55:38 -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 7630eaf357 Remove AlgorithmStatus.Quit, merged into Stopped 2015-11-06 20:31:40 -05:00
AlexCatarino a1837105a4 Reduced parameters in QuoteBar constructor. 2015-10-31 17:35:37 -04:00
AlexCatarino 8e1d4bb3a0 Creates IBar interface and Bar class that implement OHLC object. Includes IBar to TradeBar object. Introduce QuoteBar object to deal with Bid and Ask bars. 2015-10-31 17:35:35 -04:00
snugs 37ce881e40 Add status messages to IHistoryProvider 2015-09-18 14:51:31 -04:00
snugs 4ae1f4f5b6 Finalizes History API
Fixes bug in backtest history provider

	Requests for bar counts were always incorrect because the history provider
	was emitting bars whose end time is equal to the start time.
	Implemented a FilterEnumerator<T> privately so he can filter those out
	when using non-tick data
2015-09-15 15:40:54 -04:00
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs df79ce30c2 Adds the Symbol type
This includes updating all usages of symbol as a security identifier to use the new type.
The type includes a unique field, SID, as well as the current ticker's value. This allows
for consistent addressability while also allowing the ticker to evolve over time with the
mapping changes.

Effort was made to maintain compile and runtime backwards compatibility.
2015-09-01 22:17:10 -04:00
snugs 9ec0aa3ba3 Add ChannelStatus to algo status packet 2015-08-13 18:25:18 -04:00
snugs 2c1a00fa23 Implements Delisting events in the algorithm
This change adds OnData(Delisting data) event handler to the algorithm and is fired when a security gets delisted.
Likewise, when a security is delisted, data will stop being sent into the algorithm and if the algorithm has any
holdings then a MarketOnClose order is submitted at midnight on the last day of trading. If you require that the
algorithm does not sell its shares, then you must cancel the MarketOnClose order before close of trading.
2015-07-29 13:21:25 -04:00
QuantConnect 454b0877b9 Multi language support enum 2015-06-29 11:55:08 -04:00
QuantConnect 26e8cf4a21 Rework liquidity provider & country code to generic Market class, commented out python buggy code 2015-06-18 20:18:51 -04:00
snugs 3636124c5e Misc edits from code review
Removed unused BaseDataFeed and IQFeedDataFeed
Add catch for NullReferenceException in stream store
ConsoleSetupHandler now throws on live jobs, use BrokerageSetupHandler
Renamed/moved FixedSizedQueue to Util\FixedSizeQueue
2015-06-18 17:19:36 -04:00