Андрей
Администратор
- Регистрация
- 28.01.14
- Сообщения
- 355
- Реакции
- 163
Андрей не предоставил никакой дополнительной информации.
Индикатор StochRSI со стрелками и алертами
Этот индикатор полная копия стандартного индикатора StochRSI и к нему добавлены стрелки на график и алерты.
Этот индикатор полная копия стандартного индикатора StochRSI и к нему добавлены стрелки на график и алерты.
Код:
input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_choice = {default "RSI Wilder", "RSI EMA"};
input RSI_price = close;
input KPeriod = 14;
input DPeriod = 3;
input slowing_period = 1;
input smoothingType = {Default SMA, EMA};
input Type = {Default FullD, FullK};
def FullD = StochRSI(RSI_length, over_bought, over_sold, RSI_choice, RSI_price, KPeriod, DPeriod, slowing_period, smoothingType).FullD;
def FullK = StochRSI(RSI_length, over_bought, over_sold, RSI_choice, RSI_price, KPeriod, DPeriod, slowing_period, smoothingType).FullK;
def ind;
switch (Type) {
case FullD:
ind = StochRSI(RSI_length, over_bought, over_sold, RSI_choice, RSI_price, KPeriod, DPeriod, slowing_period, smoothingType).FullD;
case FullK:
ind = StochRSI(RSI_length, over_bought, over_sold, RSI_choice, RSI_price, KPeriod, DPeriod, slowing_period, smoothingType).FullK;
}
plot bought = ind >= over_bought;
plot sold = ind <= over_sold;
bought.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sold.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bought.SetDefaultColor(Color.RED);
sold.SetDefaultColor(Color.GREEN);
Alert (ind >= over_bought, "Перекупленность");
Alert (ind <= over_sold, "Перепроданность");
AddLabel(bought, "Перекупленность", color.DARK_GREEN);
AddLabel(sold, "Перепроданность", color.DARK_RED);
Последнее редактирование модератором: