Escolar Documentos
Profissional Documentos
Cultura Documentos
FastAverage(2);
SlowAverage(5);
Stoploss(70);
Break(60);
var
sAvgFast : Float;
sAvgSlow : Float;
begin
///////////////////////////////////////////////////////
// Armazena os valores das m�dias em vari�veis de apoio
sAvgFast := MediaExp(FastAverage, Close);
sAvgSlow := Media(SlowAverage, Close);
///////////////////////////////////////////////////////
// Verifica se as condi��es de disparos de alarmes
// foram satisfeitas
if (IsSold) then
begin
//stoploss
BuyToCoverStop (SellPrice-Stoploss);
//Breakeven
if (SellPrice <= Break) then
BuyToCoverStop(SellPrice,SellPrice);
end
//stoploss
SellToCoverStop (BuyPrice-Stoploss);
//Breakeven
if (SellPrice <= Break) then
SellToCoverStop(BuyPrice,BuyPrice);
else
begin
if (close > media(SlowAverage , close))
and (sAvgFast > sAvgSlow)
then BuyAtMarket
else
if (close < media(SlowAverage,close))
and(sAvgFast < sAvgSlow) then
SellShortAtMarket;
end;
end;