GpuRelativeVigorIndexSignalCalculator

StockSharp.Algo.Gpu.Indicators

GPU calculator for Relative Vigor Index signal part.

继承自: GpuIndicatorCalculatorBase<RelativeVigorIndexSignal, GpuRelativeVigorIndexSignalParams, GpuIndicatorResult>

构造函数

GpuRelativeVigorIndexSignalCalculator
public GpuRelativeVigorIndexSignalCalculator(Context context, Accelerator accelerator)
gpuRelativeVigorIndexSignalCalculator = GpuRelativeVigorIndexSignalCalculator(context, accelerator)

Initializes a new instance of the GpuRelativeVigorIndexSignalCalculator class.

context
ILGPU context.
accelerator
ILGPU accelerator.

方法

Calculate
public override GpuIndicatorResult[][][] Calculate(GpuCandle[][] candlesSeries, GpuRelativeVigorIndexSignalParams[] parameters)
result = gpuRelativeVigorIndexSignalCalculator.Calculate(candlesSeries, parameters)
RelativeVigorIndexSignalKernel
private static void RelativeVigorIndexSignalKernel(Index3D index, ArrayView<GpuCandle> flatCandles, ArrayView<GpuIndicatorResult> flatResults, ArrayView<int> offsets, ArrayView<int> lengths, ArrayView<GpuRelativeVigorIndexSignalParams> parameters)
GpuRelativeVigorIndexSignalCalculator.RelativeVigorIndexSignalKernel(index, flatCandles, flatResults, offsets, lengths, parameters)

ILGPU kernel calculating Relative Vigor Index signal for multiple series and parameter sets. The CPU implementation buffers input values (extracted price) and computes a weighted average of the last Length values: (buf[0] + 2*buf[1] + 2*buf[2] + buf[3]) / 6.