e98b31fc4c
* Update crypto entries in SPBD - Update values for GDAX and Bitfinex, with latest values from exchanges - Update symbols with >3 letters - [Fix] Remove same base-quote entries * Update unit tests Increment in precision given smaller lot sizes in SPDB crypto entries. * Add GDAX symbol properties downloader (unit test) * Update GDAX symbol properties database * Add BrokerageSymbol to symbol properties database * Update GDAX symbol properties * Address review - Rename BrokerageSymbol to MarketTicker * Add GDAX symbol mapper * Update GDAXBrokerage to use symbol mapper * Fix GDAX brokerage unit tests * Replace GDAXSymbolMapper with SymbolPropertiesDatabaseSymbolMapper * Address review - use Symbol key in dictionaries * Rename BrokerageSymbol to MarketTicker * Update unit test * Add Bitfinex symbol properties downloader (unit test) * Add Bitfinex symbol market ticker to downloader * Update Bitfinex symbol properties database * Update BitfinexBrokerage to use SymbolPropertiesDatabaseSymbolMapper * Remove Bitfinex test symbols from db * Update Binance symbol properties database * Update BinanceBrokerage to use SymbolPropertiesDatabaseSymbolMapper * Add missing Binance test case * Update symbol properties database - gdax, bitfinex, binance * Update CoinApi symbol mapper for new SPDB * Exclude Bitfinex BCH pre-2018-fork in CoinApiSymbolMapper * Remove unused properties * Add CoinApi mappings Co-authored-by: JJD <jjdambrosio@gmail.com>
66 lines
2.6 KiB
C#
66 lines
2.6 KiB
C#
/*
|
|
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
|
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
namespace QuantConnect.Securities.Option
|
|
{
|
|
/// <summary>
|
|
/// Represents common properties for a specific option contract
|
|
/// </summary>
|
|
public class OptionSymbolProperties : SymbolProperties
|
|
{
|
|
/// <summary>
|
|
/// When the holder of an equity option exercises one contract, or when the writer of an equity option is assigned
|
|
/// an exercise notice on one contract, this unit of trade, usually 100 shares of the underlying security, changes hands.
|
|
/// </summary>
|
|
public int ContractUnitOfTrade
|
|
{
|
|
get; protected set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates an instance of the <see cref="OptionSymbolProperties"/> class
|
|
/// </summary>
|
|
public OptionSymbolProperties(string description, string quoteCurrency, decimal contractMultiplier, decimal pipSize, decimal lotSize)
|
|
: base(description, quoteCurrency, contractMultiplier, pipSize, lotSize, string.Empty)
|
|
{
|
|
ContractUnitOfTrade = (int)contractMultiplier;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates an instance of the <see cref="OptionSymbolProperties"/> class from <see cref="SymbolProperties"/> class
|
|
/// </summary>
|
|
public OptionSymbolProperties(SymbolProperties properties)
|
|
: base(properties.Description,
|
|
properties.QuoteCurrency,
|
|
properties.ContractMultiplier,
|
|
properties.MinimumPriceVariation,
|
|
properties.LotSize,
|
|
properties.MarketTicker)
|
|
{
|
|
ContractUnitOfTrade = (int)properties.ContractMultiplier;
|
|
}
|
|
|
|
internal void SetContractUnitOfTrade(int unitOfTrade)
|
|
{
|
|
ContractUnitOfTrade = unitOfTrade;
|
|
}
|
|
|
|
internal void SetContractMultiplier(decimal multiplier)
|
|
{
|
|
ContractMultiplier = multiplier;
|
|
}
|
|
}
|
|
}
|