@thuantan2060/technicalindicators
Version:
Techincal Indicators written in javascript
37 lines (36 loc) • 1.38 kB
TypeScript
import StockData from '../StockData';
import CandlestickFinder, { ICandlestickConfig } from './CandlestickFinder';
/**
* Configuration interface for TweezerTop pattern.
* Only requires scale parameter since this pattern uses direct price comparisons.
*/
export interface ITweezerTopConfig extends ICandlestickConfig {
}
/**
* Default configuration for TweezerTop pattern.
*/
export declare const DEFAULT_TWEEZER_TOP_CONFIG: ITweezerTopConfig;
export default class TweezerTop extends CandlestickFinder {
constructor(config?: ITweezerTopConfig);
logic(data: StockData): boolean;
upwardTrend(data: StockData): boolean;
hasTweezerTopPattern(data: StockData): boolean;
}
/**
* Detects TweezerTop candlestick pattern.
*
* A TweezerTop is a bearish reversal pattern that occurs at the end of an uptrend.
* It consists of two or more candles with approximately equal highs, suggesting
* resistance at that price level.
*
* @param data - Stock data containing OHLC values
* @param config - Configuration options for the pattern detection
* @returns True if TweezerTop pattern is detected, false otherwise
*
* @example
* ```typescript
* const data = { open: [...], high: [...], low: [...], close: [...] };
* const isPattern = tweezertop(data, { scale: 0.001 });
* ```
*/
export declare function tweezertop(data: StockData, config?: ITweezerTopConfig): any;