I found this code on the internet to show the potential profit % and the breakeven price for the options chain but its only working for Put side for some reason. Could someone help look at the code and fix it to work for Call and Puts?
def maxShares = 100;
def maxContracts = 1;
def premium_call = maxContracts * (bid + ask) / 2 * 100;
def premiumPct_call = premium_call / (maxShares * close(GetUnderlyingSymbol()));
def strikePriceGain_call = GetStrike() - close(GetUnderlyingSymbol());
def premiumPlusSharesPct = ((strikePriceGain_call * maxShares) + premium_call) / (maxShares * close(GetUnderlyingSymbol()));
def premium_put = maxContracts * close * maxShares;
def premiumPct_put = premium_put/(maxShares * close(getUnderlyingSymbol()));
def newBreakevenPrice_put = getStrike() - close;
AddLabel(!isPut(), AsPercent(premiumPct_call) + " | " + AsPercent(premiumPlusSharesPct), color.WHITE);
AddLabel(isPut(), AsPercent(premiumPct_put) + " | " + AsPrice(newBreakevenPrice_put), color.WHITE);
def maxShares = 100;
def maxContracts = 1;
def premium_call = maxContracts * (bid + ask) / 2 * 100;
def premiumPct_call = premium_call / (maxShares * close(GetUnderlyingSymbol()));
def strikePriceGain_call = GetStrike() - close(GetUnderlyingSymbol());
def premiumPlusSharesPct = ((strikePriceGain_call * maxShares) + premium_call) / (maxShares * close(GetUnderlyingSymbol()));
def premium_put = maxContracts * close * maxShares;
def premiumPct_put = premium_put/(maxShares * close(getUnderlyingSymbol()));
def newBreakevenPrice_put = getStrike() - close;
AddLabel(!isPut(), AsPercent(premiumPct_call) + " | " + AsPercent(premiumPlusSharesPct), color.WHITE);
AddLabel(isPut(), AsPercent(premiumPct_put) + " | " + AsPrice(newBreakevenPrice_put), color.WHITE);