addFigure question

Spin

Well-known member
Joined
May 22, 2019
Posts
474
Likes
189
In my newest study I would like to draw Figures above bars in the past. Inside the calculate-function I am checking all bars ("index"), so I have these lines of code, and they perform as desired:

Java:
MarkerInfo marker = getSettings().getMarker(MARKER2);
if (marker.isEnabled())
addFigure((new Marker(cHigh, Enums.Position.TOP, marker)));

This, however, does not work:

Java:
MarkerInfo marker = getSettings().getMarker(MARKER2);
if (marker.isEnabled())
addFigure(Plot.PRICE, index, (new Marker(cHigh, Enums.Position.TOP, marker)));

I receive the following error in my IDE:
error: no suitable method found for addFigure(String,int,Marker)
[javac] addFigure(Plot.PRICE, index, (new Marker(cHigh, Enums.Position.TOP, marker)));
[javac] ^
[javac] method Study.addFigure(Figure) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] method Study.addFigure(String,Figure) is not applicable
[javac] (actual and formal argument lists differ in length)


In the SDK guide I see this:

protected voidaddFigure(Figure figure)Adds a figure to the end of the figure list (for the default plot).
protected voidaddFigure(java.lang.String plotName, int index, Figure figure)Adds a figure to the start of the figure list for the plot associated with the given plot name.



I can't see why it doesn't work. Is a marker not a 'figure' when it is added to the start of the figure list ? :unsure:
 
Top