liminal-rider
New member
Hi There forum,
I wish to do the following:
I wish to do the following:
- add up/down arrow below/above the price candle when the STC crosses above/below the oversold/overbought lines.
- add buy/sell alert messages when the above condition is met.
Code:
declare lower;
input fastLength = 23;
input slowLength = 50;
input KPeriod = 10;
input DPeriod = 3;
input over_bought = 75;
input over_sold = 25;
input neutral_zone = 50;
input averageType = AverageType.EXPONENTIAL;
def macd = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
def fastK1 = FastKCustom(macd, KPeriod);
def fastD1 = MovingAverage(averageType, fastK1, DPeriod);
def fastK2 = FastKCustom(fastD1, KPeriod);
plot STC = MovingAverage(averageType, fastK2, DPeriod);
plot OverBought = over_bought;
plot OverSold = over_sold;
plot Neutral = neutral_zone;
STC.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(7));
OverSold.SetDefaultColor(GetColor(7));
Neutral.SetDefaultColor(GetColor(7));
Last edited by a moderator: