Hi and thanks for the responses. My problem isn't really solved however, perhaps because i may not have been clear about what exactly i want my EA to do.
So if i have an open position, i want it to look at the stochastic oscillator: when it reaches a certain threshold, look for the highest close in the last 10 candles. Then if for instance candle 4 had the highest closing value, i then want to subtract the average true range (ATR) of candle 4. If it was candle 6 i would subtract the ATR of candle 6 and so on.
So i can't seem to find the correct block to achieve this goal. If there is no block that can do this, i'd have to think of something else as i am no programmer and have no programming experience whatsoever... 
Again, thanks for the help and looking forward to any responses.