//Modified MAMA by Joshua Ducao
//Public
//Set Variables
Set MACD_line = MACD(12,26,9, exponential)
Set MACD_signal = MACDSIGNAL(12,26,9, exponential)
Set Hist = MACD_line - MACD_signal
Set MACDhistup = if(hist > 0, hist ,0)
Set MACDhistdown = if(hist < 0, hist, 0)
Set RSI = RSI(close,14)
Set ALMA = alma(close,9,.85,6)
Set value = volume * close
Set ValueReq = sma(value,5)
Set BullishCross = crossover(MACD_Line, MACD_Signal) or crossover(MaCD_Signal,0)
//Set Conditions
Set Buy = BullishCross and close > alma and valuereq > 1000000
Set Sell = crossover(alma,close)
// Set variables
Set MACD_line = MACD(12,26,9, exponential)
Set MACD_signal = MACDSIGNAL(12,26,9, exponential)
Set Hist = MACD_line - MACD_signal
//Plot Indicators
plot(alma,line,firebrick,main)
plot(valuereq,line, gray, volume)
Set MACDhistup = if(hist > 0, hist ,0)
Set MACDhistdown = if(hist < 0, hist, 0)
plot(MACDhistup, stackedbar, green, MACD)
plot(MACDhistdown, stackedbar, red, MACD)
plot( MACD_line, line, any, MACD)
plot(MACD_signal, line, any, MACD)
//Plot Buy and Sell Signals
plot(Buy, Buy, Green, Main)
plot(Sell, Sell, Red, Main)
//plotbuysell (buy, sell, green, red, main)
//Backtest
signals(Buy,Sell)
