Код: Выделить всё
function Initialize()
{
StrategyName = "Alfa_AO";
AddParameter("Pfast", 8, "", 1);
AddParameter("Pslow", 35, "", 1);
AddInput("Input1", Inputs.Candle, 60, true, "SBER=МБ ЦК");
LongLimit = 0;
ShortLimit = 0;
AddChartIndicator("AwesomeOscillator", new Dictionary <string, string>{{"Fast", "Pfast"},{"Slow", "Pslow"}});
}
function OnUpdate()
{
while( true)
{
ShowMessage("РАБОТАЕТ!!!");
/// ПРАВИЛО 1
if ( (AO(Input1, Pfast, Pslow) > AO(Input1, Pfast, Pslow)[1]) )
{
// EnterLong();
}
/// ПРАВИЛО 2
if ( (AO(Input1, Pfast, Pslow) < AO(Input1, Pfast, Pslow)[1]) )
{
//EnterShort();
}
System.Threading.Thread.Sleep(10000);
}
}