Professional Documents
Culture Documents
// Version 1.5
Express AccelleratorOscillator
Vars
input $first_period(1,25,5), $second_period(25,100,34), $third_period(-1,-1,-1);
input $spanLeft(1,10,1);
input $spanRight(1,10,1);
input $MessageBox("No;Yes",0);
input $PlaySound("No;Yes",0);
input $SendEmail("No;Yes",0);
series line, greenLine, line_histogram, senti(50), swingline;
series disp, price, awe_osc, Mov1, Mov2, Mov3, zero;
numeric i, Max_Period;
Calculation
if IsFirstBar() then
begin
CalculateAtEveryTick(false);
Max_Period = Max(Max($first_period, $second_period), $third_period);
for i = 0 to Max_Period
begin
line[-i] = void;
greenLine[-i] = void;
line_histogram[-i] = void;
end
for i = 0 to FinalBarIndex()
begin
price[-i] = (high[-i] + low[-i]) / 2;
end
MovingAverage(price, Mov1, $first_period);
MovingAverage(price, Mov2, $second_period);
for i = 0 to FinalBarIndex()
begin
awe_osc[-i] = Mov1[-i] - Mov2[-i];
end
MovingAverage(awe_osc, Mov3, $first_period);
for i = 0 to FinalBarIndex()
begin
line[-i] = awe_osc[-i] - Mov3[-i];
disp[-i] = line[-i - $third_period];
swingline[-i] = line[-i+1];
if (line[-i+1] < swingline[-i+1]) and (line[-i] > swingline[-i]) then
begin
senti[-i] = 100;
if ($SendEmail = 1) then SendEmail("Buy signal","Buy signal
AccelleratorOscillator: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Buy signal AccelleratorOscillator: " +
SymbolName());
end
interpretation
begin
sentiment = senti;
end