Professional Documents
Culture Documents
//
// Mais informações:
// https://www.mql5.com/pt/code/17413?fbclid=IwAR19JWPlsK-
sKTBvxttrHzrdKIFkB3FJOKU2-bzTBAW-nDWIpdkLKfwscqk
// ou:
// https://www.prorealcode.com/prorealtime-indicators/bb-stops-stochastic/?
fbclid=IwAR2Byu0y360gx4bJ-6snuotrpsZZpTs3sPfc0OrcoGhj_Afoss5bpFT-p7c
// BBstops Stochastic| indicator
input
StoPeriod (32); // Stochastic period
StoSlowing (9); // Stochastic slowing period
MaPeriod (20); // Bollinger bands period
MaMethod (0); // Moving average method
DevPeriod (20); // Deviations period
Deviation (1); // Deviation
Risk (1); // Risk
// --- end of settings
var
trend: integer;
begin
sto:= SlowStochastic(StoPeriod);
dev:= StdDevs(sto,DevPeriod);
ma:= Media(MaPeriod,sto);
amax:= ma+dev*Deviation;
amin:= ma-dev*Deviation;
bmax:= amax+0.5*(Risk-1)*(amax-amin);
bmin:= amin-0.5*(Risk-1)*(amax-amin);
if (sto>amax[1]) then
trend:=+1;
if (sto<amin[1]) then
trend:=-1;
plot(sto); setplotcolor(1,clSilver);
plot3(bmax); setplotcolor(3,clRed);
plot4(bmin); setplotcolor(4,clLime);
end;