forked from tslab-hub/handlers
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVolumeForPeriodHandler.cs
More file actions
24 lines (22 loc) · 870 Bytes
/
VolumeForPeriodHandler.cs
File metadata and controls
24 lines (22 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.ComponentModel;
using TSLab.Script.Handlers.Options;
namespace TSLab.Script.Handlers
{
[HandlerCategory(HandlerCategories.VolumeAnalysis)]
[HelperName("Volume for period", Language = Constants.En)]
[HelperName("Объём за период", Language = Constants.Ru)]
[InputsCount(1)]
[Input(0, TemplateTypes.SECURITY, Name = Constants.SecuritySource)]
[OutputsCount(1)]
[OutputType(TemplateTypes.DOUBLE)]
[Description("Объём за период (суммарный или средний)")]
[HelperDescription("Volume for period (total or average)", Constants.En)]
public sealed class VolumeForPeriodHandler : ValueForPeriodHandler
{
protected override double GetValue(ISecurity security, int barIndex)
{
return security.Bars[barIndex].Volume;
}
}
}