Strategy

StockSharp.Algo.Strategies

所有贸易战略的基础等级。

继承自: BaseLogReceiver

实现: INotifyPropertyChangedEx, INotifyPropertyChanged, IMarketRuleContainer, ILogReceiver, ILogSource, IDisposable, ICloneable<Strategy>, ICloneable, IMarketDataProvider, ISubscriptionProvider, ISecurityProvider, ISecurityMessageProvider, ITransactionProvider, IScheduledTask, ICustomTypeDescriptor, ITimeProvider, IPortfolioProvider, IPositionProvider, IReportSource

构造函数

Strategy
public Strategy()
strategy = Strategy()

初始化了该战略的新实例。

属性

AggregationInterval
public TimeSpan AggregationInterval { get; set; }
value = strategy.AggregationInterval
strategy.AggregationInterval = value

集合的时间间隔。 在同一时间间隔内的命令/ 交易被组合在一起。 默认为 1小时。 设置为 0 以禁用基于时间的分组 。

CancelOrdersWhenStopping
public bool CancelOrdersWhenStopping { get; set; }
value = strategy.CancelOrdersWhenStopping
strategy.CancelOrdersWhenStopping = value

停止取消活动命令。 默认执行 。

ChildStrategies
public INotifyList<Strategy> ChildStrategies { get; }
value = strategy.ChildStrategies

辅助贸易战略。

CommentMode
public StrategyCommentModes CommentMode { get; set; }
value = strategy.CommentMode
strategy.CommentMode = value

以名称或ID设置注释 。

Commission
public decimal? Commission { get; private set; }
value = strategy.Commission
strategy.Commission = value

佣金总额

Connector
public virtual Connector Connector { get; set; }
value = strategy.Connector
strategy.Connector = value

与交易系统连接.

CurrentTime
public override DateTime CurrentTime { get; }
value = strategy.CurrentTime

目前为协调世界时时间.

DisposeOnStop
public bool DisposeOnStop { get; set; }
value = strategy.DisposeOnStop
strategy.DisposeOnStop = value

自动清除资源, 策略使用, 当它停止时(状态 ProcessState 变为等同停止) 。

Environment
public SettingsStorage Environment { get; }
value = strategy.Environment

战略环境参数。

ErrorState
public LogLevels ErrorState { get; private set; }
value = strategy.ErrorState
strategy.ErrorState = value

出错的状态.

HideSecurityAndPortfolioParameters
public static bool HideSecurityAndPortfolioParameters { get; set; }
value = Strategy.HideSecurityAndPortfolioParameters
Strategy.HideSecurityAndPortfolioParameters = value

使金融工具和证券组合成为不可浏览.

HistoryCalculated
protected virtual TimeSpan? HistoryCalculated { get; }
value = strategy.HistoryCalculated

从HistorySize的代码版本中计算出.

HistorySize
public TimeSpan? HistorySize { get; set; }
value = strategy.HistorySize
strategy.HistorySize = value

历史 初步形成活贸易战略.

Id
public override Guid Id { get; set; }
value = strategy.Id
strategy.Id = value

战略识别

Indicators
public INotifyList<IIndicator> Indicators { get; }
value = strategy.Indicators

战略中使用的所有指标。默认使用IsFormed。

IndicatorSource
public Level1Fields? IndicatorSource { get; set; }
value = strategy.IndicatorSource
strategy.IndicatorSource = value

未设置源代码时, 默认指标源 。

IsBacktesting
public bool IsBacktesting { get; }
value = strategy.IsBacktesting

确定 Connector 是 HistoryEmulationConnector 。

IsFormed
public virtual bool IsFormed { get; }
value = strategy.IsFormed

战略已完全形成。

IsOnline
public bool IsOnline { get; private set; }
value = strategy.IsOnline
strategy.IsOnline = value

真正的意味着这个策略已经开始,并且其所有的订阅都处于在线状态.

IsRulesSuspended
public bool IsRulesSuspended { get; }
value = strategy.IsRulesSuspended

规则被暂停执行。

KeepStatistics
public bool KeepStatistics { get; set; }
value = strategy.KeepStatistics
strategy.KeepStatistics = value

重启后保留交易统计(订单,交易,利润等).

LastError
public Exception LastError { get; private set; }
value = strategy.LastError
strategy.LastError = value

最后一个导致策略停止的错误.

Latency
public TimeSpan? Latency { get; private set; }
value = strategy.Latency
strategy.Latency = value

完全没有时间了

LogLevel
public override LogLevels LogLevel { get; set; }
value = strategy.LogLevel
strategy.LogLevel = value

执行此规则的级别 。

MaxOrdersBeforeAggregation
public int MaxOrdersBeforeAggregation { get; set; }
value = strategy.MaxOrdersBeforeAggregation
strategy.MaxOrdersBeforeAggregation = value

启动自动聚合前的最大命令数。 默认为 10000。 设定为 0 以禁用自动聚合 。

MaxTradesBeforeAggregation
public int MaxTradesBeforeAggregation { get; set; }
value = strategy.MaxTradesBeforeAggregation
strategy.MaxTradesBeforeAggregation = value

启动自动聚合前的最大交易数量。 默认为 10000。 设置为 0 以禁用自动聚合 。

MyTrades
public IEnumerable<MyTrade> MyTrades { get; }
value = strategy.MyTrades

交易,在战略操作中匹配.

Name
public override string Name { get; set; }
value = strategy.Name
strategy.Name = value

战略名称。

NameGenerator
public StrategyNameGenerator NameGenerator { get; }
value = strategy.NameGenerator

战略名称的生成器

OrderBookSources
public virtual IEnumerable<IOrderBookSource> OrderBookSources { get; }
value = strategy.OrderBookSources

所有可能的IOrderBookMessage源可以通过OrderBookDrawing接收.

OrderLookup
public Subscription OrderLookup { get; }
value = strategy.OrderLookup

获取全球订阅的秩序查询。 可能是 。

Orders
public IEnumerable<Order> Orders { get; }
value = strategy.Orders

命令,在战略框架内登记。

OrdersKeepTime
public TimeSpan OrdersKeepTime { get; set; }
value = strategy.OrdersKeepTime
strategy.OrdersKeepTime = value

存储命令的时间在内存中。 默认情况下, 时间等于2天。 如果值设置在 Zero 中, 命令将不会被删除 。

Parameters
public StrategyParameterDictionary Parameters { get; }
value = strategy.Parameters

战略参数。

PnL
public decimal PnL { get; }
value = strategy.PnL

不含会计佣金的损益合计价值.

PnLManager
public IPnLManager PnLManager { get; set; }
value = strategy.PnLManager
strategy.PnLManager = value

损益经理.

Portfolio
public Portfolio Portfolio { get; set; }
value = strategy.Portfolio
strategy.Portfolio = value

组合.

PortfolioLookup
public Subscription PortfolioLookup { get; }
value = strategy.PortfolioLookup

获取全球订阅的组合搜索。 可能吧 。

PortfolioProvider
public IPortfolioProvider PortfolioProvider { get; set; }
value = strategy.PortfolioProvider
strategy.PortfolioProvider = value

IPortfolioProvider

Position
public decimal Position { get; set; }
value = strategy.Position
strategy.Position = value

位置总值。

Positions
public IEnumerable<Position> Positions { get; }
value = strategy.Positions

职位列表.

ProcessState
public virtual ProcessStates ProcessState { get; private set; }
value = strategy.ProcessState
strategy.ProcessState = value

行动州.

ReportSource
public ReportSource ReportSource { get; }
value = strategy.ReportSource

报告数据来源,并附有汇总支持。

RiskFreeRate
public decimal RiskFreeRate { get; set; }
value = strategy.RiskFreeRate
strategy.RiskFreeRate = value

Annual risk-free rate (e.g., 0.03 = 3%).

RiskManager
public IRiskManager RiskManager { get; set; }
value = strategy.RiskManager
strategy.RiskManager = value

风险控制经理人

RiskRules
public IEnumerable<IRiskRule> RiskRules { get; set; }
value = strategy.RiskRules
strategy.RiskRules = value

风险规则。

Rules
public IMarketRuleList Rules { get; }
value = strategy.Rules

佣金计算规则列表.

Security
public Security Security { get; set; }
value = strategy.Security
strategy.Security = value

金融工具。

Slippage
public decimal? Slippage { get; private set; }
value = strategy.Slippage
strategy.Slippage = value

总出错.

StartedTime
public DateTime StartedTime { get; private set; }
value = strategy.StartedTime
strategy.StartedTime = value

战略启动时间。

StatisticManager
public IStatisticManager StatisticManager { get; protected set; }
value = strategy.StatisticManager
strategy.StatisticManager = value

统计经理.

TargetAlgoFactory
public Func<Sides, decimal, IPositionModifyAlgo> TargetAlgoFactory { get; set; }
value = strategy.TargetAlgoFactory
strategy.TargetAlgoFactory = value

工厂为 TargetPositionManager 创建位置修改算法 。 默认创建 MarketOrderAlgo 。

TargetPositionManager
public PositionTargetManager TargetPositionManager { get; }
value = strategy.TargetPositionManager

目标位置经理。

TotalWorkingTime
public TimeSpan TotalWorkingTime { get; private set; }
value = strategy.TotalWorkingTime
strategy.TotalWorkingTime = value

战略运行的总时间减去停止战略的时间。

TradingMode
public StrategyTradingModes TradingMode { get; set; }
value = strategy.TradingMode
strategy.TradingMode = value

允许交易。

UnrealizedPnLInterval
public TimeSpan UnrealizedPnLInterval { get; set; }
value = strategy.UnrealizedPnLInterval
strategy.UnrealizedPnLInterval = value

未实现的利润重新计算间隔。 默认值为 1 分钟 。

UnsubscribeOnStop
public bool UnsubscribeOnStop { get; set; }
value = strategy.UnsubscribeOnStop
strategy.UnsubscribeOnStop = value

在策略停止时取消订阅所有活动订阅 。

Volume
public virtual decimal Volume { get; set; }
value = strategy.Volume
strategy.Volume = value

业务量.

WaitAllTrades
public bool WaitAllTrades { get; set; }
value = strategy.WaitAllTrades
strategy.WaitAllTrades = value

只有在通过注册订单获得所有交易后,才能停止策略.

WaitRulesOnStop
public bool WaitRulesOnStop { get; set; }
value = strategy.WaitRulesOnStop
strategy.WaitRulesOnStop = value

等待规则完成 战略变成停止状态。

WorkingTime
public WorkingTime WorkingTime { get; set; }
value = strategy.WorkingTime
strategy.WorkingTime = value

时间界限,用于传递系列的蜡烛应在其中被翻译.

方法

Alert
protected void Alert(AlertNotifications type, string message)
strategy.Alert(type, message)

以策略名称作为标题发送提醒通知 。

type
警报类型。
message
警报短信
Alert
protected void Alert(AlertNotifications type, string caption, string message)
strategy.Alert(type, caption, message)

发出警报通知

type
警报类型。
caption
信号头.
message
警报短信
AlertLog
protected void AlertLog(string message)
strategy.AlertLog(message)

发送日志提醒通知 。

message
警报短信
AlertPopup
protected void AlertPopup(string message)
strategy.AlertPopup(message)

发送弹出提醒通知 。

message
警报短信
AlertSound
protected void AlertSound(string message)
strategy.AlertSound(message)

发出声音警报通知

message
警报短信
ApplyCommand
public virtual void ApplyCommand(CommandMessage cmdMsg)
strategy.ApplyCommand(cmdMsg)

应用到发命令 。

cmdMsg
信件包含关于命令更改状态的信息 。
BuyLimit
public Order BuyLimit(decimal price, decimal? volume, Security security)
result = strategy.BuyLimit(price, volume, security)

创建初始化的订单对象以进行购买 。

price
价相相相会.
volume
音量。 如果值被传递, 那么使用音量值 。
security
金融工具 如果通过价值,则使用金融工具价值。

返回值: 初始化顺序对象 。

BuyMarket
public Order BuyMarket(decimal? volume, Security security)
result = strategy.BuyMarket(volume, security)

以市场价格创建初始化的购货订单对象.

volume
音量。 如果值被传递, 那么使用音量值 。
security
金融工具 如果通过价值,则使用金融工具价值。

返回值: 初始化顺序对象 。

CanAttach
protected virtual bool CanAttach(Order order)
result = strategy.CanAttach(order)

确定指定的顺序可以归策略所有.

order
肃静

返回值: 检查结果。

CancelActiveOrders
public void CancelActiveOrders(bool? isStopOrder, Portfolio portfolio, Sides? direction, ExchangeBoard board, Security security, SecurityTypes? securityType, long? transactionId)
strategy.CancelActiveOrders(isStopOrder, portfolio, direction, board, security, securityType, transactionId)

取消所有主动订单(停止和定期).

isStopOrder
如果只取消停机令 如果正常的 命令 两者
portfolio
组合。 如果值等于 , 那么组合与命令不符 。
direction
排序侧。如果值是 ,则方向不使用 。
board
交易板。 如果值等于 , 则董事会将取消过滤器。
security
仪器。如果值等于 ,那么仪器与命令不符,可以取消过滤器。
securityType
金融工具类型。如果值是 ,则该类型不使用。
transactionId
命令取消交易编号。
CancelOrder
public void CancelOrder(Order order)
strategy.CancelOrder(order)

取消订单 。

order
取消的顺序 。
CancelTargetPosition
public void CancelTargetPosition(Security security, Portfolio portfolio)
strategy.CancelTargetPosition(security, portfolio)

取消特定金融工具和组合的目标位置。

security
金融工具。
portfolio
组合.
CancelTargetPosition
public void CancelTargetPosition()
strategy.CancelTargetPosition()

取消战略金融工具和证券组合的目标位置。

CanTrade
protected virtual bool CanTrade(Security security, Portfolio portfolio, Sides side, decimal volume, string noTradeReason)
result = strategy.CanTrade(security, portfolio, side, volume, noTradeReason)

检查是否可以与订单信息进行交易 。

security
金融工具贸易。
portfolio
投资组合对贸易。
side
秩序一边.
volume
序卷出. 师曰.
noTradeReason
不允许交易的原因。

返回值: 如果交易是允许的,那就是真的了。

Clone
public virtual Strategy Clone()
result = strategy.Clone()

Creates a deep copy of a DataSeries

ClosePosition
public Order ClosePosition(Security security, Portfolio portfolio)
result = strategy.ClosePosition(security, portfolio)

关闭市场开放位置(注册类型市场顺序).

security
金融工具。如果未从金融工具中转移价值,则可获得。
portfolio
组合。 如果无法通过组合的值, 将获得 。

返回值: 初始化顺序对象 。

CopyTo
protected virtual void CopyTo(Strategy copy)
strategy.CopyTo(copy)

复制设置到 。

copy
战略
CreateChartArea
protected IChartArea CreateChartArea()
result = strategy.CreateChartArea()

创建图表区域 。

返回值: IChartArea

CreateClone
protected virtual Strategy CreateClone()
result = strategy.CreateClone()

创建克隆对象( 非初始化 ) 。

返回值: 战略

CreateOrder
public Order CreateOrder(Sides side, decimal price, decimal? volume)
result = strategy.CreateOrder(side, price, volume)

创建初始化的顺序对象 。

side
秩序一边.
price
价格,如果通过价值,订单按市场价格登记.
volume
音量。 如果值被传递, 那么使用音量值 。

返回值: 初始化顺序对象 。

CreateTimer
protected ITimerHandler CreateTimer(TimeSpan interval, Action callback)
result = strategy.CreateTimer(interval, callback)

创建一个按指定间隔执行调用的时间器 。

interval
时相相接.
callback
召回执行 。

返回值: ITimerHandler

DisposeManaged
protected override void DisposeManaged()
strategy.DisposeManaged()

释放资源。

DrawCandles
protected IChartCandleElement DrawCandles(IChartArea area, Subscription subscription)
result = strategy.DrawCandles(area, subscription)

画出图上所取出之花烛.

area
IChartArea
subscription
订阅

返回值: IChartCandleElement

DrawCandles``1
protected IChartCandleElement DrawCandles<T>(IChartArea area, ISubscriptionHandler<T> subscription)
result = strategy.DrawCandles(area, subscription)

画出图上所取出之花烛.

area
IChartArea
subscription
SubscriptionHandler

返回值: IChartCandleElement

DrawIndicator
protected IChartIndicatorElement DrawIndicator(IChartArea area, IIndicator indicator, Color? color, Color? additionalColor)
result = strategy.DrawIndicator(area, indicator, color, additionalColor)

在图表上绘制指标。

area
IChartArea
indicator
指标
color
颜色
additionalColor
AdditionalColor

返回值: IChartIndicatorElement

DrawOrderBook
public void DrawOrderBook(Subscription subscription, IOrderBookSource source, IOrderBookMessage book)
strategy.DrawOrderBook(subscription, source, book)

Draw IOrderBookMessage.

subscription
订阅
source
IOrderBookSource
book
IOrderBookMessage
DrawOrderBookOrder
public void DrawOrderBookOrder(Subscription subscription, IOrderBookSource source, Order order)
strategy.DrawOrderBookOrder(subscription, source, order)

画出出出书之序.

subscription
订阅
source
IOrderBookSource
order
肃静
DrawOrderBookOrderFail
public void DrawOrderBookOrderFail(Subscription subscription, IOrderBookSource source, OrderFail fail)
strategy.DrawOrderBookOrderFail(subscription, source, fail)

绘制出命令书失败 。

subscription
订阅
source
IOrderBookSource
fail
秩序失败了。
DrawOrders
protected IChartOrderElement DrawOrders(IChartArea area)
result = strategy.DrawOrders(area)

在图表上绘制命令 。

area
IChartArea

返回值: IChartOrderElement

DrawOwnTrades
protected IChartTradeElement DrawOwnTrades(IChartArea area)
result = strategy.DrawOwnTrades(area)

图表上绘制交易。

area
IChartArea

返回值: IChartTradeElement

EditOrder
public void EditOrder(Order order, Order changes)
strategy.EditOrder(order, changes)

编辑命令。

order
肃静
changes
秩序有变化。
EnsureOrderMetadata
private void EnsureOrderMetadata(Order order, DateTime fallbackTime)
strategy.EnsureOrderMetadata(order, fallbackTime)

确保命令有策略表面所要求的元数据.

order
肃静
fallbackTime
退后时间。
GetAlertService
public IAlertNotificationService GetAlertService()
result = strategy.GetAlertService()

使IAlertNotificationService与通过的战略联系起来.

返回值: 警报服务

GetChart
public IChart GetChart()
result = strategy.GetChart()

获得IChart与所通过战略的联系.

返回值: 图表。

GetOptionDesk
public IOptionDesk GetOptionDesk()
result = strategy.GetOptionDesk()

来拿"IOptionDesk"

返回值: IOptionDesk.

GetOptionPositionChart
public IOptionPositionChart GetOptionPositionChart()
result = strategy.GetOptionPositionChart()

使IOptionPositionChart与通过的战略联系起来.

返回值: 图表。

GetParameters
public virtual IStrategyParam[] GetParameters()
result = strategy.GetParameters()

获取参数。

返回值: 参数.

GetPortfolio
public Portfolio GetPortfolio()
result = strategy.GetPortfolio()

如果未到场, 获取组合或丢出 InvalidOperationException 。

返回值: 组合

GetPositionValue
public decimal? GetPositionValue(Security security, Portfolio portfolio)
result = strategy.GetPositionValue(security, portfolio)

进入位置。

security
金融工具。
portfolio
组合.

返回值: 位置 准备

GetSecurity
public Security GetSecurity()
result = strategy.GetSecurity()

获取金融工具或扔出InvalidOperationException,如果不存在的话。

返回值: 金融工具

GetSecurityValue``1
public T GetSecurityValue<T>(Level1Fields field)
result = strategy.GetSecurityValue(field)

以获得战略工具的市场数据价值。

field
市场数据领域.

返回值: 字段值。 如果没有数据, 将返回 。

GetStatValue``2
protected TValue GetStatValue<TParam, TValue>(TValue fallback)
result = strategy.GetStatValue(fallback)

获得统计参数的值,按其类型进行。

fallback
如果找不到参数, 则倒数值 。

返回值: 参数值或.

GetTargetPosition
public decimal? GetTargetPosition(Security security, Portfolio portfolio)
result = strategy.GetTargetPosition(security, portfolio)

获取指定金融工具和组合的目标位置。

security
金融工具。
portfolio
组合.

返回值: 目标位置, 或没有设定为无效 。

GetTargetPosition
public decimal? GetTargetPosition()
result = strategy.GetTargetPosition()

获取战略金融工具和证券的目标位置。

返回值: 目标位置, 或没有设定为无效 。

GetWorkingPortfolios
public virtual IEnumerable<Portfolio> GetWorkingPortfolios()
result = strategy.GetWorkingPortfolios()

获得战略所需的所有项目。

返回值: 组合.

GetWorkingSecurities
public virtual IEnumerable<ValueTuple<Security, DataType>> GetWorkingSecurities()
result = strategy.GetWorkingSecurities()

获取战略所需的所有金融工具。

返回值: 金融工具。

InitStartValues
protected void InitStartValues()
strategy.InitStartValues()

内出.

IsFormedAndOnline
public bool IsFormedAndOnline()
result = strategy.IsFormedAndOnline()

IsFormed和IsOnline.

返回值: 检查结果。

IsFormedAndOnlineAndAllowTrading
public bool IsFormedAndOnlineAndAllowTrading(StrategyTradingModes required)
result = strategy.IsFormedAndOnlineAndAllowTrading(required)

IsFormedAndOnline和TradingMode.

required
需要行动。

返回值: 检查结果。

IsOrderEditable
public bool? IsOrderEditable(Order order)
result = strategy.IsOrderEditable(order)

确定指定的顺序,可以按命令编辑。

order
肃静

返回值: 如果命令可以编辑,则命令不能被更改,意味着没有信息。

IsOrderReplaceable
public bool? IsOrderReplaceable(Order order)
result = strategy.IsOrderReplaceable(order)

确定指定的顺序,可以被命令所取代。

order
肃静

返回值: 如果命令可以替换,则命令不能被替换,意味着没有信息。

Load
public override void Load(SettingsStorage storage)
strategy.Load(storage)

装入设置 。

storage
设置存储 。
LookupByIdAsync
public ValueTask<Security> LookupByIdAsync(SecurityId id, CancellationToken cancellationToken)
result = strategy.LookupByIdAsync(id, cancellationToken)

以能辨识取出器.

id
金融工具标识。
cancellationToken
CancellationToken

返回值: 获得的乐器。 如果没有特定标准, 则返回 。

OnError
protected virtual void OnError(Strategy strategy, Exception error)
strategy.OnError(strategy, error)

处理错误,是战略操作的结果。

strategy
战略。
error
错误。
OnOrderReceived
protected virtual void OnOrderReceived(Order order)
strategy.OnOrderReceived(order)

已讫入定.

order
顺序
OnOrderRegistered
protected virtual void OnOrderRegistered(Order order)
strategy.OnOrderRegistered(order)

To call the event OrderRegistered.

order
肃静
OnOrderRegisterFailed
protected virtual void OnOrderRegisterFailed(OrderFail fail, bool calcRisk)
strategy.OnOrderRegisterFailed(fail, calcRisk)

这种方法,在策略命令注册错误时调用.

fail
注册命令出错 。
calcRisk
启动风险管理人。
OnOrderRegistering
protected virtual void OnOrderRegistering(Order order)
strategy.OnOrderRegistering(order)

To call the event OrderRegistering.

order
肃静
OnOrderReRegistering
protected virtual void OnOrderReRegistering(Order oldOrder, Order newOrder)
strategy.OnOrderReRegistering(oldOrder, newOrder)

To call the event OrderReRegistering.

oldOrder
取消订单 。
newOrder
新订入册.
OnOwnTradeReceived
protected virtual void OnOwnTradeReceived(MyTrade trade)
strategy.OnOwnTradeReceived(trade)

拥有交易权

trade
MyTrade
OnPositionReceived
protected virtual void OnPositionReceived(Position position)
strategy.OnPositionReceived(position)

收到立场

position
职位
OnReseted
protected virtual void OnReseted()
strategy.OnReseted()

是从重置方法调用的。

OnStarted
protected virtual void OnStarted(DateTimeOffset time)
strategy.OnStarted(time)

当开始方法被调用,ProcessState状态被取用起步值时,这种方法就被称为起步法.

OnStarted
protected virtual void OnStarted()
strategy.OnStarted()

当开始方法被调用,ProcessState状态被取用起步值时,这种方法就被称为起步法.

OnStarted2
protected virtual void OnStarted2(DateTime time)
strategy.OnStarted2(time)

当开始方法被调用,ProcessState状态被取用起步值时,这种方法就被称为起步法.

OnStopped
protected virtual void OnStopped()
strategy.OnStopped()

当ProcessState进程状态被取出已停止的值时,该方法就被称为被取出.

OnStopping
protected virtual void OnStopping()
strategy.OnStopping()

当ProcessState进程状态被取为停止值时,该方法就叫作.

Param``1
public StrategyParam<T> Param<T>(string id, T initialValue)
result = strategy.Param(id, initialValue)

初始化了 & ##StrategyParam+#的新实例.

id
参数标识符。
initialValue
初标相相相相相.

返回值: 战略参数.

Prepare
public void Prepare()
strategy.Prepare()

为生成报告准备数据。 在访问任何数据之前请先拨打, 以确保所有值都更新 。

ProcessOrder
private void ProcessOrder(Order order, bool isChanging)
strategy.ProcessOrder(order, isChanging)

以增上所从之所取之相.

order
肃静
isChanging
订单来自变更事件.
RaiseLog
protected override void RaiseLog(LogMessage message)
strategy.RaiseLog(message)
RaiseParametersChanged
public void RaiseParametersChanged(string name)
strategy.RaiseParametersChanged(name)

呼叫事件ParametersChanged和PropertyChanged。

name
参数名.
RaiseProcessStateChanged
protected void RaiseProcessStateChanged(Strategy strategy)
strategy.RaiseProcessStateChanged(strategy)

To call the event ProcessStateChanged.

strategy
战略。
RaiseReseted
private void RaiseReseted()
strategy.RaiseReseted()

唤作事事重设.

RegisterOrder
public void RegisterOrder(Order order)
strategy.RegisterOrder(order)

登记新秩序。

order
登记细节。
ReRegisterOrder
public void ReRegisterOrder(Order oldOrder, Order newOrder)
strategy.ReRegisterOrder(oldOrder, newOrder)

重订令.

oldOrder
取消订单 。
newOrder
新订入册.
Reset
public void Reset()
strategy.Reset()

要重新初始化交易算法,它被初始化策略对象并加载存储参数后称为.

SafeGetConnector
public IConnector SafeGetConnector()
result = strategy.SafeGetConnector()

要获得 Connector 策略。 如果它没有初始化, 例外将被丢弃 。

返回值: Connector.

Save
public void Save(SettingsStorage storage, bool saveStatistics, bool saveSystemParameters)
strategy.Save(storage, saveStatistics, saveSystemParameters)

保存设置 。

storage
SettingsStorage
saveStatistics
KeepStatistics
saveSystemParameters
保存系统参数 。
Save
public override void Save(SettingsStorage storage)
strategy.Save(storage)

保存设置 。

storage
设置存储 。
SellLimit
public Order SellLimit(decimal price, decimal? volume, Security security)
result = strategy.SellLimit(price, volume, security)

创建初始订单对象以进行销售.

price
价相相相会.
volume
音量。 如果值被传递, 那么使用音量值 。
security
金融工具 如果通过价值,则使用金融工具价值。

返回值: 初始化顺序对象 。

SellMarket
public Order SellMarket(decimal? volume, Security security)
result = strategy.SellMarket(volume, security)

以市场价格创建销售订单的初始化对象.

volume
音量。 如果值被传递, 那么使用音量值 。
security
金融工具 如果通过价值,则使用金融工具价值。

返回值: 初始化顺序对象 。

SetAlertService
public void SetAlertService(IAlertNotificationService service)
strategy.SetAlertService(service)

设置一个IAlertNotificationService 为战略。

service
警报服务
SetChart
public void SetChart(IChart chart)
strategy.SetChart(chart)

以定一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一

chart
图表。
SetOptionDesk
public void SetOptionDesk(IOptionDesk desk)
strategy.SetOptionDesk(desk)

To set the IOptionDesk.

desk
IOptionDesk.
SetOptionPositionChart
public void SetOptionPositionChart(IOptionPositionChart chart)
strategy.SetOptionPositionChart(chart)

以定一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一

chart
图表。
SetPositionValue
public void SetPositionValue(Security security, Portfolio portfolio, decimal value, DateTime time)
strategy.SetPositionValue(security, portfolio, value, time)

设所入地.

security
金融工具。
portfolio
组合.
value
位置 准备
time
如果新创建了位置, 则指定为 & # ###LocalTime+# # 和 ###ServerTime+# # 的时间戳 。
SetTargetPosition
public void SetTargetPosition(decimal target)
strategy.SetTargetPosition(target)

确定战略金融工具和证券组合的目标位置。

target
目标位置值 。
SetTargetPosition
public void SetTargetPosition(Security security, Portfolio portfolio, decimal target)
strategy.SetTargetPosition(security, portfolio, target)

为指定的金融工具和组合设定目标位置。

security
金融工具。
portfolio
组合.
target
目标位置值 。
Start
public virtual void Start()
strategy.Start()

开始交易算法。

StartProtection
protected void StartProtection(Unit takeProfit, Unit stopLoss, bool isStopTrailing, TimeSpan? takeTimeout, TimeSpan? stopTimeout, bool useMarketOrders, bool isLocalStop)
strategy.StartProtection(takeProfit, stopLoss, isStopTrailing, takeTimeout, stopTimeout, useMarketOrders, isLocalStop)

开始定位保护

takeProfit
纽约
stopLoss
缩写为A/C.5/60/L.
isStopTrailing
是否使用跟踪技术 。
takeTimeout
限时 保护到此时尚未奏效的,该地站将上市关闭.
stopTimeout
限时 保护到此时尚未奏效的,该地站将上市关闭.
useMarketOrders
是否使用市场订单.
isLocalStop
强迫本地停止处理,不管适配器能力如何.
StartTimer
protected ITimerHandler StartTimer(TimeSpan interval, Action callback)
result = strategy.StartTimer(interval, callback)

创建一个按指定间隔执行调用并立即启动的计时器 。

interval
时相相接.
callback
召回执行 。

返回值: ITimerHandler

Stop
public virtual void Stop()
strategy.Stop()

以止贸易算法.

Stop
public void Stop(Exception error)
strategy.Stop(error)

以出错为由阻止交易算法.

error
错误。
Subscribe
public void Subscribe(Subscription subscription)
strategy.Subscribe(subscription)

订户.

subscription
订阅.
SubscribeCandles
protected ISubscriptionHandler<ICandleMessage> SubscribeCandles(Subscription subscription)
result = strategy.SubscribeCandles(subscription)

订阅取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取

subscription
订阅

返回值: SubscriptionHandler

SubscribeCandles
protected ISubscriptionHandler<ICandleMessage> SubscribeCandles(DataType dt, bool isFinishedOnly, Security security)
result = strategy.SubscribeCandles(dt, isFinishedOnly, security)

订阅取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取

dt
DataType
isFinishedOnly
IsFinishedOnly
security
金融工具. 如果金融工具没有通过,则使用金融工具价值。

返回值: SubscriptionHandler

SubscribeCandles
protected ISubscriptionHandler<ICandleMessage> SubscribeCandles(TimeSpan tf, bool isFinishedOnly, Security security)
result = strategy.SubscribeCandles(tf, isFinishedOnly, security)

订阅取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取

tf
时间范围。
isFinishedOnly
IsFinishedOnly
security
金融工具. 如果金融工具没有通过,则使用金融工具价值。

返回值: SubscriptionHandler

SubscribeLevel1
protected ISubscriptionHandler<Level1ChangeMessage> SubscribeLevel1(Subscription subscription)
result = strategy.SubscribeLevel1(subscription)

订阅到一级.

subscription
订阅

返回值: SubscriptionHandler

SubscribeLevel1
protected ISubscriptionHandler<Level1ChangeMessage> SubscribeLevel1(Security security)
result = strategy.SubscribeLevel1(security)

订阅到一级.

security
金融工具. 如果金融工具没有通过,则使用金融工具价值。

返回值: SubscriptionHandler

SubscribeOrderBook
protected ISubscriptionHandler<IOrderBookMessage> SubscribeOrderBook(Subscription subscription)
result = strategy.SubscribeOrderBook(subscription)

Subscribe to MarketDepth.

subscription
订阅

返回值: SubscriptionHandler

SubscribeOrderBook
protected ISubscriptionHandler<IOrderBookMessage> SubscribeOrderBook(Security security)
result = strategy.SubscribeOrderBook(security)

Subscribe to MarketDepth.

security
金融工具. 如果金融工具没有通过,则使用金融工具价值。

返回值: SubscriptionHandler

SubscribeTicks
protected ISubscriptionHandler<ITickTradeMessage> SubscribeTicks(Subscription subscription)
result = strategy.SubscribeTicks(subscription)

订阅到 Ticks 。

subscription
订阅

返回值: SubscriptionHandler

SubscribeTicks
protected ISubscriptionHandler<ITickTradeMessage> SubscribeTicks(Security security)
result = strategy.SubscribeTicks(security)

订阅到 Ticks 。

security
金融工具. 如果金融工具没有通过,则使用金融工具价值。

返回值: SubscriptionHandler

ToReportValue
protected virtual object ToReportValue(object value)
result = strategy.ToReportValue(value)

要将参数值转换为报告值。

value
参数值 。

返回值: 报告的价值。

TryAddMyTrade
public bool TryAddMyTrade(MyTrade trade)
result = strategy.TryAddMyTrade(trade)

试试自己增加交易

trade
MyTrade

返回值: 操作结果。

UnSubscribe
public void UnSubscribe(Subscription subscription)
strategy.UnSubscribe(subscription)

解订.

subscription
订阅.

事件

BoardReceived
public event Action<Subscription, ExchangeBoard> BoardReceived
strategy.BoardReceived += handler

ExchangeBoard received.

CandleReceived
public event Action<Subscription, ICandleMessage> CandleReceived
strategy.CandleReceived += handler

ICandleMessage received.

CommissionChanged
public event Action CommissionChanged
strategy.CommissionChanged += handler

佣金变更活动.

ConnectorChanged
public event Action ConnectorChanged
strategy.ConnectorChanged += handler

战略连接事件改变.

CurrentTimeChanged
public event Action<TimeSpan> CurrentTimeChanged
strategy.CurrentTimeChanged += handler

服务器时间更改了 CurrentTime 。 它通过了事件上次通话以来的时差, 事件第一次通过值为零 。

DataTypeReceived
public event Action<Subscription, DataType> DataTypeReceived
strategy.DataTypeReceived += handler

DataType received.

Error
public event Action<Strategy, Exception> Error
strategy.Error += handler

策略中出错的事件 。

IsOnlineChanged
public event Action<Strategy> IsOnlineChanged
strategy.IsOnlineChanged += handler

战略在线状态变化事件.

LatencyChanged
public event Action LatencyChanged
strategy.LatencyChanged += handler

即时变化事件.

Level1Received
public event Action<Subscription, Level1ChangeMessage> Level1Received
strategy.Level1Received += handler

Level1ChangeMessage received.

NewMyTrade
public event Action<MyTrade> NewMyTrade
strategy.NewMyTrade += handler

拥有交易权

NewsReceived
public event Action<Subscription, News> NewsReceived
strategy.NewsReceived += handler

消息收到 。

OrderBookDrawing
public event Action<Subscription, IOrderBookSource, IOrderBookMessage> OrderBookDrawing
strategy.OrderBookDrawing += handler

IOrderBookMessage).

OrderBookDrawingOrder
public event Action<Subscription, IOrderBookSource, Order> OrderBookDrawingOrder
strategy.OrderBookDrawingOrder += handler

肃静.

OrderBookDrawingOrderFail
public event Action<Subscription, IOrderBookSource, OrderFail> OrderBookDrawingOrderFail
strategy.OrderBookDrawingOrderFail += handler

OrderFail).

OrderBookReceived
public event Action<Subscription, IOrderBookMessage> OrderBookReceived
strategy.OrderBookReceived += handler

IOrderBookMessage received.

OrderCancelFailed
public event Action<OrderFail> OrderCancelFailed
strategy.OrderCancelFailed += handler

命令取消错误事件 。

OrderCancelFailReceived
public event Action<Subscription, OrderFail> OrderCancelFailReceived
strategy.OrderCancelFailReceived += handler

OrderFail cancellation event.

OrderCanceling
public event Action<Order> OrderCanceling
strategy.OrderCanceling += handler

发送取消命令的事件 。

OrderChanged
public event Action<Order> OrderChanged
strategy.OrderChanged += handler

命令已更改( 已取消, 匹配 ) 。

OrderEdited
public event Action<long, Order> OrderEdited
strategy.OrderEdited += handler

秩序)成功结果事件.

OrderEditFailed
public event Action<long, OrderFail> OrderEditFailed
strategy.OrderEditFailed += handler

顺序)出错结果事件.

OrderEditFailReceived
public event Action<Subscription, OrderFail> OrderEditFailReceived
strategy.OrderEditFailReceived += handler

OrderFail edition event.

OrderLogReceived
public event Action<Subscription, IOrderLogMessage> OrderLogReceived
strategy.OrderLogReceived += handler

IOrderLogMessage received.

OrderReceived
public event Action<Subscription, Order> OrderReceived
strategy.OrderReceived += handler

已讫入定.

OrderRegistered
public event Action<Order> OrderRegistered
strategy.OrderRegistered += handler

订单成功注册的事件.

OrderRegisterFailed
public event Action<OrderFail> OrderRegisterFailed
strategy.OrderRegisterFailed += handler

命令注册错误事件 。

OrderRegisterFailReceived
public event Action<Subscription, OrderFail> OrderRegisterFailReceived
strategy.OrderRegisterFailReceived += handler

OrderFail注册活动.

OrderRegistering
public event Action<Order> OrderRegistering
strategy.OrderRegistering += handler

发出登记令的事件。

OrderReRegistering
public event Action<Order, Order> OrderReRegistering
strategy.OrderReRegistering += handler

发令再登记之事.

OwnTradeReceived
public event Action<Subscription, MyTrade> OwnTradeReceived
strategy.OwnTradeReceived += handler

MyTrade received.

ParametersChanged
public event Action ParametersChanged
strategy.ParametersChanged += handler

参数变化事件.

PnLChanged
public event Action PnLChanged
strategy.PnLChanged += handler

PnL变相事件.

PnLReceived
public event Action<Subscription> PnLReceived
strategy.PnLReceived += handler

PnL变相事件.

PnLReceived2
public event Action<Subscription, Portfolio, DateTime, decimal, decimal?, decimal?> PnLReceived2
strategy.PnLReceived2 += handler

PnL变相事件.

PortfolioReceived
public event Action<Subscription, Portfolio> PortfolioReceived
strategy.PortfolioReceived += handler

投资组合收到。

PositionChanged
public event Action PositionChanged
strategy.PositionChanged += handler

位置改变事件 。

PositionReceived
public event Action<Subscription, Position> PositionReceived
strategy.PositionReceived += handler

收到立场

ProcessStateChanged
public event Action<Strategy> ProcessStateChanged
strategy.ProcessStateChanged += handler

ProcessState变相事件.

PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
strategy.PropertyChanged += handler

图表元素属性值变化事件 。

Reseted
public event Action Reseted
strategy.Reseted += handler

战略再起事件.

SecurityReceived
public event Action<Subscription, Security> SecurityReceived
strategy.SecurityReceived += handler

收到的金融工具。

SlippageChanged
public event Action SlippageChanged
strategy.SlippageChanged += handler

页码更改事件.

SubscriptionFailed
public event Action<Subscription, Exception, bool> SubscriptionFailed
strategy.SubscriptionFailed += handler

订阅失败 。

SubscriptionOnline
public event Action<Subscription> SubscriptionOnline
strategy.SubscriptionOnline += handler

订阅内容已在线。

SubscriptionReceived
public event Action<Subscription, object> SubscriptionReceived
strategy.SubscriptionReceived += handler

价值已收.

SubscriptionStarted
public event Action<Subscription> SubscriptionStarted
strategy.SubscriptionStarted += handler

订阅工作已经开始。

SubscriptionStopped
public event Action<Subscription, Exception> SubscriptionStopped
strategy.SubscriptionStopped += handler

订阅停止 。

TickTradeReceived
public event Action<Subscription, ITickTradeMessage> TickTradeReceived
strategy.TickTradeReceived += handler

ITickTradeMessage received.