TKSBrokerAPI is the trading platform for automation and simplifying the implementation of trading scenarios, as well as working with Tinkoff Invest API server via the REST protocol. The TKSBrokerAPI platform may be used in two ways: from the console, it has a rich keys and commands, or you can use it as Python module.
Anomaly Detection function using Hampel Filter. This function returns the minimum index of elements in anomaly list or index of the first maximum element in input series if this index less than anomaly element index.
After #112
Anomaly Detection function using Hampel Filter. This function returns the minimum index of elements in anomaly list or index of the first maximum element in input series if this index less than anomaly element index.
Examples:
HampelAnomalyDetection([1, 1, 1, 1, 1, 1]) -> None
HampelAnomalyDetection([1, 1, 1, 1, 111, 1]) -> 4
HampelAnomalyDetection([1, 1, 10, 1, 1, 1]) -> 2
HampelAnomalyDetection([111, 1, 1, 1, 1, 1]) -> 0
HampelAnomalyDetection([111, 1, 1, 1, 1, 111]) -> 0
HampelAnomalyDetection([1, 11, 1, 111, 1, 1]) -> 1
HampelAnomalyDetection([1, 1, 1, 111, 99, 11]) -> 3
HampelAnomalyDetection([1, 1, 11, 111, 1, 1, 1, 11111]) -> 2
HampelAnomalyDetection([1, 1, 1, 111, 111, 1, 1, 1, 1]) -> 3
HampelAnomalyDetection([1, 1, 1, 1, 111, 1, 1, 11111, 5555]) -> 4
HampelAnomalyDetection([9, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 1, 1]) -> 1
HampelAnomalyDetection([9, 13, 12, 12, 13, 12, 1000, 13, 12, 12, 300000, 12, 12, 13, 12, 2000, 1, 1, 1, 1]) -> 6