function today_result = drawSlowStochastic(dates_enter, high_enter, low_enter, close_enter)
today_result = 0;
dates = dates_enter;

hi = high_enter;
lo = low_enter;
cl = close_enter;

%data = indicators([high_enter,low_enter,close_enter],'william',7)
%vout = [fpctk,fpctd] = indicators([hi,lo,cl] ,'fsto' ,5,3)
vout = indicators([hi,lo,cl],'ssto',5,3)

     spctk = vout(:,1);
     spctd = vout(:,2);

spctk_out = fints(dates, spctk)
spctd_out = fints(dates, spctd)

%just draw Slow Stochastic.
p2 = plot(spctk_out,'--g')
title('Slow Stochastic')
hold on
set(p2,'LineWidth', 2)
p3 = plot(spctd_out,':b')
set(p3,'LineWidth', 2)

plot(spctk_out.dates, 80*ones(1, length(spctk_out)),...  
'color', [0.5 0 0], 'linewidth', 2)
plot(spctk_out.dates, 20*ones(1, length(spctk_out)),... 
'color', [0 0.5 0], 'linewidth', 2)

legend('%K','%D')

NumTicks = 18;
L = get(gca,'XLim');

set(gca,'XTick',linspace(L(1),L(2),NumTicks))

% set(get(gca,'XLabel'),'Rotation',270)
dateaxis('x', 2)

hight = 80;
low = 20;

%---Slow Stochastic
fileID = fopen('SlowStoch.txt','wt');
flag = 'calm'

max_price = 0;
min_price = 0;

for i = 3:length(spctk)    
    last_value_K = spctk(i)
    last_value_D = spctd(i)
    
    pre_last_value_K = spctk(i-1)
    pre_last_value_D = spctd(i-1)
    last_price = cl(i)
    
    today = dates{i}
    
    if(last_price > max_price)
        max_price = last_price
    
        %medvedi divergence - ceny vzrostou na nove maximum, ale Stochastic ukazuje slabnouci
        %silu byku, ptz klesa
        if(pre_last_value_K > last_value_K && pre_last_value_D > last_value_D)
            flag = '!!! Bear divergence - sell !!!'    
        end    
    end
    
    if(last_price < min_price)
        min_price = last_price
    
        %byci divergence - ceny klasnou na nove minimum, ale Stochastic ukazuje slabnouci
        %medvedu, ptz roste
        if(pre_last_value_K < last_value_K && pre_last_value_D < last_value_D)
            flag = '!!! Bull divergence - buy !!!'    
        end    
    end
        
    %prekoupeni - Will je nad horni hranici - prodavat
    if(last_value_K > hight && last_value_D > hight)
            flag = '!!! Overbought - sell !!!'
    %preprodani - Will je pod spodni hranici - nakupovat
    elseif(last_value_K < low && last_value_D < low)
            flag = '!!! Oversold - buy !!!'
    else flag = 'calm'
    end
 
 nbytes = fprintf(fileID,'day : %s, pre_pre_last_value : %f, pre_last_value : %f, last_value : %f, flag - %s\n', today, pre_pre_last_value, pre_last_value, last_value, flag)
end
fclose(fileID);