I want to plot the equity curve on the price, to compare the strategy to simple buy and hold. To make the graph useful, the equity curve could either start on the initial equity, or in line with the first price on the graph or no equity curve at all depending on manual input.
Using the code below, I get this:
line xx: Cannot use 'plot' in local scope.
line xx: Cannot use 'plot' in local scope.
equitycurvetype = input(defval="No", title='Equity Curve Type', options=["No","Yes","Yes same start"])
if equitycurvetype == "Yes"
plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
if equitycurvetype == "Yes same start"
plot(strategy.equity * close[bar_index]/strategy.initial_capital, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)