Commit Graph

1000 Commits

Author SHA1 Message Date
AlexCatarino 9774af9adc Custom Data for Python Support 2017-02-09 17:48:50 -02:00
Stefano Raggi 5d10fcaa9e Do not submit orders during warmup 2017-01-17 23:41:25 +01:00
AlexCatarino 914475e26d PythonWrappers namespacing to match the project/directory structure
- PythonWrappers namespacing to match the project/directory structure
- Adds null checks to SetHistoryProvider and SetRunTimeError
2017-01-12 18:12:59 -02:00
Andrew Hart d3d5baf3ad Changed signerature of SecurityManager.CreateSecurity() 2017-01-12 14:55:06 -05:00
AlexCatarino 74194d6aca Few tweaks:
- Uses QuantConnect.pythonnet nuget pachage
- Python file location loaded from config
- Remove unnecessary if-null in QCAlgorithm's SetHistoryProvider and SetRunTimeError
2017-01-12 14:21:39 -02:00
AlexCatarino 437b435282 Updates pythonnet nuget package to latest version
The latest version included "targets" that enables the inclusion of Python.Runtime.dll.config into the output directory automatically from the nuget package.
2017-01-11 16:01:49 -02:00
AlexCatarino 68fd8a4120 New Python Support Framework
Initial commit
2017-01-10 16:12:19 -02:00
Andrew Hart 544452853b QCAlgorithm.History.GetLastKnownPrice does not issue history request for Cacnonical securities
QCAlgorithm.History.GetLastKnownPrice sets the securityType on the history request.
2017-01-06 15:56:40 -05:00
Stefano Raggi a0dac817ef Revert commit cb8f451 2017-01-06 15:41:52 +01:00
Jared d5cc022867 Merge pull request #675 from QuantConnect/master
Merge with master
2017-01-05 12:12:40 -05:00
Stefano Raggi cb8f451ebb Disable margin calls by default in live mode 2017-01-05 15:09:32 +01:00
Andrew Hart 5a633df6e9 Make xml comment file names consistent across projects
For project that have xml comment files, make the comment file end with .xml instead of .Xml or .XML.
2016-12-30 16:18:54 -05:00
quant1729 5a57b4d25b Merge branch 'futures' 2016-12-29 22:12:58 +01:00
Jared 01fcbb9339 Merge pull request #663 from StefanoRaggi/setholdings-divzero-fix
Add check for zero unitprice in SetHoldings
2016-12-21 10:45:38 +13:00
Stefano Raggi 8cbb8051c1 Add check for zero unitprice in SetHoldings
Prevents possible DivideByZeroException with non-USD Forex pairs at Tick resolution
2016-12-20 17:42:02 +01:00
quant1729 705024cd89 Merge branch 'futures'
Conflicts:
	Common/QuantConnect.csproj
2016-12-20 15:53:24 +01:00
Stefano Raggi 8b946a8fd1 Add Volume property to HeikinAshi indicator
This makes volume available to indicators chained to HeikinAshi, as requested here:
https://www.quantconnect.com/forum/discussion/1566/getting-volume-in-a-heikin-ashi-tradebar
2016-12-19 20:40:37 +01:00
Jared dd7de8dcaf Merge pull request #649 from StefanoRaggi/live-fine-fundamental
Universe selection with FineFundamental filtering - backtesting and live
2016-12-15 06:50:23 +13:00
Stefano Raggi 8af8a74a55 Use Minute as the minimum resolution in GetLastKnownPrice 2016-12-09 17:52:10 +01:00
Stefano Raggi de037ad4ef Universe selection with FineFundamental filtering - backtesting and live 2016-12-06 15:44:41 +01:00
quant1729 2df14b7d0d Merge branch 'futures' into master-merge-new-updates
Conflicts:
	Engine/Engine.cs
	Launcher/Program.cs
2016-12-02 12:43:46 +01:00
Andrew Hart d81b436b30 Added BrokerageModelSecurityInitializerTests
Renamed ISeedSecurity GetLastData to GetSeedData

Renamed QCAlgorithm.History.GetSingleBarHistory to GetLastKnowPrice

Minor Style refactor
2016-12-01 11:55:48 -05: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
Andrew Hart 54df455813 Added ISecuritySeeder to seed security prices when securities are created
FuncSecuritySeeder implements this new interface and is used in BrokerageModelSecurityInitializer to seed new securities with a price when they are created. FuncSecuritySeeder uses a new method,  GetSingleBarHistory, in QCAlgorithm.History to get the last price from the history provider.
2016-12-01 08:37:04 -05:00
quant1729 92a3be5ea5 Merge branch 'futures-quotebar-easy' into futures
Conflicts:
	Common/Securities/SecurityManager.cs
2016-11-28 14:46:46 +01:00
quant1729 55299e60fb Added new constructors to IBMapper class
Added support for history requirements, exposed by vol models. AM processes requirements.
Added new volatility model - standard deviation of returns - default vol model. Compared its results with publicly available.
Refactored option pricing engine to support optimal approximation calculations.
Added basic greeks approximation in case they are not available in QL. Tests.
Updated BasicTemplateOptionHistoryAlgorithm to print greeks.
2016-11-25 15:11:01 +01:00
Andrew Hart e5377bdd82 Options/Futures ChainUniverse uses AvailableDataTypes to create subscriptions 2016-11-23 15:25:58 -05:00
Andrew Hart c71a55f7a9 AvailableDataTypes is now part of SubscriptionManager 2016-11-23 13:42:55 -05:00
Andrew Hart f78831d629 Forex now defaults to QuoteBar data feeds and is backwards compatible with TradeBars 2016-11-21 16:41:44 -05:00
Andrew Hart 21b3196991 Refactor AvailableDataFeeds to public field on IAlgorithm 2016-11-21 15:09:36 -05:00
Andrew Hart 81fe2a94cb Data formats (Trade/Quote) are configurable for each security 2016-11-18 15:30:54 -05:00
Michael Handschuh 5809527a95 Scan consolidators to emit based on time
Currently, most consolidators rely on receiving a piece of data after
the consolidation period before firing the consolidated event. This
introduces a lag in the results. We've mostly gotten around this  for
the most common case through usage of the IdentityConsolidator.

The issue arises when considering fill forward behavior and subscriptions
with different resolutions.

Consider a Minute subscription a Daily subscription. Default behavior will
fill forward that daily bar on every minute. If your indicator is based on
the IdentityConsolidator, then it will receive the same price update for
each minute the security trades that day.

By scanning the consolidators based on time, the consolidator is able to
determine that it is indeed time for it to emit a new consolidated bar.
This removes the need for the IdentityConsolidator while also fixing the
aforementioned bug.
2016-11-15 23:36:26 -05:00
Michael Handschuh 591f6b2127 Use IBaseData in type constraints
Refactors existing consolidators, indicators, and helper methods to depend on
IBaseData instead of BaseData. These updates also defines an IBaseDataBar to
act as an abstraction point between TradeBar and QuoteBar.
2016-11-09 09:20:16 -05: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
Stefano Raggi b6a96c38c1 Fix benchmark subscription when same symbol added later
This change handles subscriptions when adding/removing the benchmark symbol from OnData or in universe selection.
2016-10-17 23:41:12 +02:00
Alexandre Catarino 47a75771c6 Implements the RegressionChannel indicator (#584)
* Adds Intercept and Slope members in LeastSquareMovingAverage

* Implements the RegressionChannel indicator

The Regression Channel indicator extends the LeastSquaresMovingAverage with the inclusion of two (upper and lower) channel lines that are distanced from the linear regression line by a user defined number of standard deviations.
Adds tests.

* Renames Regression Channel properties

Remove *Line from Regression Channel properties
Adds reference

* Adds RegressionChannelAlgorithm

Adds RegressionChannelAlgorithm
Minor changes on the indidicator
Adds tests for the channels

* Intercept and Slope becomes IndicatorBase instead of WindowIndicator

* Fix LSMA Next Value calculation
2016-10-10 11:48:09 -04:00
quant1729 a1c35422ea Added trading calendar supporting option expirations, future expirations, holidays, weekends. First cut. Tests. 2016-10-08 16:34:05 +02:00
Juan José D'Ambrosio 96d9aeae4e Parameterless contructors for some CandleStickPatterns (#569)
* Parameterless constructors to CandleStickPatterns.

* LOGR method fixed.

* LogR fix... really.

* .gitignore reverted.
2016-09-29 18:02:07 -04:00
quant1729 f89ea2183f Added real-time support for futures. Tested with IQFeed, IB. 2016-09-28 19:10:03 +02:00
AlexCatarino 183cb917fe Makes IAlgorithm Debug/Error/LogMessages a ConcurrentQueue
IAlgorithm DebugMessage, ErrorMessage and LogMessage are now ConcurrentQueue<string> instead of List<string> because List.Add is not thread safe.
Copying a list (using ToList()) at LiveTradingResultHandler while adding an element to it at QCAlgorithm caused a runtime error.
2016-09-27 14:02:28 -03:00
quant1729 dd72878d2c Implementing futures support. Future, FutureCache, Futures Chain, Futures Universe classes and more 2016-09-26 13:56:02 +02:00
Andrew Hart a8621ba99c Default security markets are specified in BrokerageModel.DefaultMarkets
The default value for the market parameter in AddForex, AddOption, AddEquity and AddCfd is null.  This allows unspecified markets to be set from the BrokerageModel.DefaultMarkets in the AddSecurity method for new securities added with these methods.  SetBrokerageModel updates BrokerageModel.DefaultMarkets and therefore the market used for all new securities.
2016-09-22 14:50:48 -04:00
AlexCatarino 82d81108ad Implements price variation models
Implements IPriceVariationModel interface which takes the security object and returns a decimal variation
Implemets SecurityVariationModel class: default implementation of IPriceVariationModel that returns a fixed value (read from symbol-properties-database) for decimal variation
Implemets EquityVariationModel class: implementaion of IPriceVariationModel that returns a decimal variation as a function of equity price
Implemets AdjustedPriceVariationModel class: implementaion of IPriceVariationModel that returns zero
Adds unit test
2016-09-20 15:36:04 -03:00
quant1729 b3590647b5 Support for option strategies in API, QL option pricing models:
- Added OptionStrategies class with 10 popular option strats
- Defined OptionStrategy class
- Added support for trading of option strategies in QCAlgorithm.Trading.cs
- Added several estimator interfaces to introduce QL pricing models extention points: IDividendYieldEstimator, IRiskFreeRateEstimator, IUnderlyingVolatilityEstimator provided default implementation (flat term structure)
- Added QLOptionPriceModel class that contains meat of the calculations
- Added OptionPriceModels class that exposes 12 popular option pricing models to the user: those include Black Scholes, Barone-Adesi Whaley, Bjerksund Stensland, Crank Nicolson FD, Binomial Trees and more.
- Modified Greeks class to support lazy evaluation and introduce IV
- Partially tested on live data and trading (IQFeed/IB) and backtests. Need more data for tests.
2016-09-20 17:14:25 +02:00
Stefano Raggi c59a1776b0 Add new overload for AddUniverse with fine fundamental selection
Accepts a predefined universe instead of a coarse selection function
2016-09-20 16:07:21 +02:00
quant1729 5b2b4753d4 Added support for basic option strategies 2016-09-18 21:26:38 +02:00
quant1729 0396841d82 - Added support for sourcing and caching the full symbol list from IQFeed website.
- Added IQFeed options support to toolbox: option chain universe, option symbol list, subscriptions, live prices
- Added LiveTradingDataFeed to support options live screaming
- Added IB live options trading support: trading orders, holdings, live option exercising
- Modified ISymbolMapper interface to support derivatives (options, futures)
- Fixed minor bugs with (introduced ealier) symbol changes for options
Tested with IQFeed version 5.2.4.2. IB TWS offline version 957.
2016-09-14 21:56:12 +01: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
jameschch@outlook.com befbfc20ca merge latest upstream 2016-07-26 20:03:03 +01:00
Stefano Raggi 81e723405f Merge branch 'master' into fundamental 2016-07-18 21:44:53 +02:00