Multiple signals on chart

tllcoolj

Member
Joined
Jun 13, 2019
Posts
11
Likes
3
How can I have signals generated on two different graphs from the same Study/Strategy?
I have two graphs. One is the "Price Graph" and the second is added with "addPlot()" on the same chart and appearing in the lower section of the chart.
Based on certain conditions in each graph, I would like to generate signals to both graphs. However, signals are only generated on the "Price Graph" and the signals for the lower graph is ignored. Does the platform allows me to do this? If yes, how do I get this to work? If no, what is the reason?

Below is a snippet of the signal code for the lower graph and a graphic of the chart. Any help will be greatly appreciated.

code snippet:
if (rmasell) {
lowBuy = Double.MAX_VALUE;
highSell = rmaix;
Coordinate rmac = new Coordinate(rmaixseries.getStartTime(index), rmaix);
MarkerInfo rmamarker = getSettings().getMarker(Inputs.DOWN_MARKER);
String msg = get("SELL_PRICE_RMI", Util.round(rmaixprice, 2), Util.round(rmaix, 3));
if (rmamarker.isEnabled())
addFigure(new Marker(rmac, Enums.Position.TOP, rmamarker, msg));
debug("POSITION:" + " " + "rmasell=" + " " + rmasell);
ctx.signal(index, Signals.RMA_SELL, msg, rmaixprice);
}
802
 

tllcoolj

Member
Joined
Jun 13, 2019
Posts
11
Likes
3
Problem resolved! The signals on the lower plot was not active because it had to be identified in the addFigure method ...ex:
addFigure(plotName, rmamarker). The chart is two studies integrated to form one study and required the second plot to be explicitly identified in the addFigure method.
 
Top