Hi Foxer,
Welcome to the forum.
Have a read of the MS User Manual, then attempt all of the programming exercises in the free Equis Formula Primer (available for free download from the files section of the forum). These will give you the programming skills you need to be able to perform these programming tasks for yourself. Also, have a good peruse through the forum as it already contains many questions just like yours which have been answered; sometimes there are many different ways to achieve an objective and the knowledgable forum members have shown these so you can choose a method which best suits you.
I don't quite understand what it is you're looking for, so this code might be not the exact answer to your problem, but I do hope it gives you some inspiration to try some different approaches.
event:=Mov(CLOSE,10,S)>Mov(CLOSE,15,S);
counter:=BarsSince(event);
If(event,Ref(counter,-1)+1,counter)
Are you sure you're looking for the "greater than " event and not a "crossing" event?
wabbit
"The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
Edsgar W. Dijkstra
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
For custom MetaStock programming : http://www.wabbit.com.au
My SkyPE status : 
My SkyPE account : wabbit.com.au