Buy = Cross(maFast, maSlow); Sell = Cross(maSlow, maFast); Buy = Cross(maFast, maSlow); Sell = 0; // Apply stops stopLossPct = 2; targetPct = 5;
// Entry conditions Buy = Cross(macd, signal) AND rsi < rsiOS; Sell = Cross(signal, macd) OR rsi > rsiOB;
Short = Sell; // optional shorting Cover = Buy;
// Mark buy/sell on chart PlotShapes(Buy * shapeUpArrow, colorGreen, 0, Low, -10); PlotShapes(Sell * shapeDownArrow, colorRed, 0, High, -10); rsiPeriod = 14; overbought = 70; oversold = 30; rsi = RSI(rsiPeriod);