You are on page 1of 2

// Copyright Fipertec

// 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

if (line[-i+1] > swingline[-i+1]) and (line[-i] < swingline[-i]) then


begin
senti[-i] = 0;
if ($SendEmail = 1) then SendEmail("Sell signal","Sell signal
AccelleratorOscillator: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Sell signal AccelleratorOscillator: " +
SymbolName());
end
end
end
if CurrentBarIndex() > Max_Period then
begin
if line > disp then
greenLine = line;
else
greenLine = 0;
if line < disp then
line_histogram = line;
else
line_histogram = 0;
end

interpretation

begin
sentiment = senti;
end

//plot (line, 16,152,197, 2);


//plot (greenLine, 171,220,24, 2);
//plot (line_histogram, black, 1);

plotband(line, "green", 0, zero, "lightred", 0, "lightgreen");


plotband(line_histogram, "lightred", 0, zero, "green", 0,
"lightred");//@@@cs:928450-3785474-744239_cs@@@

You might also like