Код: Выделить всё
function Initialize()
{
  IndicatorName = "SMA_III";
  PriceStudy = true ;
  AddInput("Input", Inputs.Price);         
  AddParameter("Period", 1);                   
  AddGlobalVariable("D", Types.Double, 0.0);         
  AddSeries("S", DrawAs.Custom, Color.Yellow);   
}
function Evaluate()
{
  if ( CurrentIndex < Period )
  {
     D = D + Input[0];     
     S = D / (CurrentIndex + 1);     
  }
  else
  {
     D = D + Input[0] - Input[(int)(-Period)] ;     
     S = D / Period;   
  }
  if ( S[0] >= MY.индикатор.GetValue("L", 1))
       S.DrawLine(Color.Green, Line.DashSmall, 3);
  if ( S[0] <= MY.индикатор.GetValue("H", 1))
       S.DrawLine(Color.Red, Line.DashSmall, 3);
} Изображения (1057)
 Изображения (1057) Архивы (82)
 Архивы (82) Текстовые файлы (9)
 Текстовые файлы (9) Документы (7)
 Документы (7) Скрипты Альфа-Директ 4 (30)
 Скрипты Альфа-Директ 4 (30)