DEFPARAM CUMULATEORDERS=false
timeframe (5 minutes)
StochK5mn=Stochastic[5,3](close)
StochD5mn=Stochasticd[5,3,5](close)
c5mnachat=StochK5mn > StochD5mn and StochK5mn<50
c5mnvente=StochK5mn < StochD5mn and StochK5mn<50
timeframe(30 minutes)
StochK30mn=Stochastic[5,3](close)
StochD30mn=Stochasticd[5,3,5](close)
c30mnachat=StochK30mn < StochD30mn and StochK30mn<50
c30mnvente=StochK30mn < StochD30mn and StochK30mn<50
timeframe(default)
StochK1mn=Stochastic[5,3](close)
StochD1mn=Stochasticd[5,3,5](close)
c1mnachat=StochK1mn < 25 and StochK1mn crosses over StochD1mn
c1mnvente=StochK1mn > 75 and StochK1mn crosses under StochD1mn
if c1mnachat and c5mnachat and c30mnachat then
buy 1 share at market
elsif c1mnvente and c5mnvente and c30mnvente then
sellshort 1 share at market
endif