Код: Выделить всё
function Initialize()
{
IndicatorName = "MA_histogram";
PriceStudy = false;
AddInput("Input1", Inputs.Candle);
AddSeries("SMA30", DrawAs.Custom, Color.Red );
AddSeries("SMA33", DrawAs.Custom, Color.Gold );
AddSeries("SMA10", DrawAs.Custom, Color.Snow);
AddSeries("SMA11", DrawAs.Custom, Color.Green);
AddParameter("SMA1", 20);
AddParameter("SMA2", 30);
AddParameter("SMA3", 100);
AddParameter("SMA4", 110);
}
function Evaluate()
{
double q=SMA(Input1, SMA1);
double w=SMA(Input1, SMA2);
double e=SMA(Input1, SMA3);
double r=SMA(Input1, SMA4);
if (SMA(Input1, SMA1) >SMA(Input1, SMA2) && SMA(Input1, SMA1)[1] <SMA(Input1, SMA2)[1])
SMA10=q;
SMA10.DrawVertical();
if (SMA(Input1, SMA1) <SMA(Input1, SMA2) && SMA(Input1, SMA1)[1] >SMA(Input1, SMA2)[1])
SMA11=w;
SMA11.DrawVertical();
if (SMA(Input1, SMA3) <SMA(Input1, SMA4))
SMA30=e;
SMA30.DrawVertical();
if (SMA(Input1, SMA3) >SMA(Input1, SMA4))
SMA33=r;
SMA33.DrawVertical();
}