Skip to main content

FibonacciSpeedResistanceArcsAnnotation

FibonacciSpeedResistanceArcsAnnotationšŸ“˜ draws concentric Fibonacci arcs from two placed points. Point 1 is the arc center. Point 2 defines the threshold 1 radius and chooses whether the arcs open above or below the center.

const { NumberRange, NumericAxis, SciChartSurface } = SciChart;
const {
EFibonacciLabelColorMode,
EFibonacciLabelPlacement,
FibonacciSpeedResistanceArcsAnnotation,
SciTraderLightTheme,
EAnnotationVisibilityMode
} = SciChartFinancialTools; // if using npm, import from "scichart-financial-tools";

const { wasmContext, sciChartSurface } = await SciChartSurface.create(divElementId, {
theme: new SciTraderLightTheme()
});

sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(0, 100) }));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(150, 900) }));

sciChartSurface.annotations.add(
new FibonacciSpeedResistanceArcsAnnotation({
// Point 2 is above point 1, so the arcs open upward.
points: [
{ x: 50, y: 260 },
{ x: 63, y: 550 } // does not NEED to be on the same x as first point
],
thresholds: [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1, 1.618],
regionColors: ["#0871B2", "darkgreen", "#D56E0B"],
fillOpacity: 0.25,
strokeThickness: 2,
// connectorLineStroke: "#242424",
connectorLineStrokeDashArray: [10, 3],
fibonacciLabelPlacement: EFibonacciLabelPlacement.Top,
fibonacciLabelColorMode: EFibonacciLabelColorMode.MultiColor,
formatFibonacciLabel: ({ thresholdLabel }) => ("ratio: " + thresholdLabel),

isEditable: true,
gripVisibility: EAnnotationVisibilityMode.Always
})
);

This annotation is arc-based, so it inherits the shared Fibonacci threshold, region and label properties from FibonacciArcAnnotationBasešŸ“˜. Regions are drawn between neighboring arcs. The connector line is often useful because it shows the reference radius used for threshold 1.

See Also​