Class StrategyParam<T>
- Namespace
- StockSharp.Algo.Strategies
- Assembly
- StockSharp.Algo.dll
Wrapper for typified access to the strategy parameter.
public class StrategyParam<T> : NotifiableObject, INotifyPropertyChangedEx, INotifyPropertyChanging, IStrategyParam, IPersistable, INotifyPropertyChanged, IAttributesEntity
Type Parameters
T
The type of the parameter value.
- Inheritance
-
StrategyParam<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
StrategyParam(string, T)
Initializes a new instance of the StrategyParam<T>.
public StrategyParam(string id, T initialValue = default)
Parameters
id
stringParameter identifier.
initialValue
TThe initial value.
Properties
Attributes
Gets the list of attributes associated with this entity.
public IList<Attribute> Attributes { get; }
Property Value
CanOptimize
Check can optimize parameter.
public bool CanOptimize { get; set; }
Property Value
Id
Parameter identifier.
public string Id { get; }
Property Value
OptimizeFrom
The From value at optimization.
public object OptimizeFrom { get; set; }
Property Value
OptimizeStep
The Increment value at optimization.
public object OptimizeStep { get; set; }
Property Value
OptimizeTo
The To value at optimization.
public object OptimizeTo { get; set; }
Property Value
Value
public T Value { get; set; }
Property Value
- T
Methods
Load(SettingsStorage)
Load settings.
public void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
Save(SettingsStorage)
Save settings.
public void Save(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
SetBasic(bool)
public StrategyParam<T> SetBasic(bool basic = true)
Parameters
basic
boolValue.
Returns
SetCanOptimize(bool)
Set CanOptimize value.
public StrategyParam<T> SetCanOptimize(bool canOptimize)
Parameters
canOptimize
boolThe value of CanOptimize.
Returns
- StrategyParam<T>
The strategy parameter.
SetDisplay(string, string, string)
Set display settings.
public StrategyParam<T> SetDisplay(string displayName, string description, string category)
Parameters
displayName
stringThe display name.
description
stringThe description of the diagram element parameter.
category
stringThe category of the diagram element parameter.
Returns
SetGreaterThanZero()
Set greater than zero validator.
public StrategyParam<T> SetGreaterThanZero()
Returns
SetHidden(bool)
Set BrowsableAttribute.
public StrategyParam<T> SetHidden(bool hidden = true)
Parameters
hidden
boolIs the parameter hidden in the editor.
Returns
SetNotNegative()
Set not negative validator.
public StrategyParam<T> SetNotNegative()
Returns
SetNullOrMoreZero()
Set null or more zero validator.
public StrategyParam<T> SetNullOrMoreZero()
Returns
SetNullOrNotNegative()
Set null or not negative validator.
public StrategyParam<T> SetNullOrNotNegative()
Returns
SetOptimize(T, T, T)
Fill optimization parameters.
public StrategyParam<T> SetOptimize(T optimizeFrom = default, T optimizeTo = default, T optimizeStep = default)
Parameters
optimizeFrom
TThe From value at optimization.
optimizeTo
TThe To value at optimization.
optimizeStep
TThe Increment value at optimization.
Returns
- StrategyParam<T>
The strategy parameter.
SetRange(T, T)
Set range validator.
public StrategyParam<T> SetRange(T min, T max)
Parameters
min
TMinimum value.
max
TMaximum value.
Returns
SetReadOnly(bool)
Set ReadOnlyAttribute.
public StrategyParam<T> SetReadOnly(bool value = true)
Parameters
value
boolValue.
Returns
ToString()
public override string ToString()