[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Parabolic Formula



PureBytes Links

Trading Reference Links

I would be very surprised if you could implement SAR in MetaStock's
indicator language.

I have never tried to do so in MetaStock, but have successfully implemented
it in QuotesPlus and C++.

If you want to give it a try and can read QuotesPlus' scan language, here is
how it would be done:

If you succeed in converting this to MetaStock, please send a copy to the
group.

//SAR, by Jeff Grover
//     input = "portfoli.lst";
//     output = "SAR.lst";
float accdelta, accfac, SIP, SAR, SARp, xprice;
integer j, count, buysell,firstday, flipday;
accdelta := .02;
accfac := accdelta;
count := -100;
buysell := 0; // 1-long, 0-short
firstday := 1;
SAR := high(count);
SARp := SAR;
SIP := SAR;
xprice := high(count);

for j = count-1 to 0 step 1 do
  if( buysell = 0 ) then // short position
    if( firstday = 1 ) then
      SAR := SIP;
      firstday := 0;
    else
      if( low(j) < xprice ) then
        xprice := low(j);
        if( accfac < .2 ) then accfac := accfac + accdelta; endif;
        endif;
      SAR := SARp - accfac * abs(xprice - SARp);
      endif;

    if( SAR <= high(j) or SAR <= high(j-1) ) then
      if( high(j) >= high(j-1)) then SAR := high(j);
      else SAR := high(j-1); endif;
      buysell := 1;
      flipday:= j;
      accfac := accdelta;
      SIP := xprice;
      firstday := 1;
      endif;
    endif;

  if( buysell = 1 ) then // long position
    if( firstday = 1 ) then
      SAR := SIP;
      firstday := 0;
    else
      if( high(j) > xprice ) then
        xprice := high(j);
        if( accfac < .2 ) then accfac := accfac + accdelta; endif;
        endif;
      SAR := SARp + accfac * abs(xprice - SARp);
      endif;

    if( SAR >= low(j) or SAR >= low(j-1) ) then
      if( low(j) <= low(j-1)) then SAR := low(j);
      else SAR := low(j-1); endif;
      buysell := 0;
      flipday:= j;
      accfac := accdelta;
      SIP := xprice;
      firstday := 1;
      endif;
    endif;

  SARp := SAR;
  next j;

Jeff Grover
V: 770-442-1422    F: 240-539-8820
groverj@xxxxxxxxxxxxxxxxxxxxxxxxxx
groverj@xxxxxxxxxxxxxx
jlgrover@xxxxxxxxxxxxx

-----Original Message-----
From: owner-metastock@xxxxxxxxxxxxx
[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of neo
Sent: Saturday, January 20, 2001 3:52 PM
To: metastock@xxxxxxxxxxxxx
Subject: RE: Parabolic Formula


I would like to see this too. Please post it on the board.


>>>Charlie

I was looking for the same you are looking for. You can read the Feature
article in the Bonus Issue of TASC 1999, called "Modifying the parabolic
Stop and Reversal", by Dennis Meyers.
The author mentioned the shape, slope  and speed of the Sar was controlled
by three parameters:
the starting acceleration factor (AF), the increment that the AF can change
and the maximum AF. Meyers included an variable  that allows the Sar not tot
reverse unless penetrated by a  defined amount. He defined  this new
parameter as XO_INC for crossover increment, and he called it PARABXO.
Meyers did not give the formula for MS. Meyers has a website at:
http://www.meyersanalytics.com Perhaps you can find the formula there. When
you have the formula, please send it to me. I want to use it as an exit
system in the system tester.

Greetings, Jan Geenen