Since you did not provide the code for your lower study I am going to create a plot on this example, fixed at -1.8, called myLowerStudy. To make this work with your own lower study you will take the plot for that study and use it to replace the value of -1.8 in the sample code I am providing here. We have done numerous examples of line crossings, particularly using the Stochastic. So I am surprised you have not tried to hash this out on your own and post the code for us to review. If you want to learn something, be sure to make an attempt and post your code. But learning is optional.
The code is listed below and I have included a screenshot showing this plotted in the lower subgraph of a chart.
declare lower;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
def lowest_k = Lowest(priceL, KPeriod);
def c1 = priceC - lowest_k;
def c2 = Highest(priceH, KPeriod) - lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;
def FullK = MovingAverage(averageType, FastK, slowing_period);
def FullD = MovingAverage(averageType, FullK, DPeriod);
plot myLowerStudy = -1.8;
def crossesAbove
def slowKCrossesAboveSlowD = slowK[1] < slowD[1] and slowK > slowD;
def slowKCrossesBelowSlowD = slowK[1] > slowD[1] and slowK < slowD;
plot greenArrow = if slowKCrossesAboveSlowD then myLowerStudy else Double.NaN;
greenArrow.SetDefaultColor(Color.GREEN);
greenArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
plot redArrow = if slowKCrossesBelowSlowD then myLowerStudy else Double.NaN;
redArrow.SetDefaultColor(Color.RED);
redArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);