I'm trying to create a strategy that includes 2 basic factors:
- Creating a label that marks the second green bar to open above the 9 day SMA line on the chart as confirmation.
- Having a separate RSI indicator in it's own pane below the chart.
I'm having trouble keeping the RSI and bar confirmation labelling separate, the chart labels seem to get dragged down into the RSI pane below.
Also, Once I deleted the RSI code, the bar confirmation chart labels remained in the below pane where the RSI was.
Below is the code to mark the second green bar to open above the SMA, how do I get it out of the separate pane?
strategy(title="Swing Strat", overlay=false, pyramiding=1, default_qty_value=2, default_qty_type=strategy.fixed, initial_capital=10000, currency=currency.USD)
//Plotting MA
MAPeriod9 = input(9, title="9 MA Period")
MA9 = sma(close, MAPeriod9)
MAPeriod180 = input(180, title="180 MA Period")
MA180 = sma(close, MAPeriod180)
plot(MA9, color=color.blue, linewidth=1)
plot(MA180, color=color.red, linewidth=1)
//checking to see if there are 2 bars above the sma line
MAcrossover = crossover(close, MA9)
entrypoint = barssince(MAcrossover)
//marking the second green bar to open above the SMA line
if entrypoint==1 and MA9<open and open<close and open[1]<close[1]
lun1 = label.new(bar_index, open, 'entrypoint',
color=color.red,
textcolor=color.red,
style=label.style_xcross, size=size.small)
question from:
https://stackoverflow.com/questions/65843133/how-do-separate-panes-work-in-pinescript 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…