Escolar Documentos
Profissional Documentos
Cultura Documentos
P(25);
mm(9);
FastPeriod(12);
SlowPeriod(26);
TriggerPeriod(9);
var
vaIFR : Real;
vMM : Real;
sinal0:real;
sinal1:real;
sinal2:real;
mm9:real;
sFast : Float;
sSlow : Float;
sTrigger : Float;
begin
if (CurrentBar > SlowPeriod) then
begin
/////////////////////////
// Calcula os necessários
sFast := MediaExp(FastPeriod, Close);
sSlow := MediaExp(SlowPeriod, Close);
sTrigger := MediaExp(TriggerPeriod, sFast - sSlow);
/////////////////////
// Desenha o resultado
Plot (sFast - sSlow);
Plot2(sTrigger);
end;
inicio
sinal0:=(sfast-sslow);
mm9:= mediaexp(mm,sinal0);
fim ;
Inicio
vaIFR := (RSI(P,0));
vMM := Media(P, vaIFR);
// Indicador
Plot(vaIFR);
Plot2(vMM);
Inicio
Se (IsSold) então
Inicio
Se vaIFR > vMM então
BuyToCoverAtMarket;
Fim
Senão Se (IsBought) então
Inicio
Se vaIFR < vMM então
SellToCoverAtMarket;
Fim
Senão
Inicio
Se (vaIFR > vMM) então
BuyAtMarket
Senão Se (vaIFR < vMM) então
SellShortAtMarket;
Fim;
Fim;
fim;
fim