# Parabolic SAR



## Herlequin (10 March 2009)

Hi Aussie stock forum members,

I am currently trading the China market and would like your assistance with a metastock forumula (my programing skills = 0 )

I have looking for a metastock search that will find the first day that the low is higher than the parabolic sar value. So the low closing above the parabolic sar (long search)

Any assistance will be greatly appreciated


----------



## MS+Tradesim (10 March 2009)

Cross(L,sar(x,y))


----------



## Herlequin (10 March 2009)

thank you very much for the quick response.

This is the same as I first used. I found it has two problems.

1) it shows resulst where the SAR is above the low price and well as when the SAR is below the low price

2) It includes results where the SAR has reversed for several days.

I want to find only those days where the SAR value is below the low for the day and I want to include only those stocks where this has just occurred today.  Its this second condition that I am finding really difficult to code.


----------



## MS+Tradesim (10 March 2009)

Herlequin said:


> 1) it shows resulst where the SAR is above the low price and well as when the SAR is below the low price




The formula of the SAR means it resets in the opposite direction when price crosses it. It cannot be both above and below the low price on a closed bar. Is there some backward looking condition that you can see on the chart that isn't being described? Example: do you want the low of the current bar to be higher than the value of the last period's SAR?

Would you like to put up a sample chart with what you're looking for?



> 2) It includes results where the SAR has reversed for several days.




True. That's where you will need to alter the acceleration and maximum step to keep it out of noise and avoid the flip-flopping. Try experimenting with extreme values, both high and low, and then find a nice balance.



> I want to find only those days where the SAR value is below the low for the day and I want to include only those stocks where this has just occurred today.




Well, the cross will achieve that. So this means there is going to be another condition you are looking for that is not covered purely by the cross.


----------



## Herlequin (11 March 2009)

I'm not really explaining myself well huh lol here is a chart with the condition i'm looking for :


----------



## wabbit (11 March 2009)

There are several methods to do crossover type events...

one way:
ind:=SAR(step,max);
Cross(L, ind);


another way:
ind:=SAR(step,max);
x:= L > ind;
x and alert(x=0,2);


another way:
ind:=SAR(step,max);
x:= L > ind;
x and ref(x,-1)=0;


another way:
ind:=SAR(step,max);
x:= L > ind;
x and x<>valuewhen(2,1,x);


and yet another way:
ind:=SAR(step,max);
count:=Cum(L > ind);
reset:=L<=ind;
counter:=count-valuewhen(1,reset,count);
counter=1 AND Ref(counter,-1)<>1;


Each method has its own "personality" so find the one that matches your personality.


Hope this helps.

wabbit 

P.S. How many more different ways are there to achieve the same thing/very similar thing?


----------



## MS+Tradesim (11 March 2009)

Herlequin said:


> I'm not really explaining myself well huh lol here is a chart with the condition i'm looking for :






wabbit said:


> P.S. How many more different ways are there to achieve the same thing/very similar thing?




Well, there's the 'simple' way I'd do it! 

Cross(L,sar(x,y)) AND L > ref(sar(x,y),-1)

....*if* that's what you're looking for.


----------

