@thuantan2060/technicalindicators
Version:
Techincal Indicators written in javascript
35 lines (34 loc) • 1.36 kB
TypeScript
import StockData from '../StockData';
import CandlestickFinder, { ICandlestickConfig } from './CandlestickFinder';
/**
* Configuration interface for PiercingLine pattern.
* Only requires scale parameter since this pattern uses direct price comparisons.
*/
export interface IPiercingLineConfig extends ICandlestickConfig {
}
/**
* Default configuration for PiercingLine pattern.
*/
export declare const DEFAULT_PIERCING_LINE_CONFIG: IPiercingLineConfig;
export default class PiercingLine extends CandlestickFinder {
constructor(config?: IPiercingLineConfig);
logic(data: StockData): boolean;
}
/**
* Detects PiercingLine candlestick pattern.
*
* A PiercingLine is a bullish reversal pattern that occurs at the end of a downtrend.
* It consists of a bearish candle followed by a bullish candle that opens below the
* previous day's low but closes above the midpoint of the previous day's body.
*
* @param data - Stock data containing OHLC values
* @param config - Configuration options for the pattern detection
* @returns True if PiercingLine pattern is detected, false otherwise
*
* @example
* ```typescript
* const data = { open: [...], high: [...], low: [...], close: [...] };
* const isPattern = piercingline(data, { scale: 0.001 });
* ```
*/
export declare function piercingline(data: StockData, config?: IPiercingLineConfig): any;