Class FibonacciRetracementAnnotationCreationModifier
A modifier for creating FibonacciRetracementAnnotation instances via a two-point
tap-to-place or single continuous drag workflow.
If the finger moves beyond a small threshold before the first touch-up, both anchor points
are placed immediately from the drag gesture and the annotation is finalized. Otherwise, each
touch-up places the next anchor point (start, then end) with a rubber-band preview line shown
between the last confirmed point and the current touch position.
Extensibility: This modifier is designed to be easily subclassed. Override any of the
following protected methods to customize behavior:
Inheritance
FibonacciRetracementAnnotationCreationModifier
Namespace:
Assembly: .dll
Syntax
public class FibonacciRetracementAnnotationCreationModifier extends TouchModifierBase
Constructors
FibonacciRetracementAnnotationCreationModifier()
Declaration
public FibonacciRetracementAnnotationCreationModifier()
Methods
Configures the rubber-band preview annotation after creation.
Declaration
protected void configureRubberBandAnnotation(IAnnotation annotation)
Parameters
createAnnotation(Context context)
Creates a new FibonacciRetracementAnnotation instance to be placed on the chart.
Override this method to return a custom subclass with different default styling.
Declaration
protected tradingAnnotations.FibonacciRetracementAnnotation createAnnotation(Context context)
Parameters
| Type |
Name |
Description |
| Context |
context |
|
Returns
createOrUpdateRubberBandAnnotation(PointF fromPoint)
Declaration
protected void createOrUpdateRubberBandAnnotation(PointF fromPoint)
Parameters
| Type |
Name |
Description |
| PointF |
fromPoint |
|
createRubberBandAnnotation(Context context)
Creates the rubber-band preview annotation used to show the next segment while the user is
placing points. By default, this creates a LineAnnotation.
Declaration
protected IAnnotation createRubberBandAnnotation(Context context)
Parameters
| Type |
Name |
Description |
| Context |
context |
|
Returns
getCurrentAnnotation()
Declaration
public final tradingAnnotations.FibonacciRetracementAnnotation getCurrentAnnotation()
Returns
getCurrentPointIndex()
Gets the index of the next anchor point to be placed (0-based: 0 = start, 1 = end).
Declaration
public final int getCurrentPointIndex()
Returns
Declaration
public final tradingAnnotations.FibonacciRetracementAnnotation.LabelFormat getLabelFormat()
Returns
getLabelPlacement()
Declaration
public final tradingAnnotations.FibonacciRetracementAnnotation.LabelPlacement getLabelPlacement()
Returns
getLabelVerticalPosition()
Declaration
public final tradingAnnotations.FibonacciRetracementAnnotation.LabelVerticalPosition getLabelVerticalPosition()
Returns
getRubberBandAnnotation()
Declaration
public final IAnnotation getRubberBandAnnotation()
Returns
getRubberBandStroke()
Declaration
public final PenStyle getRubberBandStroke()
Returns
getXAxisId()
Declaration
public final String getXAxisId()
Returns
getYAxisId()
Declaration
public final String getYAxisId()
Returns
onAnnotationCreated(IAnnotation newAnnotation)
Called when the Fibonacci Retracement annotation is fully created (both anchor points placed).
Declaration
protected void onAnnotationCreated(IAnnotation newAnnotation)
Parameters
onTouchDown(ModifierTouchEventArgs args)
Called when MotionEvent#ACTION_DOWN event occurs
Declaration
protected boolean onTouchDown(ModifierTouchEventArgs args)
Parameters
Returns
Overrides
onTouchMove(ModifierTouchEventArgs args)
Called when MotionEvent#ACTION_MOVE event occurs
Declaration
protected boolean onTouchMove(ModifierTouchEventArgs args)
Parameters
Returns
Overrides
onTouchUp(ModifierTouchEventArgs args)
Called when MotionEvent#ACTION_UP event occurs
Declaration
protected boolean onTouchUp(ModifierTouchEventArgs args)
Parameters
Returns
Overrides
removeRubberBandAnnotation()
Declaration
protected void removeRubberBandAnnotation()
setAnnotationCreationListener(OnAnnotationCreatedListener listener)
Declaration
public final void setAnnotationCreationListener(OnAnnotationCreatedListener listener)
Parameters
setBasePointFor(tradingAnnotations.TradingAnnotationBase annotation, PointF point)
Sets a base point on the trading annotation at the given touch position. Only called on
touch-up (or from a resolved drag gesture) to avoid triggering internal ghost-line artifacts.
Declaration
protected void setBasePointFor(tradingAnnotations.TradingAnnotationBase annotation, PointF point)
Parameters
Sets the label text format applied to each FibonacciRetracementAnnotation created by this modifier. Pass null to auto-select based on the label placement.
Declaration
public final void setLabelFormat(tradingAnnotations.FibonacciRetracementAnnotation.LabelFormat labelFormat)
Parameters
setLabelPlacement(tradingAnnotations.FibonacciRetracementAnnotation.LabelPlacement labelPlacement)
Declaration
public final void setLabelPlacement(tradingAnnotations.FibonacciRetracementAnnotation.LabelPlacement labelPlacement)
Parameters
setLabelVerticalPosition(tradingAnnotations.FibonacciRetracementAnnotation.LabelVerticalPosition labelVerticalPosition)
Declaration
public final void setLabelVerticalPosition(tradingAnnotations.FibonacciRetracementAnnotation.LabelVerticalPosition labelVerticalPosition)
Parameters
setLinePoint(LineAnnotation line, PointF point, boolean isStart)
Declaration
protected static void setLinePoint(LineAnnotation line, PointF point, boolean isStart)
Parameters
setRubberBandAnnotationPoints(IAnnotation annotation, PointF fromPoint, PointF toPoint)
Sets both the start and end points of the rubber-band preview annotation.
Declaration
protected void setRubberBandAnnotationPoints(IAnnotation annotation, PointF fromPoint, PointF toPoint)
Parameters
| Type |
Name |
Description |
| IAnnotation |
annotation |
|
| PointF |
fromPoint |
|
| PointF |
toPoint |
|
setRubberBandStroke(PenStyle stroke)
Declaration
public final void setRubberBandStroke(PenStyle stroke)
Parameters
setXAxisId(String xAxisId)
Declaration
public final void setXAxisId(String xAxisId)
Parameters
| Type |
Name |
Description |
| String |
xAxisId |
|
setYAxisId(String yAxisId)
Declaration
public final void setYAxisId(String yAxisId)
Parameters
| Type |
Name |
Description |
| String |
yAxisId |
|
updateRubberBandEndPoint(PointF toPoint)
Declaration
protected void updateRubberBandEndPoint(PointF toPoint)
Parameters
| Type |
Name |
Description |
| PointF |
toPoint |
|