Job finished
Execution time 2 days
Specification
Queria apenas alterar os parâmetros abaixo. Em vez de média lenta, queria que a compra a venda ocorressem quando A MEDIA RAPIDA cruzasse o CCI.
Portanto, gostaria de trocar MediaLenta por CCI.
SEGUE EXEMPLO DE CRUZAMENTO DE MÉDIAS
/////////////////////////////////////////////////////////
//
// Cruzamento de Médias
//
/////////////////////////////////////////////////////////
parâmetro
MediaRapida(9);
MediaLenta(21);
var
sMedRapida : Real;
sMedLenta : Real;
sPrevMedRapida : Real;
sPrevMedLenta : Real;
begin
///////////////////////////////////////////////////////
// Armazena os valores das médias em variáveis de apoio
sMedRapida := Media(MediaRapida, Fechamento);
sMedLenta := Media(MediaLenta, Fechamento);
sPrevMedRapida := sMedRapida[1];
sPrevMedLenta := sMedLenta[1];
///////////////////////////////////////////////////////
// Verifica se as condições de disparos de alarmes
// foram satisfeitas
se (sPrevMedRapida < sPrevMedLenta) e (sMedRapida > sMedLenta) então
inicio
Se(isSold = true) então
BuyToCoverAtMarket;
BuyAtMarket;
fim
senão se (sPrevMedRapida > sPrevMedLenta) e (sMedRapida < sMedLenta) então
inicio
Se(isBought = true) então
SellToCoverAtMarket;
SellShortAtMarket;
fim;
end;
Responded
1
Rating
Projects
0
0%
Arbitration
1
0%
/
0%
Overdue
0
Working
2
Rating
Projects
143
52%
Arbitration
8
13%
/
75%
Overdue
22
15%
Free
Project information
Budget
30+ USD