Thanks JC that is a very soon answer..
Yes i used the standard stochastic as given by ProRealTime, but it is in Dutch:
// Stochastic 14,3,5
plusHoog = highest[14](high)
plusLaag = lowest[14](low)
oscillator = (close – plusLaag) / (plusHoog – plusLaag) * 100
lijnK = average[3](oscillator)
lijnD = average[5](lijnK)
In my case lijnD is not used, we are talking about lijnK. This lijnK oscillates between 0 and 100.
The standard stochastic does not use the term close. It works with lijnK and lijnK[1] and so on….
The answer you give contains close and I think that will lead to confusion since close refers to price.
But your answer made me thinking. Maybe I should write:
c1 = lijnK CROSSES OVER 60
// Condition to buy
IF c1 THEN
aa = average[3](oscillator)
BUY 1 SHARES AT MARKET
ENDIF
c2 = lijnK CROSSES UNDER aa
// Condition to close long position
IF c2 THEN
SELL AT MARKET
ENDIF