forked from tslab-hub/handlers
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBuysMinusSellsHandler.cs
More file actions
27 lines (25 loc) · 1.16 KB
/
BuysMinusSellsHandler.cs
File metadata and controls
27 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.ComponentModel;
using TSLab.Script.Handlers.Options;
namespace TSLab.Script.Handlers
{
[HandlerCategory(HandlerCategories.VolumeAnalysis)]
[HelperName("Buys Minus Sells", Language = Constants.En)]
[HelperName("Покупки минус продажи", Language = Constants.Ru)]
[InputsCount(1)]
[Input(0, TemplateTypes.SECURITY, Name = Constants.SecuritySource)]
[OutputsCount(1)]
[OutputType(TemplateTypes.DOUBLE)]
[Description("Показывает разницу характеристик (количество или суммарный объем) сделок на покупку и на продажу")]
[HelperDescription("A handler calculates statistics difference (amount or total volume) of a long and short trades", Constants.En)]
public sealed class BuysMinusSellsHandler : BuysSellsHandler
{
protected override double GetValue(ICachedTradeHistogram histogram)
{
return histogram.DeltaAskBidQuantity;
}
protected override int GetCount(ICachedTradeHistogram histogram)
{
return histogram.AskTradesCount - histogram.BidTradesCount;
}
}
}