1 Star 0 Fork 1

jufeng9318/StockSharp

forked from yu3a/StockSharp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Security.cs 44.52 KB
一键复制 编辑 原始数据 按行查看 历史
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084
#region S# License
/******************************************************************************************
NOTICE!!! This program and source code is owned and licensed by
StockSharp, LLC, www.stocksharp.com
Viewing or use of this code requires your acceptance of the license
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
Removal of this comment is a violation of the license agreement.
Project: StockSharp.BusinessEntities.BusinessEntities
File: Security.cs
Created: 2015, 11, 11, 2:32 PM
Copyright 2010 by StockSharp, LLC
*******************************************************************************************/
#endregion S# License
namespace StockSharp.BusinessEntities
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using Ecng.Collections;
using Ecng.Common;
using Ecng.ComponentModel;
using Ecng.Serialization;
using StockSharp.Messages;
using StockSharp.Localization;
/// <summary>
/// Security (shares, futures, options etc.).
/// </summary>
[Serializable]
[System.Runtime.Serialization.DataContract]
[DisplayNameLoc(LocalizedStrings.SecurityKey)]
[DescriptionLoc(LocalizedStrings.Str546Key)]
public class Security : Cloneable<Security>, IExtendableEntity, INotifyPropertyChanged
{
/// <summary>
/// Initializes a new instance of the <see cref="Security"/>.
/// </summary>
public Security()
{
}
private string _id;
/// <summary>
/// Security ID.
/// </summary>
[DataMember]
[Identity]
[ReadOnly(true)]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str361Key,
Description = LocalizedStrings.SecurityIdKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.GeneralKey,
Order = 0)]
public string Id
{
get => _id;
set
{
if (_id == value)
return;
_id = value;
Notify(nameof(Id));
}
}
private string _code;
/// <summary>
/// Security code.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.CodeKey,
Description = LocalizedStrings.Str349Key + LocalizedStrings.Dot,
GroupName = LocalizedStrings.GeneralKey,
Order = 1)]
[Required(AllowEmptyStrings = false)]
public string Code
{
get => _code;
set
{
if (_code == value)
return;
_code = value;
Notify(nameof(Code));
}
}
private ExchangeBoard _board;
/// <summary>
/// Exchange board where the security is traded.
/// </summary>
[RelationSingle(IdentityType = typeof(string))]
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.BoardKey,
Description = LocalizedStrings.Str549Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 2)]
[Required]
public virtual ExchangeBoard Board
{
get => _board;
set
{
if (_board == value)
return;
_board = value;
Notify(nameof(Board));
}
}
private SecurityTypes? _type;
/// <summary>
/// Security type.
/// </summary>
[DataMember]
[Nullable]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.TypeKey,
Description = LocalizedStrings.Str360Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 3)]
public virtual SecurityTypes? Type
{
get => _type;
set
{
if (_type == value)
return;
_type = value;
Notify(nameof(Type));
}
}
private string _name;
/// <summary>
/// Security name.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.NameKey,
Description = LocalizedStrings.Str362Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 4)]
public string Name
{
get => _name;
set
{
if (_name == value)
return;
_name = value;
Notify(nameof(Name));
}
}
private string _shortName;
/// <summary>
/// Short security name.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str363Key,
Description = LocalizedStrings.Str364Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 5)]
public string ShortName
{
get => _shortName;
set
{
if (_shortName == value)
return;
_shortName = value;
Notify(nameof(ShortName));
}
}
private CurrencyTypes? _currency;
/// <summary>
/// Trading security currency.
/// </summary>
[DataMember]
[Nullable]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.CurrencyKey,
Description = LocalizedStrings.Str382Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 6)]
public CurrencyTypes? Currency
{
get => _currency;
set
{
_currency = value;
Notify(nameof(Currency));
}
}
private SecurityExternalId _externalId = new SecurityExternalId();
/// <summary>
/// Security ID in other systems.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str553Key,
Description = LocalizedStrings.Str554Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 7)]
[TypeConverter(typeof(ExpandableObjectConverter))]
[InnerSchema(NullWhenAllEmpty = false)]
public SecurityExternalId ExternalId
{
get => _externalId;
set
{
if (value == null)
throw new ArgumentNullException(nameof(value));
_externalId = value;
Notify(nameof(ExternalId));
}
}
private string _class;
/// <summary>
/// Security class.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ClassKey,
Description = LocalizedStrings.SecurityClassKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 8)]
public string Class
{
get => _class;
set
{
if (_class == value)
return;
_class = value;
Notify(nameof(Class));
}
}
private decimal? _priceStep;
/// <summary>
/// Minimum price step.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.PriceStepKey,
Description = LocalizedStrings.MinPriceStepKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 9)]
[Nullable]
[GreaterThanZero]
public decimal? PriceStep
{
get => _priceStep;
set
{
if (_priceStep == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_priceStep = value;
Notify(nameof(PriceStep));
}
}
private decimal? _volumeStep;
/// <summary>
/// Minimum volume step.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.VolumeStepKey,
Description = LocalizedStrings.Str366Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 10)]
[Nullable]
[GreaterThanZero]
public decimal? VolumeStep
{
get => _volumeStep;
set
{
if (_volumeStep == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_volumeStep = value;
Notify(nameof(VolumeStep));
}
}
private decimal? _minVolume;
/// <summary>
/// Minimum volume allowed in order.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.MinVolumeKey,
Description = LocalizedStrings.MinVolumeDescKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 10)]
[Nullable]
//[GreaterThanZero]
public decimal? MinVolume
{
get => _minVolume;
set
{
if (_minVolume == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_minVolume = value;
Notify(nameof(MinVolume));
}
}
private decimal? _maxVolume;
/// <summary>
/// Maximum volume allowed in order.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.MaxVolumeKey,
Description = LocalizedStrings.MaxVolumeDescKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 11)]
[Nullable]
//[GreaterThanZero]
public decimal? MaxVolume
{
get => _maxVolume;
set
{
if (_maxVolume == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_maxVolume = value;
Notify(nameof(MaxVolume));
}
}
private decimal? _multiplier;
/// <summary>
/// Lot multiplier.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str330Key,
Description = LocalizedStrings.LotVolumeKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 12)]
[Nullable]
public decimal? Multiplier
{
get => _multiplier;
set
{
if (_multiplier == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_multiplier = value;
Notify(nameof(Multiplier));
}
}
private int? _decimals;
/// <summary>
/// Number of digits in price after coma.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.DecimalsKey,
Description = LocalizedStrings.Str548Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 13)]
//[ReadOnly(true)]
[Nullable]
public int? Decimals
{
get => _decimals;
set
{
if (_decimals == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_decimals = value;
Notify(nameof(Decimals));
}
}
private DateTimeOffset? _expiryDate;
/// <summary>
/// Security expiration date (for derivatives - expiration, for bonds — redemption).
/// </summary>
[DataMember]
[Nullable]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ExpiryDateKey,
Description = LocalizedStrings.Str371Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 14)]
public DateTimeOffset? ExpiryDate
{
get => _expiryDate;
set
{
if (_expiryDate == value)
return;
_expiryDate = value;
Notify(nameof(ExpiryDate));
}
}
private DateTimeOffset? _settlementDate;
/// <summary>
/// Settlement date for security (for derivatives and bonds).
/// </summary>
[DataMember]
[Nullable]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.SettlementDateKey,
Description = LocalizedStrings.Str373Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 15)]
public DateTimeOffset? SettlementDate
{
get => _settlementDate;
set
{
if (_settlementDate == value)
return;
_settlementDate = value;
Notify(nameof(SettlementDate));
}
}
private string _cfiCode;
/// <summary>
/// Type in ISO 10962 standard.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.CfiCodeKey,
Description = LocalizedStrings.CfiCodeDescKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 16)]
public string CfiCode
{
get => _cfiCode;
set
{
if (_cfiCode == value)
return;
_cfiCode = value;
Notify(nameof(CfiCode));
}
}
private decimal? _faceValue;
/// <summary>
/// Face value.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.FaceValueKey,
Description = LocalizedStrings.FaceValueDescKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 17)]
public decimal? FaceValue
{
get => _faceValue;
set
{
if (_faceValue == value)
return;
_faceValue = value;
Notify(nameof(FaceValue));
}
}
[field: NonSerialized]
private SynchronizedDictionary<string, object> _extensionInfo;
/// <inheritdoc />
[XmlIgnore]
//[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ExtendedInfoKey,
Description = LocalizedStrings.Str427Key,
GroupName = LocalizedStrings.GeneralKey,
Order = 20)]
[Ignore]
public IDictionary<string, object> ExtensionInfo
{
get => _extensionInfo;
set
{
_extensionInfo = value.Sync();
Notify(nameof(ExtensionInfo));
}
}
private decimal? _stepPrice;
//[DataMember]
/// <summary>
/// Step price.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str290Key,
Description = LocalizedStrings.Str555Key,
GroupName = LocalizedStrings.Str436Key,
Order = 200)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? StepPrice
{
get => _stepPrice;
set
{
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str556);
if (_stepPrice == value)
return;
_stepPrice = value;
Notify(nameof(StepPrice));
}
}
private Trade _lastTrade;
//[DataMember]
/// <summary>
/// Information about the last trade. If during the session on the instrument there were no trades, the value equals to <see langword="null" />.
/// </summary>
[Ignore]
[XmlIgnore]
[TypeConverter(typeof(ExpandableObjectConverter))]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str289Key,
Description = LocalizedStrings.Str557Key,
GroupName = LocalizedStrings.Str436Key,
Order = 201)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public Trade LastTrade
{
get => _lastTrade;
set
{
if (_lastTrade == value)
return;
_lastTrade = value;
Notify(nameof(LastTrade));
if (value == null)
return;
if (!value.Time.IsDefault())
LastChangeTime = value.Time;
}
}
private decimal? _openPrice;
//[DataMember]
/// <summary>
/// First trade price for the session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str558Key,
Description = LocalizedStrings.Str559Key,
GroupName = LocalizedStrings.Str436Key,
Order = 202)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? OpenPrice
{
get => _openPrice;
set
{
if (_openPrice == value)
return;
_openPrice = value;
Notify(nameof(OpenPrice));
}
}
private decimal? _closePrice;
//[DataMember]
/// <summary>
/// Last trade price for the previous session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str560Key,
Description = LocalizedStrings.Str561Key,
GroupName = LocalizedStrings.Str436Key,
Order = 203)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? ClosePrice
{
get => _closePrice;
set
{
if (_closePrice == value)
return;
_closePrice = value;
Notify(nameof(ClosePrice));
}
}
private decimal? _lowPrice;
//[DataMember]
/// <summary>
/// Lowest price for the session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str288Key,
Description = LocalizedStrings.Str562Key,
GroupName = LocalizedStrings.Str436Key,
Order = 204)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? LowPrice
{
get => _lowPrice;
set
{
if (_lowPrice == value)
return;
_lowPrice = value;
Notify(nameof(LowPrice));
}
}
private decimal? _highPrice;
//[DataMember]
/// <summary>
/// Highest price for the session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str563Key,
Description = LocalizedStrings.Str564Key,
GroupName = LocalizedStrings.Str436Key,
Order = 205)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? HighPrice
{
get => _highPrice;
set
{
if (_highPrice == value)
return;
_highPrice = value;
Notify(nameof(HighPrice));
}
}
private Quote _bestBid;
//[DataMember]
/// <summary>
/// Best bid in market depth.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str565Key,
Description = LocalizedStrings.Str566Key,
GroupName = LocalizedStrings.Str436Key,
Order = 206)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public Quote BestBid
{
get => _bestBid;
set
{
//TODO: решить другим методом, OnEquals не тормозит, медленно работает GUI
//PYH: Тормозит OnEquals
//if (_bestBid == value)
// return;
_bestBid = value;
Notify(nameof(BestBid));
}
}
private Quote _bestAsk;
//[DataMember]
/// <summary>
/// Best ask in market depth.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.BestAskKey,
Description = LocalizedStrings.BestAskDescKey,
GroupName = LocalizedStrings.Str436Key,
Order = 207)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public Quote BestAsk
{
get => _bestAsk;
set
{
// if (_bestAsk == value)
// return;
_bestAsk = value;
Notify(nameof(BestAsk));
}
}
//[DisplayName("Лучшая пара")]
//[Description("Лучшая пара котировок.")]
//[ExpandableObject]
//[StatisticsCategory]
/// <summary>
/// Best pair quotes.
/// </summary>
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.BestPairKey,
Description = LocalizedStrings.BestPairKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str436Key,
Order = 208)]
public MarketDepthPair BestPair => new MarketDepthPair(this, BestBid, BestAsk);
private SecurityStates? _state;
//[DataMember]
//[Enum]
/// <summary>
/// Current state of security.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.StateKey,
Description = LocalizedStrings.Str569Key,
GroupName = LocalizedStrings.Str436Key,
Order = 209)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public SecurityStates? State
{
get => _state;
set
{
if (_state == value)
return;
_state = value;
Notify(nameof(State));
}
}
private decimal? _minPrice;
//[DataMember]
/// <summary>
/// Lower price limit.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.PriceMinKey,
Description = LocalizedStrings.PriceMinLimitKey,
GroupName = LocalizedStrings.Str436Key,
Order = 210)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? MinPrice
{
get => _minPrice;
set
{
if (_minPrice == value)
return;
_minPrice = value;
Notify(nameof(MinPrice));
}
}
private decimal? _maxPrice;
//[DataMember]
/// <summary>
/// Upper price limit.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.PriceMaxKey,
Description = LocalizedStrings.PriceMaxLimitKey,
GroupName = LocalizedStrings.Str436Key,
Order = 211)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? MaxPrice
{
get => _maxPrice;
set
{
if (_maxPrice == value)
return;
_maxPrice = value;
Notify(nameof(MaxPrice));
}
}
private decimal? _marginBuy;
//[DataMember]
/// <summary>
/// Initial margin to buy.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str304Key,
Description = LocalizedStrings.MarginBuyKey,
GroupName = LocalizedStrings.Str436Key,
Order = 212)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? MarginBuy
{
get => _marginBuy;
set
{
if (_marginBuy == value)
return;
_marginBuy = value;
Notify(nameof(MarginBuy));
}
}
private decimal? _marginSell;
//[DataMember]
/// <summary>
/// Initial margin to sell.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str305Key,
Description = LocalizedStrings.MarginSellKey,
GroupName = LocalizedStrings.Str436Key,
Order = 213)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? MarginSell
{
get => _marginSell;
set
{
if (_marginSell == value)
return;
_marginSell = value;
Notify(nameof(MarginSell));
}
}
//[field: NonSerialized]
//private IConnector _connector;
///// <summary>
///// Connection to the trading system, through which this instrument has been downloaded.
///// </summary>
//[Ignore]
//[XmlIgnore]
//[Browsable(false)]
//[Obsolete("The property Connector was obsoleted and is always null.")]
//public IConnector Connector
//{
// get { return _connector; }
// set
// {
// if (_connector == value)
// return;
// _connector = value;
// Notify(nameof(Trader));
// }
//}
private string _underlyingSecurityId;
/// <summary>
/// Underlying asset on which the current security is built.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.UnderlyingAssetKey,
Description = LocalizedStrings.Str550Key,
GroupName = LocalizedStrings.Str437Key,
Order = 100)]
public string UnderlyingSecurityId
{
get => _underlyingSecurityId;
set
{
if (_underlyingSecurityId == value)
return;
_underlyingSecurityId = value;
Notify(nameof(UnderlyingSecurityId));
}
}
private OptionTypes? _optionType;
/// <summary>
/// Option type.
/// </summary>
[DataMember]
[Nullable]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str551Key,
Description = LocalizedStrings.OptionContractTypeKey,
GroupName = LocalizedStrings.Str437Key,
Order = 101)]
public OptionTypes? OptionType
{
get => _optionType;
set
{
if (_optionType == value)
return;
_optionType = value;
Notify(nameof(OptionType));
}
}
private decimal? _strike;
/// <summary>
/// Option strike price.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.StrikeKey,
Description = LocalizedStrings.OptionStrikePriceKey,
GroupName = LocalizedStrings.Str437Key,
Order = 102)]
[Nullable]
public decimal? Strike
{
get => _strike;
set
{
if (_strike == value)
return;
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), value, LocalizedStrings.Str1219);
_strike = value;
Notify(nameof(Strike));
}
}
private string _binaryOptionType;
/// <summary>
/// Type of binary option.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str552Key,
Description = LocalizedStrings.TypeBinaryOptionKey,
GroupName = LocalizedStrings.Str437Key,
Order = 103)]
public string BinaryOptionType
{
get => _binaryOptionType;
set
{
if (_binaryOptionType == value)
return;
_binaryOptionType = value;
Notify(nameof(BinaryOptionType));
}
}
private decimal? _impliedVolatility;
//[DataMember]
/// <summary>
/// Volatility (implied).
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.IVKey,
Description = LocalizedStrings.Str293Key + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str437Key,
Order = 104)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? ImpliedVolatility
{
get => _impliedVolatility;
set
{
if (_impliedVolatility == value)
return;
_impliedVolatility = value;
Notify(nameof(ImpliedVolatility));
}
}
private decimal? _historicalVolatility;
//[DataMember]
/// <summary>
/// Volatility (historical).
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.HVKey,
Description = LocalizedStrings.Str299Key + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str437Key,
Order = 105)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? HistoricalVolatility
{
get => _historicalVolatility;
set
{
if (_historicalVolatility == value)
return;
_historicalVolatility = value;
Notify(nameof(HistoricalVolatility));
}
}
private decimal? _theorPrice;
//[DataMember]
/// <summary>
/// Theoretical price.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str294Key,
Description = LocalizedStrings.TheoreticalPriceKey,
GroupName = LocalizedStrings.Str437Key,
Order = 106)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? TheorPrice
{
get => _theorPrice;
set
{
if (_theorPrice == value)
return;
_theorPrice = value;
Notify(nameof(TheorPrice));
}
}
private decimal? _delta;
//[DataMember]
/// <summary>
/// Option delta.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.DeltaKey,
Description = LocalizedStrings.OptionDeltaKey,
GroupName = LocalizedStrings.Str437Key,
Order = 107)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Delta
{
get => _delta;
set
{
if (_delta == value)
return;
_delta = value;
Notify(nameof(Delta));
}
}
private decimal? _gamma;
//[DataMember]
/// <summary>
/// Option gamma.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.GammaKey,
Description = LocalizedStrings.OptionGammaKey,
GroupName = LocalizedStrings.Str437Key,
Order = 108)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Gamma
{
get => _gamma;
set
{
if (_gamma == value)
return;
_gamma = value;
Notify(nameof(Gamma));
}
}
private decimal? _vega;
//[DataMember]
/// <summary>
/// Option vega.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.VegaKey,
Description = LocalizedStrings.OptionVegaKey,
GroupName = LocalizedStrings.Str437Key,
Order = 109)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Vega
{
get => _vega;
set
{
if (_vega == value)
return;
_vega = value;
Notify(nameof(Vega));
}
}
private decimal? _theta;
//[DataMember]
/// <summary>
/// Option theta.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ThetaKey,
Description = LocalizedStrings.OptionThetaKey,
GroupName = LocalizedStrings.Str437Key,
Order = 110)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Theta
{
get => _theta;
set
{
if (_theta == value)
return;
_theta = value;
Notify(nameof(Theta));
}
}
private decimal? _rho;
//[DataMember]
/// <summary>
/// Option rho.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.RhoKey,
Description = LocalizedStrings.OptionRhoKey,
GroupName = LocalizedStrings.Str437Key,
Order = 111)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Rho
{
get => _rho;
set
{
if (_rho == value)
return;
_rho = value;
Notify(nameof(Rho));
}
}
private decimal? _openInterest;
//[DataMember]
/// <summary>
/// Number of open positions (open interest).
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str150Key,
Description = LocalizedStrings.Str151Key,
GroupName = LocalizedStrings.Str436Key,
Order = 220)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? OpenInterest
{
get => _openInterest;
set
{
if (_openInterest == value)
return;
_openInterest = value;
Notify(nameof(OpenInterest));
}
}
private DateTimeOffset _localTime;
/// <summary>
/// Local time of the last instrument change.
/// </summary>
[Browsable(false)]
[Ignore]
[XmlIgnore]
public DateTimeOffset LocalTime
{
get => _localTime;
set
{
_localTime = value;
Notify(nameof(LocalTime));
}
}
private DateTimeOffset _lastChangeTime;
//[StatisticsCategory]
/// <summary>
/// Time of the last instrument change.
/// </summary>
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
[Ignore]
[XmlIgnore]
public DateTimeOffset LastChangeTime
{
get => _lastChangeTime;
set
{
_lastChangeTime = value;
Notify(nameof(LastChangeTime));
}
}
private decimal? _bidsVolume;
//[DataMember]
/// <summary>
/// Total volume in all buy orders.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str295Key,
Description = LocalizedStrings.BidsVolumeKey,
GroupName = LocalizedStrings.Str436Key,
Order = 221)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? BidsVolume
{
get => _bidsVolume;
set
{
_bidsVolume = value;
Notify(nameof(BidsVolume));
}
}
private int? _bidsCount;
//[DataMember]
/// <summary>
/// Number of buy orders.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.BidsKey,
Description = LocalizedStrings.BidsCountKey,
GroupName = LocalizedStrings.Str436Key,
Order = 222)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public int? BidsCount
{
get => _bidsCount;
set
{
_bidsCount = value;
Notify(nameof(BidsCount));
}
}
private decimal? _asksVolume;
//[DataMember]
/// <summary>
/// Total volume in all sell orders.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str297Key,
Description = LocalizedStrings.AsksVolumeKey,
GroupName = LocalizedStrings.Str436Key,
Order = 223)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? AsksVolume
{
get => _asksVolume;
set
{
_asksVolume = value;
Notify(nameof(AsksVolume));
}
}
private int? _asksCount;
//[DataMember]
/// <summary>
/// Number of sell orders.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.AsksKey,
Description = LocalizedStrings.AsksCountKey,
GroupName = LocalizedStrings.Str436Key,
Order = 224)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public int? AsksCount
{
get => _asksCount;
set
{
_asksCount = value;
Notify(nameof(AsksCount));
}
}
private int? _tradesCount;
//[DataMember]
/// <summary>
/// Number of trades.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.TradesOfKey,
Description = LocalizedStrings.Str232Key + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str436Key,
Order = 225)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public int? TradesCount
{
get => _tradesCount;
set
{
_tradesCount = value;
Notify(nameof(TradesCount));
}
}
private decimal? _highBidPrice;
//[DataMember]
/// <summary>
/// Maximum bid during the session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str319Key,
Description = LocalizedStrings.Str594Key,
GroupName = LocalizedStrings.Str436Key,
Order = 226)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? HighBidPrice
{
get => _highBidPrice;
set
{
_highBidPrice = value;
Notify(nameof(HighBidPrice));
}
}
private decimal? _lowAskPrice;
//[DataMember]
/// <summary>
/// Minimum ask during the session.
/// </summary>
[Ignore]
[XmlIgnore]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str320Key,
Description = LocalizedStrings.Str595Key,
GroupName = LocalizedStrings.Str436Key,
Order = 227)]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? LowAskPrice
{
get => _lowAskPrice;
set
{
_lowAskPrice = value;
Notify(nameof(LowAskPrice));
}
}
private decimal? _yield;
//[DataMember]
/// <summary>
/// Yield.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str321Key,
Description = LocalizedStrings.Str321Key + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str436Key,
Order = 228)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Yield
{
get => _yield;
set
{
_yield = value;
Notify(nameof(Yield));
}
}
private decimal? _vwap;
//[DataMember]
/// <summary>
/// Average price.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.AveragePriceKey,
Description = LocalizedStrings.AveragePriceKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str436Key,
Order = 229)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? VWAP
{
get => _vwap;
set
{
_vwap = value;
Notify(nameof(VWAP));
}
}
private decimal? _settlementPrice;
//[DataMember]
/// <summary>
/// Settlement price.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.Str312Key,
Description = LocalizedStrings.SettlementPriceKey,
GroupName = LocalizedStrings.Str436Key,
Order = 230)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? SettlementPrice
{
get => _settlementPrice;
set
{
_settlementPrice = value;
Notify(nameof(SettlementPrice));
}
}
private decimal? _averagePrice;
//[DataMember]
/// <summary>
/// Average price per session.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.AveragePriceKey,
Description = LocalizedStrings.Str600Key,
GroupName = LocalizedStrings.Str436Key,
Order = 231)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? AveragePrice
{
get => _averagePrice;
set
{
_averagePrice = value;
Notify(nameof(AveragePrice));
}
}
private decimal? _volume;
//[DataMember]
/// <summary>
/// Volume per session.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.VolumeKey,
Description = LocalizedStrings.Str601Key,
GroupName = LocalizedStrings.Str436Key,
Order = 232)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Volume
{
get => _volume;
set
{
_volume = value;
Notify(nameof(Volume));
}
}
private decimal? _turnover;
/// <summary>
/// Turnover.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.TurnoverKey,
Description = LocalizedStrings.TurnoverKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str436Key,
Order = 232)]
[Ignore]
[XmlIgnore]
[Browsable(false)]
//[Obsolete("Use the IConnector.GetSecurityValue.")]
public decimal? Turnover
{
get => _turnover;
set
{
_turnover = value;
Notify(nameof(Turnover));
}
}
private decimal? _issueSize;
/// <summary>
/// Number of issued contracts.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.IssueSizeKey,
Description = LocalizedStrings.IssueSizeKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.GeneralKey,
Order = 21)]
[DataMember]
[Nullable]
public decimal? IssueSize
{
get => _issueSize;
set
{
_issueSize = value;
Notify(nameof(IssueSize));
}
}
private DateTimeOffset? _issueDate;
/// <summary>
/// Date of issue.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.IssueDateKey,
Description = LocalizedStrings.IssueDateKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.GeneralKey,
Order = 22)]
[DataMember]
[Nullable]
public DateTimeOffset? IssueDate
{
get => _issueDate;
set
{
_issueDate = value;
Notify(nameof(IssueDate));
}
}
private bool? _shortable;
/// <summary>
/// Can have short positions.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ShortableKey,
Description = LocalizedStrings.ShortableDescKey,
GroupName = LocalizedStrings.GeneralKey,
Order = 22)]
[DataMember]
[Nullable]
public bool? Shortable
{
get => _shortable;
set
{
_shortable = value;
Notify(nameof(Shortable));
}
}
private SecurityTypes? _underlyingSecurityType;
/// <summary>
/// Underlying security type.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.AssetTypeKey,
Description = LocalizedStrings.UnderlyingSecurityTypeKey + LocalizedStrings.Dot,
GroupName = LocalizedStrings.Str437Key,
Order = 103)]
[DataMember]
[Nullable]
public SecurityTypes? UnderlyingSecurityType
{
get => _underlyingSecurityType;
set
{
_underlyingSecurityType = value;
Notify(nameof(UnderlyingSecurityType));
}
}
private decimal? _underlyingSecurityMinVolume;
/// <summary>
/// Minimum volume allowed in order for underlying security.
/// </summary>
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.UnderlyingMinVolumeKey,
Description = LocalizedStrings.UnderlyingMinVolumeDescKey,
GroupName = LocalizedStrings.Str437Key,
Order = 104)]
[DataMember]
[Nullable]
public decimal? UnderlyingSecurityMinVolume
{
get => _underlyingSecurityMinVolume;
set
{
_underlyingSecurityMinVolume = value;
Notify(nameof(UnderlyingSecurityMinVolume));
}
}
private decimal? _buyBackPrice;
/// <summary>
/// BuyBack price.
/// </summary>
[Ignore]
[XmlIgnore]
[Browsable(false)]
public decimal? BuyBackPrice
{
get => _buyBackPrice;
set
{
_buyBackPrice = value;
Notify(nameof(BuyBackPrice));
}
}
private DateTimeOffset? _buyBackDate;
/// <summary>
/// BuyBack date.
/// </summary>
[Ignore]
[XmlIgnore]
[Browsable(false)]
public DateTimeOffset? BuyBackDate
{
get => _buyBackDate;
set
{
_buyBackDate = value;
Notify(nameof(BuyBackDate));
}
}
/// <summary>
/// Basket security type. Can be <see langword="null"/> in case of regular security.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.CodeKey,
Description = LocalizedStrings.BasketCodeKey,
GroupName = LocalizedStrings.BasketKey,
Order = 200)]
public virtual string BasketCode { get; set; }
/// <summary>
/// Basket security expression. Can be <see langword="null"/> in case of regular security.
/// </summary>
[DataMember]
[Display(
ResourceType = typeof(LocalizedStrings),
Name = LocalizedStrings.ExpressionKey,
Description = LocalizedStrings.ExpressionDescKey,
GroupName = LocalizedStrings.BasketKey,
Order = 201)]
public virtual string BasketExpression { get; set; }
private decimal? _commissionTaker;
/// <summary>
/// Commission (taker).
/// </summary>
[Ignore]
[XmlIgnore]
[Browsable(false)]
public decimal? CommissionTaker
{
get => _commissionTaker;
set
{
_commissionTaker = value;
Notify(nameof(CommissionTaker));
}
}
private decimal? _commissionMaker;
/// <summary>
/// Commission (maker).
/// </summary>
[Ignore]
[XmlIgnore]
[Browsable(false)]
public decimal? CommissionMaker
{
get => _commissionMaker;
set
{
_commissionMaker = value;
Notify(nameof(CommissionMaker));
}
}
[field: NonSerialized]
private PropertyChangedEventHandler _propertyChanged;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
{
add => _propertyChanged += value;
remove => _propertyChanged -= value;
}
/// <inheritdoc />
public override string ToString() => Id;
/// <summary>
/// Create a copy of <see cref="Security"/>.
/// </summary>
/// <returns>Copy.</returns>
public override Security Clone()
{
var clone = new Security();
CopyTo(clone);
return clone;
}
/// <summary>
/// To copy fields of the current instrument to <paramref name="destination" />.
/// </summary>
/// <param name="destination">The instrument in which you should to copy fields.</param>
public void CopyTo(Security destination)
{
if (destination == null)
throw new ArgumentNullException(nameof(destination));
destination.Id = Id;
destination.Name = Name;
destination.Type = Type;
destination.Code = Code;
destination.Class = Class;
destination.ShortName = ShortName;
destination.VolumeStep = VolumeStep;
destination.MinVolume = MinVolume;
destination.MaxVolume = MaxVolume;
destination.Multiplier = Multiplier;
destination.PriceStep = PriceStep;
destination.Decimals = Decimals;
destination.SettlementDate = SettlementDate;
destination.Board = Board;
destination.ExpiryDate = ExpiryDate;
destination.OptionType = OptionType;
destination.Strike = Strike;
destination.BinaryOptionType = BinaryOptionType;
destination.UnderlyingSecurityId = UnderlyingSecurityId;
destination.ExternalId = ExternalId.Clone();
destination.Currency = Currency;
destination.StepPrice = StepPrice;
destination.LowPrice = LowPrice;
destination.HighPrice = HighPrice;
destination.ClosePrice = ClosePrice;
destination.OpenPrice = OpenPrice;
destination.MinPrice = MinPrice;
destination.MaxPrice = MaxPrice;
destination.State = State;
destination.TheorPrice = TheorPrice;
destination.ImpliedVolatility = ImpliedVolatility;
destination.HistoricalVolatility = HistoricalVolatility;
destination.MarginBuy = MarginBuy;
destination.MarginSell = MarginSell;
destination.OpenInterest = OpenInterest;
destination.BidsCount = BidsCount;
destination.BidsVolume = BidsVolume;
destination.AsksCount = AsksCount;
destination.AsksVolume = AsksVolume;
destination.CfiCode = CfiCode;
destination.Turnover = Turnover;
destination.IssueSize = IssueSize;
destination.IssueDate = IssueDate;
destination.UnderlyingSecurityType = UnderlyingSecurityType;
destination.UnderlyingSecurityMinVolume = UnderlyingSecurityMinVolume;
destination.BuyBackDate = BuyBackDate;
destination.BuyBackPrice = BuyBackPrice;
destination.Shortable = Shortable;
destination.BasketCode = BasketCode;
destination.BasketExpression = BasketExpression;
destination.CommissionTaker = CommissionTaker;
destination.CommissionMaker = CommissionMaker;
destination.FaceValue = FaceValue;
//if (destination.ExtensionInfo == null)
// destination.ExtensionInfo = new SynchronizedDictionary<object, object>();
//if (LastTrade != null)
//{
// destination.LastTrade = LastTrade.Clone();
// destination.LastTrade.Security = destination;
//}
//if (BestBid != null)
//{
// destination.BestBid = BestBid.Clone();
// destination.BestBid.Security = destination;
//}
//if (BestAsk != null)
//{
// destination.BestAsk = BestAsk.Clone();
// destination.BestAsk.Security = destination;
//}
}
/// <summary>
/// To call the event <see cref="INotifyPropertyChanged.PropertyChanged"/>.
/// </summary>
/// <param name="propName">Property name.</param>
protected void Notify(string propName)
{
_propertyChanged?.Invoke(this, propName);
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/jufeng9318/StockSharp.git
git@gitee.com:jufeng9318/StockSharp.git
jufeng9318
StockSharp
StockSharp
master

搜索帮助