Psar rising price falling

Hi Kindly give code for the situation when 1) Buy when PSAR is rising but price is falling 2) Sell when PSAR is falling but price is rising Basically i want the code when PSAR and price are moving in opposite direction. Pls provide. .

For the above given condition you can check the PSAR code from the expert advisor page from this Link

Sir
I am not asking for price Psar crossover… I am asking for a situation when PSAR is rising but price is falling without change in Psar.
I.e psar up is rising and price falls(basically reloads) within the same psar.