GpuIndicatorCalculatorBase

StockSharp.Algo.Gpu

Base class for GPU-based indicator calculators.

实现: IGpuIndicatorCalculator

构造函数

GpuIndicatorCalculatorBase
protected GpuIndicatorCalculatorBase(Context context, Accelerator accelerator)
gpuIndicatorCalculatorBase = GpuIndicatorCalculatorBase(context, accelerator)

Base class for GPU-based indicator calculators.

context
ILGPU context.
accelerator
ILGPU accelerator.

属性

IndicatorType
public abstract Type IndicatorType { get; }
value = gpuIndicatorCalculatorBase.IndicatorType

IIndicator type this calculator is associated with.

ParameterType
public abstract Type ParameterType { get; }
value = gpuIndicatorCalculatorBase.ParameterType

IGpuIndicatorParams struct type used as parameter set for this indicator.

ResultType
public abstract Type ResultType { get; }
value = gpuIndicatorCalculatorBase.ResultType

GPU result struct type returned by this calculator.

方法

Calculate
public abstract IGpuIndicatorResult[][][] Calculate(GpuCandle[][] candlesSeries, IGpuIndicatorParams[] parameters)
result = gpuIndicatorCalculatorBase.Calculate(candlesSeries, parameters)

Calculate indicator for multiple series and multiple parameter sets in one GPU pass.

candlesSeries
Input candle series array. Each series can have different length.
parameters
Array of parameter sets to calculate for each series.

返回值: 3D array of GPU results: [series][parameter set][bar].

ExtractPrice
protected static float ExtractPrice(GpuCandle candle, Level1Fields priceType)
result = GpuIndicatorCalculatorBase.ExtractPrice(candle, priceType)

Extract price value from candle on GPU.

candle
Candle.
priceType
Price type.

返回值: Extracted price.

字段

Accelerator
protected readonly Accelerator Accelerator
value = gpuIndicatorCalculatorBase.Accelerator

ILGPU accelerator used for computations.

Context
protected readonly Context Context
value = gpuIndicatorCalculatorBase.Context

ILGPU context.