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);
}
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);
}