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

Re: metastock-digest V1 #1570



PureBytes Links

Trading Reference Links

hello neo,
thanks for the parabolic SAR. wilder spoke about the volatility system
in his book which is not availble in metastock formulas
do you know how to build this formula
regards,
edward



>From: owner-metastock-digest@xxxxxxxxxxxxxxxxxx (metastock-digest)
>Reply-To: metastock@xxxxxxxxxxxxxxxxxx
>To: metastock-digest@xxxxxxxxxxxxxxxxxx
>Subject: metastock-digest V1 #1570
>Date: Thu, 9 May 2002 22:33:07 -0600
>
>metastock-digest        Thursday, May 9 2002        Volume 01 : Number 1570
>
>
>
>
>----------------------------------------------------------------------
>
>Date: Mon, 6 May 2002 21:53:01 -0400
>From: "neo" <neo1@xxxxxxxxx>
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>David
>
>Wilder designed this to give a price for the next trading day in real time.
>If the price is hit then the current position is closed at that price and a
>position is opened in the opposite direction at that price. Wilder did not
>design it as an EOD stop.
>
>Where I suspect that MetaStock does not follow Wilder is in rules B and C
>although I do not know since I do not have the code for their SAR.
>
>neo
>
>
>- -----Original Message-----
>From: owner-metastock@xxxxxxxxxxxxx
>[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
>Sent: Monday, May 06, 2002 8:32 AM
>To: metastock@xxxxxxxxxxxxx
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>
>Neo, thanks for the SAR formula details from Wilder's book. This is what I
>was looking for in my original SAR post.
>Roy, using these details I have checked out a few of MetaStocks SAR
>calculations and conclude that their calculation method is accurate.
>Accurate, yes, but correct, I'm not so sure.
>The key thought for the MS approach is that, with today's results, the SAR
>point that MS will plot on tomorrow's bar is calculated but not shown on 
>the
>chart. It is not shown because it could change if the SAR line changed from
>one direction to the other.
>Perhaps, Neo, you can tell us if this is what Wilder intended?
>Why not simply back the line up one day?
>David
>
>- ----- Original Message -----
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>To: <metastock@xxxxxxxxxxxxx>
>Sent: May 5, 2002 6:18 PM
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>
> > Hi Neo
> >
> > Thanks for the information. I don't expect to be able to get as far as 
>you
> > have even, but it's a challenge that I can put aside for a rainy day. 
>I'll
> > post results if I come up with anything.
> >
> > Regards
> >
> > Roy
> >
> > > Although I do not post much, my knowledge of MetaStock programming is
> > fairly
> > > extensive. I would love to see you do it.
> > >
> > > I have Wilder's book here. It was written for the days of handwritten
> > charts
> > > and I am amazed at his book.
> > >
> > > Roy, there were several problems as I recall:
> > > 1. Initialization. I am not always in a trade in a particular 
>security.
>As
> > I
> > > recall, I used either the HHV or LLV (depending on long or short) for 
>2
> > > days.
> > > 2. I was unable to program the rules for B & C in the MetaStock 
>formula
> > > language because of the lack of global variables and the lack of a
>simple
> > > If-Then statement instead of the If-Then-Else.
> > >
> > > My very best wishes. Let me know how you do or if there is anything I
>can
> > do
> > > to help.
> > >
> > > neo
> > >
> > > _____________________________________________
> > >
> > > Wilder's SAR
> > >
> > > FORMULA
> > >
> > > SAR[tomorrow]=SAR[today] + AF * (EP[trade]-SAR[today]
> > >
> > > DEFINITIONS
> > >
> > > SIP=the extreme price point while in the previous trade
> > > AF=begins at .02 and is increased (depending on the rules below) by 
>.02
> > per
> > > day until .20
> > > AF is never increased beyond .20
> > > EP[trade]=Extreme Price Point for the trade made so far
> > > If long, the extreme high price for the trade
> > > If short, the extreme low price for the trade
> > >
> > > RULES
> > >
> > > ENTRY
> > >
> > > A position is entered when a price penetrates the SAR
> > >
> > > STOP AND REVERSE (SAR)
> > >
> > > A. For the first day of entry, the SAR is the previous SIP
> > > 1. If long, the lowest price while in the previous short trade
> > > 2. If short, the highest price while in the previous long trade
> > >
> > > B. For the second day and thereafter
> > > 1. Long - use the formula above but only increase the AF on days when 
>a
> > new
> > > high for the trade is made
> > > 2. Short - use the formula above but only increase the AF on days when 
>a
> > > new low for the trade is made
> > >
> > > C. Never move the SAR into the previous day's or today's range.
> > > 1. Long - never move the SAR for tomorrow above the previous day's or
> > > today's low. If the SAR is above then use the lower low between today
>and
> > > the previous day as the new SAR. Make the next day's calculations 
>based
>on
> > > this SAR.
> > > 1. Short - never move the SAR for tomorrow below the previous day's or
> > > today's high. If the SAR is above then use the higher high between 
>today
> > and
> > > the previous day as the new SAR. Make the next day's calculations 
>based
>on
> > > this SAR.
> > > ____________________________________________
> > >
> > >
> > > Neo
> > >
> > > > I have found it impossible to properly program the SAR as described 
>by
> > > > Wilder with MetaStock's formula language. I can in Excel. I believe
>the
> > MS
> > > > indicator is not programmed properly.
> > >
> > > Could you possibly post the text for the SAR composition so I can take 
>a
> > > look?
> > >
> > > Thanks
> > >
> > > Roy
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>------------------------------
>
>Date: Tue, 7 May 2002 19:42:39 +1200
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>Neo
>
>I'm not sure if my last response to you got through the list server. I got
>some mail back as undelivered. I'll say thank you for the SAR information
>again anyway. I've had a brief look at it and I can see why you think it 
>may
>be un-codable. I'll probably be of the same opinion after a little more 
>head
>scratching.
>
>Regards
>
>Roy
>
> > Wilder designed this to give a price for the next trading day in real
>time.
> > If the price is hit then the current position is closed at that price 
>and
>a
> > position is opened in the opposite direction at that price. Wilder did 
>not
> > design it as an EOD stop.
> >
> > Where I suspect that MetaStock does not follow Wilder is in rules B and 
>C
> > although I do not know since I do not have the code for their SAR.
> >
> > neo
> >
> >
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
> > Sent: Monday, May 06, 2002 8:32 AM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > Neo, thanks for the SAR formula details from Wilder's book. This is what 
>I
> > was looking for in my original SAR post.
> > Roy, using these details I have checked out a few of MetaStocks SAR
> > calculations and conclude that their calculation method is accurate.
> > Accurate, yes, but correct, I'm not so sure.
> > The key thought for the MS approach is that, with today's results, the 
>SAR
> > point that MS will plot on tomorrow's bar is calculated but not shown on
>the
> > chart. It is not shown because it could change if the SAR line changed
>from
> > one direction to the other.
> > Perhaps, Neo, you can tell us if this is what Wilder intended?
> > Why not simply back the line up one day?
> > David
> >
> > ----- Original Message -----
> > From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
> > To: <DEFANGED_metastock@xxxxxxxxxxxxx>
> > Sent: May 5, 2002 6:18 PM
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > > Hi Neo
> > >
> > > Thanks for the information. I don't expect to be able to get as far as
>you
> > > have even, but it's a challenge that I can put aside for a rainy day.
>I'll
> > > post results if I come up with anything.
> > >
> > > Regards
> > >
> > > Roy
> > >
> > > > Although I do not post much, my knowledge of MetaStock programming 
>is
> > > fairly
> > > > extensive. I would love to see you do it.
> > > >
> > > > I have Wilder's book here. It was written for the days of 
>handwritten
> > > charts
> > > > and I am amazed at his book.
> > > >
> > > > Roy, there were several problems as I recall:
> > > > 1. Initialization. I am not always in a trade in a particular
>security.
> > As
> > > I
> > > > recall, I used either the HHV or LLV (depending on long or short) 
>for
>2
> > > > days.
> > > > 2. I was unable to program the rules for B & C in the MetaStock
>formula
> > > > language because of the lack of global variables and the lack of a
> > simple
> > > > If-Then statement instead of the If-Then-Else.
> > > >
> > > > My very best wishes. Let me know how you do or if there is anything 
>I
> > can
> > > do
> > > > to help.
> > > >
> > > > neo
> > > >
> > > > _____________________________________________
> > > >
> > > > Wilder's SAR
> > > >
> > > > FORMULA
> > > >
> > > > SAR[tomorrow]=SAR[today] + AF * (EP[trade]-SAR[today]
> > > >
> > > > DEFINITIONS
> > > >
> > > > SIP=the extreme price point while in the previous trade
> > > > AF=begins at .02 and is increased (depending on the rules below) by
>.02
> > > per
> > > > day until .20
> > > > AF is never increased beyond .20
> > > > EP[trade]=Extreme Price Point for the trade made so far
> > > > If long, the extreme high price for the trade
> > > > If short, the extreme low price for the trade
> > > >
> > > > RULES
> > > >
> > > > ENTRY
> > > >
> > > > A position is entered when a price penetrates the SAR
> > > >
> > > > STOP AND REVERSE (SAR)
> > > >
> > > > A. For the first day of entry, the SAR is the previous SIP
> > > > 1. If long, the lowest price while in the previous short trade
> > > > 2. If short, the highest price while in the previous long trade
> > > >
> > > > B. For the second day and thereafter
> > > > 1. Long - use the formula above but only increase the AF on days 
>when
>a
> > > new
> > > > high for the trade is made
> > > > 2. Short - use the formula above but only increase the AF on days 
>when
>a
> > > > new low for the trade is made
> > > >
> > > > C. Never move the SAR into the previous day's or today's range.
> > > > 1. Long - never move the SAR for tomorrow above the previous day's 
>or
> > > > today's low. If the SAR is above then use the lower low between 
>today
> > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > 1. Short - never move the SAR for tomorrow below the previous day's 
>or
> > > > today's high. If the SAR is above then use the higher high between
>today
> > > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > ____________________________________________
> > > >
> > > >
> > > > Neo
> > > >
> > > > > I have found it impossible to properly program the SAR as 
>described
>by
> > > > > Wilder with MetaStock's formula language. I can in Excel. I 
>believe
> > the
> > > MS
> > > > > indicator is not programmed properly.
> > > >
> > > > Could you possibly post the text for the SAR composition so I can 
>take
>a
> > > > look?
> > > >
> > > > Thanks
> > > >
> > > > Roy
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
> >
>
>------------------------------
>
>Date: Tue, 7 May 2002 00:25:59 -0400
>From: "DAVID  H. LINTON" <dhlinton@xxxxxxxxxxxx>
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>Neo, I believe MetaStock does follow Wilder's rules from a mathematics
>standpoint. I have, for a few stocks, calculated the SAR points following
>the 'B' rule you wrote and the numbers are accurate. That is why I said in
>my previous post " Accurate, yes, but correct, I'm not so sure. The key
>thought for the MS approach is that, with today's results, the SAR point
>that MS will plot on tomorrow's bar is calculated but not shown on the
>chart. It is not shown because it could change if the SAR line changed from
>one direction to the other."
>It would appear that where, as you say, " Wilder designed this to give a
>price for the next trading day in real time", MS do not put the SAR point 
>on
>the chart until the next day is completed because it may be overtaken by
>rule 'C'.
>From a trader's standpoint, and please remember that this is a novice TA
>learner speaking, I conclude that the MS SAR indicator gives a clear
>indication of price approaching the point of change in trade direction, 
>but,
>it would be much more useful if today's EOD chart showed the "price for the
>next trading day in real time".
>Roy, you wrote "I've had a brief look at it and I can see why you think it
>may be un-codable." Does the fact that MS have coded the indicator not
>suggest that an exploration, system test, etc are codable?
>This will be my first attempt at writing an exploration. Any guidance would
>be greatly appreciated. I would think an exploration needs to first confirm
>that the stock is trending and then signal (for long) stocks that have now
>changed from SAR down to SAR up.
>David
>
>- ----- Original Message -----
>From: "neo" <neo1@xxxxxxxxx>
>To: <metastock@xxxxxxxxxxxxx>
>Sent: May 6, 2002 9:53 PM
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>
> > David
> >
> > Wilder designed this to give a price for the next trading day in real
>time.
> > If the price is hit then the current position is closed at that price 
>and
>a
> > position is opened in the opposite direction at that price. Wilder did 
>not
> > design it as an EOD stop.
> >
> > Where I suspect that MetaStock does not follow Wilder is in rules B and 
>C
> > although I do not know since I do not have the code for their SAR.
> >
> > neo
> >
> >
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
> > Sent: Monday, May 06, 2002 8:32 AM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > Neo, thanks for the SAR formula details from Wilder's book. This is what 
>I
> > was looking for in my original SAR post.
> > Roy, using these details I have checked out a few of MetaStocks SAR
> > calculations and conclude that their calculation method is accurate.
> > Accurate, yes, but correct, I'm not so sure.
> > The key thought for the MS approach is that, with today's results, the 
>SAR
> > point that MS will plot on tomorrow's bar is calculated but not shown on
>the
> > chart. It is not shown because it could change if the SAR line changed
>from
> > one direction to the other.
> > Perhaps, Neo, you can tell us if this is what Wilder intended?
> > Why not simply back the line up one day?
> > David
> >
> > ----- Original Message -----
> > From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
> > To: <metastock@xxxxxxxxxxxxx>
> > Sent: May 5, 2002 6:18 PM
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > > Hi Neo
> > >
> > > Thanks for the information. I don't expect to be able to get as far as
>you
> > > have even, but it's a challenge that I can put aside for a rainy day.
>I'll
> > > post results if I come up with anything.
> > >
> > > Regards
> > >
> > > Roy
> > >
> > > > Although I do not post much, my knowledge of MetaStock programming 
>is
> > > fairly
> > > > extensive. I would love to see you do it.
> > > >
> > > > I have Wilder's book here. It was written for the days of 
>handwritten
> > > charts
> > > > and I am amazed at his book.
> > > >
> > > > Roy, there were several problems as I recall:
> > > > 1. Initialization. I am not always in a trade in a particular
>security.
> > As
> > > I
> > > > recall, I used either the HHV or LLV (depending on long or short) 
>for
>2
> > > > days.
> > > > 2. I was unable to program the rules for B & C in the MetaStock
>formula
> > > > language because of the lack of global variables and the lack of a
> > simple
> > > > If-Then statement instead of the If-Then-Else.
> > > >
> > > > My very best wishes. Let me know how you do or if there is anything 
>I
> > can
> > > do
> > > > to help.
> > > >
> > > > neo
> > > >
> > > > _____________________________________________
> > > >
> > > > Wilder's SAR
> > > >
> > > > FORMULA
> > > >
> > > > SAR[tomorrow]=SAR[today] + AF * (EP[trade]-SAR[today]
> > > >
> > > > DEFINITIONS
> > > >
> > > > SIP=the extreme price point while in the previous trade
> > > > AF=begins at .02 and is increased (depending on the rules below) by
>.02
> > > per
> > > > day until .20
> > > > AF is never increased beyond .20
> > > > EP[trade]=Extreme Price Point for the trade made so far
> > > > If long, the extreme high price for the trade
> > > > If short, the extreme low price for the trade
> > > >
> > > > RULES
> > > >
> > > > ENTRY
> > > >
> > > > A position is entered when a price penetrates the SAR
> > > >
> > > > STOP AND REVERSE (SAR)
> > > >
> > > > A. For the first day of entry, the SAR is the previous SIP
> > > > 1. If long, the lowest price while in the previous short trade
> > > > 2. If short, the highest price while in the previous long trade
> > > >
> > > > B. For the second day and thereafter
> > > > 1. Long - use the formula above but only increase the AF on days 
>when
>a
> > > new
> > > > high for the trade is made
> > > > 2. Short - use the formula above but only increase the AF on days 
>when
>a
> > > > new low for the trade is made
> > > >
> > > > C. Never move the SAR into the previous day's or today's range.
> > > > 1. Long - never move the SAR for tomorrow above the previous day's 
>or
> > > > today's low. If the SAR is above then use the lower low between 
>today
> > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > 1. Short - never move the SAR for tomorrow below the previous day's 
>or
> > > > today's high. If the SAR is above then use the higher high between
>today
> > > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > ____________________________________________
> > > >
> > > >
> > > > Neo
> > > >
> > > > > I have found it impossible to properly program the SAR as 
>described
>by
> > > > > Wilder with MetaStock's formula language. I can in Excel. I 
>believe
> > the
> > > MS
> > > > > indicator is not programmed properly.
> > > >
> > > > Could you possibly post the text for the SAR composition so I can 
>take
>a
> > > > look?
> > > >
> > > > Thanks
> > > >
> > > > Roy
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>------------------------------
>
>Date: Tue, 7 May 2002 11:42:46 -0400
>From: "neo" <neo1@xxxxxxxxx>
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>Roy
>
>message received
>
>neo
>
>------------------------------
>
>Date: Tue, 7 May 2002 11:41:00 -0400
>From: "neo" <neo1@xxxxxxxxx>
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>David
>
>Wilder's SAR, to my knowledge, cannot be coded properly in the MetaStock
>formula language (it can in Excel). Since the same language is used in
>indicators, explorations, and system tests you will not be able to do it.
>You can, however, code a different SAR system that is simpler than 
>Wilder's.
>In terms of an exploration, how will you determine the direction of your
>position?
>
>neo
>
>- -----Original Message-----
>From: owner-metastock@xxxxxxxxxxxxx
>[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
>Sent: Tuesday, May 07, 2002 12:26 AM
>To: metastock@xxxxxxxxxxxxx
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>
>Neo, I believe MetaStock does follow Wilder's rules from a mathematics
>standpoint. I have, for a few stocks, calculated the SAR points following
>the 'B' rule you wrote and the numbers are accurate. That is why I said in
>my previous post " Accurate, yes, but correct, I'm not so sure. The key
>thought for the MS approach is that, with today's results, the SAR point
>that MS will plot on tomorrow's bar is calculated but not shown on the
>chart. It is not shown because it could change if the SAR line changed from
>one direction to the other."
>It would appear that where, as you say, " Wilder designed this to give a
>price for the next trading day in real time", MS do not put the SAR point 
>on
>the chart until the next day is completed because it may be overtaken by
>rule 'C'.
>From a trader's standpoint, and please remember that this is a novice TA
>learner speaking, I conclude that the MS SAR indicator gives a clear
>indication of price approaching the point of change in trade direction, 
>but,
>it would be much more useful if today's EOD chart showed the "price for the
>next trading day in real time".
>Roy, you wrote "I've had a brief look at it and I can see why you think it
>may be un-codable." Does the fact that MS have coded the indicator not
>suggest that an exploration, system test, etc are codable?
>This will be my first attempt at writing an exploration. Any guidance would
>be greatly appreciated. I would think an exploration needs to first confirm
>that the stock is trending and then signal (for long) stocks that have now
>changed from SAR down to SAR up.
>David
>
>- ----- Original Message -----
>From: "neo" <neo1@xxxxxxxxx>
>To: <metastock@xxxxxxxxxxxxx>
>Sent: May 6, 2002 9:53 PM
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>
> > David
> >
> > Wilder designed this to give a price for the next trading day in real
>time.
> > If the price is hit then the current position is closed at that price 
>and
>a
> > position is opened in the opposite direction at that price. Wilder did 
>not
> > design it as an EOD stop.
> >
> > Where I suspect that MetaStock does not follow Wilder is in rules B and 
>C
> > although I do not know since I do not have the code for their SAR.
> >
> > neo
> >
> >
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
> > Sent: Monday, May 06, 2002 8:32 AM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > Neo, thanks for the SAR formula details from Wilder's book. This is what 
>I
> > was looking for in my original SAR post.
> > Roy, using these details I have checked out a few of MetaStocks SAR
> > calculations and conclude that their calculation method is accurate.
> > Accurate, yes, but correct, I'm not so sure.
> > The key thought for the MS approach is that, with today's results, the 
>SAR
> > point that MS will plot on tomorrow's bar is calculated but not shown on
>the
> > chart. It is not shown because it could change if the SAR line changed
>from
> > one direction to the other.
> > Perhaps, Neo, you can tell us if this is what Wilder intended?
> > Why not simply back the line up one day?
> > David
> >
> > ----- Original Message -----
> > From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
> > To: <metastock@xxxxxxxxxxxxx>
> > Sent: May 5, 2002 6:18 PM
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > > Hi Neo
> > >
> > > Thanks for the information. I don't expect to be able to get as far as
>you
> > > have even, but it's a challenge that I can put aside for a rainy day.
>I'll
> > > post results if I come up with anything.
> > >
> > > Regards
> > >
> > > Roy
> > >
> > > > Although I do not post much, my knowledge of MetaStock programming 
>is
> > > fairly
> > > > extensive. I would love to see you do it.
> > > >
> > > > I have Wilder's book here. It was written for the days of 
>handwritten
> > > charts
> > > > and I am amazed at his book.
> > > >
> > > > Roy, there were several problems as I recall:
> > > > 1. Initialization. I am not always in a trade in a particular
>security.
> > As
> > > I
> > > > recall, I used either the HHV or LLV (depending on long or short) 
>for
>2
> > > > days.
> > > > 2. I was unable to program the rules for B & C in the MetaStock
>formula
> > > > language because of the lack of global variables and the lack of a
> > simple
> > > > If-Then statement instead of the If-Then-Else.
> > > >
> > > > My very best wishes. Let me know how you do or if there is anything 
>I
> > can
> > > do
> > > > to help.
> > > >
> > > > neo
> > > >
> > > > _____________________________________________
> > > >
> > > > Wilder's SAR
> > > >
> > > > FORMULA
> > > >
> > > > SAR[tomorrow]=SAR[today] + AF * (EP[trade]-SAR[today]
> > > >
> > > > DEFINITIONS
> > > >
> > > > SIP=the extreme price point while in the previous trade
> > > > AF=begins at .02 and is increased (depending on the rules below) by
>.02
> > > per
> > > > day until .20
> > > > AF is never increased beyond .20
> > > > EP[trade]=Extreme Price Point for the trade made so far
> > > > If long, the extreme high price for the trade
> > > > If short, the extreme low price for the trade
> > > >
> > > > RULES
> > > >
> > > > ENTRY
> > > >
> > > > A position is entered when a price penetrates the SAR
> > > >
> > > > STOP AND REVERSE (SAR)
> > > >
> > > > A. For the first day of entry, the SAR is the previous SIP
> > > > 1. If long, the lowest price while in the previous short trade
> > > > 2. If short, the highest price while in the previous long trade
> > > >
> > > > B. For the second day and thereafter
> > > > 1. Long - use the formula above but only increase the AF on days 
>when
>a
> > > new
> > > > high for the trade is made
> > > > 2. Short - use the formula above but only increase the AF on days 
>when
>a
> > > > new low for the trade is made
> > > >
> > > > C. Never move the SAR into the previous day's or today's range.
> > > > 1. Long - never move the SAR for tomorrow above the previous day's 
>or
> > > > today's low. If the SAR is above then use the lower low between 
>today
> > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > 1. Short - never move the SAR for tomorrow below the previous day's 
>or
> > > > today's high. If the SAR is above then use the higher high between
>today
> > > and
> > > > the previous day as the new SAR. Make the next day's calculations
>based
> > on
> > > > this SAR.
> > > > ____________________________________________
> > > >
> > > >
> > > > Neo
> > > >
> > > > > I have found it impossible to properly program the SAR as 
>described
>by
> > > > > Wilder with MetaStock's formula language. I can in Excel. I 
>believe
> > the
> > > MS
> > > > > indicator is not programmed properly.
> > > >
> > > > Could you possibly post the text for the SAR composition so I can 
>take
>a
> > > > look?
> > > >
> > > > Thanks
> > > >
> > > > Roy
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>------------------------------
>
>Date: Wed, 8 May 2002 06:07:50 +1200
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>David
>
> > Roy, you wrote "I've had a brief look at it and I can see why you think 
>it
> > may be un-codable." Does the fact that MS have coded the indicator not
> > suggest that an exploration, system test, etc are codable?
> > This will be my first attempt at writing an exploration. Any guidance
>would
> > be greatly appreciated. I would think an exploration needs to first
>confirm
> > that the stock is trending and then signal (for long) stocks that have 
>now
> > changed from SAR down to SAR up.
>
>As you say, there is no problem writing a system or an exploration for the
>SAR. The problem that I have, and I think Neo also has, is that of being
>able to build the SAR from scratch so that the code is accessible. This
>would allow us to tinker with the rules in a way that is not possible with
>the canned SAR. The fact that Equis have coded an SAR for the MS formula
>language suggests that it can be done, but I rather suspect that the
>programmers at Equis were not restricted to using MFL for their creation.
>
>Roy
>
>------------------------------
>
>Date: Tue, 7 May 2002 16:53:51 -0500
>From: "Lionel Issen" <lissen@xxxxxxxxxxxxxx>
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>The coding would have to be in a *.dll. Metastock has done this with a few
>indicators, but they haven't done much more.
>
>Lionel
>
>- -----Original Message-----
>From: owner-metastock@xxxxxxxxxxxxx
>[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Roy Larsen
>Sent: Tuesday, May 07, 2002 1:08 PM
>To: metastock@xxxxxxxxxxxxx
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>
>David
>
> > Roy, you wrote "I've had a brief look at it and I can see why you think 
>it
> > may be un-codable." Does the fact that MS have coded the indicator not
> > suggest that an exploration, system test, etc are codable?
> > This will be my first attempt at writing an exploration. Any guidance
>would
> > be greatly appreciated. I would think an exploration needs to first
>confirm
> > that the stock is trending and then signal (for long) stocks that have 
>now
> > changed from SAR down to SAR up.
>
>As you say, there is no problem writing a system or an exploration for the
>SAR. The problem that I have, and I think Neo also has, is that of being
>able to build the SAR from scratch so that the code is accessible. This
>would allow us to tinker with the rules in a way that is not possible with
>the canned SAR. The fact that Equis have coded an SAR for the MS formula
>language suggests that it can be done, but I rather suspect that the
>programmers at Equis were not restricted to using MFL for their creation.
>
>Roy
>
>------------------------------
>
>Date: Wed, 8 May 2002 20:06:54 +0800
>From: "Nick Channon" <channon@xxxxxxxxxxxx>
>Subject: Referring from a 5 minute chart, to a 1 hour chart of the same 
>security?
>
>This is a multi-part message in MIME format.
>
>- ------=_NextPart_000_00C6_01C1F6CB.E663AAD0
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>I wonder if anyone can help me with a coding problem. My goal is to base =
>signals in an expert on a 5-minute chart, partially on moving average =
>conditions found in a 1 hour chart of the same security. I cannot see a =
>way to do this using the 'security' function because that only seems to =
>be able to reference a different security altogether.
>
>Logically I guess you could do some simple calculations based on groups =
>of 12 bars, i.e. 12 bars of 5 mins each equals 1 hour. However I cannot =
>see a way in Metastock to 'loop' the calculation in order to do this to =
>a sufficient extent for a long-term moving average eg 144 hours.
>
>Maybe I'm missing something obvious. Can anyone help?
>
>Many thanks,
>Nick
>
>- ------=_NextPart_000_00C6_01C1F6CB.E663AAD0
>Content-Type: text/html;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META http-equiv=3DContent-Type content=3D"text/html; =
>charset=3Diso-8859-1">
><META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT face=3DArial size=3D2>I wonder if anyone can help me with a =
>coding=20
>problem. My goal is to base signals in an expert on a 5-minute chart, =
>partially=20
>on moving average conditions found in a 1 hour chart of the same =
>security. I=20
>cannot see a way to do this using the 'security' function because that =
>only=20
>seems to be able to reference a different security =
>altogether.</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>Logically I guess you could do some =
>simple=20
>calculations based on groups of 12 bars, i.e. 12 bars of 5 mins each =
>equals 1=20
>hour. However I cannot see a way in Metastock to 'loop' the calculation =
>in order=20
>to do this to a sufficient extent for a long-term moving average =
>eg&nbsp;144=20
>hours.</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>Maybe I'm missing something obvious. =
>Can anyone=20
>help?</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>Many thanks,</FONT></DIV>
><DIV><FONT face=3DArial size=3D2>Nick</FONT></DIV></BODY></HTML>
>
>- ------=_NextPart_000_00C6_01C1F6CB.E663AAD0--
>
>------------------------------
>
>Date: Tue, 7 May 2002 23:42:46 -0400
>From: "DAVID  H. LINTON" <dhlinton@xxxxxxxxxxxx>
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>Neo and Roy and Lionel,
>The following is from Equis, confirming what you have been telling me.
>" The indicator in MetaStock was approved By J. Welles Wilder himself so 
>I'm
>pretty sure it is right. Now it was created has a dll and not the MetaStock
>language.
>With the MetaStock language it is simply impossible to recreate this
>indicator.  Thanks,  Patrick. "
>Neo, would you expand upon (with code if possible for the new boy) your
>suggestion that a simpler SAR can be coded. Also, the other elements of 
>your
>'mechanical system' would be appreciated. Concerning direction of position,
>if C > yesterday's SAR point stay long, else go short.
>Roy, you say " there is no problem writing a system or an exploration for
>the SAR. " With my limited TA experience, I see the Parabolic SAR as
>produced by the canned indicator in MS (and working with the variable
>parameters provided) as sufficient for my needs. Could you help me with the
>bones of an exploration to get me started?
>Many thanks
>David
>
>- ----- Original Message -----
>From: "neo" <neo1@xxxxxxxxx>
>To: <metastock@xxxxxxxxxxxxx>
>Sent: May 7, 2002 11:41 AM
>Subject: RE: Parabolic SAR - Wilder's Original Definition
>
>
> > David
> >
> > Wilder's SAR, to my knowledge, cannot be coded properly in the MetaStock
> > formula language (it can in Excel). Since the same language is used in
> > indicators, explorations, and system tests you will not be able to do 
>it.
> > You can, however, code a different SAR system that is simpler than
>Wilder's.
> > In terms of an exploration, how will you determine the direction of your
> > position?
> >
> > neo
> >
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
> > Sent: Tuesday, May 07, 2002 12:26 AM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: Re: Parabolic SAR - Wilder's Original Definition
> >
> >
> > Neo, I believe MetaStock does follow Wilder's rules from a mathematics
> > standpoint. I have, for a few stocks, calculated the SAR points 
>following
> > the 'B' rule you wrote and the numbers are accurate. That is why I said 
>in
> > my previous post " Accurate, yes, but correct, I'm not so sure. The key
> > thought for the MS approach is that, with today's results, the SAR point
> > that MS will plot on tomorrow's bar is calculated but not shown on the
> > chart. It is not shown because it could change if the SAR line changed
>from
> > one direction to the other."
> > It would appear that where, as you say, " Wilder designed this to give a
> > price for the next trading day in real time", MS do not put the SAR 
>point
>on
> > the chart until the next day is completed because it may be overtaken by
> > rule 'C'.
> > From a trader's standpoint, and please remember that this is a novice TA
> > learner speaking, I conclude that the MS SAR indicator gives a clear
> > indication of price approaching the point of change in trade direction,
>but,
> > it would be much more useful if today's EOD chart showed the "price for
>the
> > next trading day in real time".
> > Roy, you wrote "I've had a brief look at it and I can see why you think 
>it
> > may be un-codable." Does the fact that MS have coded the indicator not
> > suggest that an exploration, system test, etc are codable?
> > This will be my first attempt at writing an exploration. Any guidance
>would
> > be greatly appreciated. I would think an exploration needs to first
>confirm
> > that the stock is trending and then signal (for long) stocks that have 
>now
> > changed from SAR down to SAR up.
> > David
> >
> > ----- Original Message -----
> > From: "neo" <neo1@xxxxxxxxx>
> > To: <metastock@xxxxxxxxxxxxx>
> > Sent: May 6, 2002 9:53 PM
> > Subject: RE: Parabolic SAR - Wilder's Original Definition
> >
> >
> > > David
> > >
> > > Wilder designed this to give a price for the next trading day in real
> > time.
> > > If the price is hit then the current position is closed at that price
>and
> > a
> > > position is opened in the opposite direction at that price. Wilder did
>not
> > > design it as an EOD stop.
> > >
> > > Where I suspect that MetaStock does not follow Wilder is in rules B 
>and
>C
> > > although I do not know since I do not have the code for their SAR.
> > >
> > > neo
> > >
> > >
> > > -----Original Message-----
> > > From: owner-metastock@xxxxxxxxxxxxx
> > > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of DAVID H. LINTON
> > > Sent: Monday, May 06, 2002 8:32 AM
> > > To: metastock@xxxxxxxxxxxxx
> > > Subject: Re: Parabolic SAR - Wilder's Original Definition
> > >
> > >
> > > Neo, thanks for the SAR formula details from Wilder's book. This is 
>what
>I
> > > was looking for in my original SAR post.
> > > Roy, using these details I have checked out a few of MetaStocks SAR
> > > calculations and conclude that their calculation method is accurate.
> > > Accurate, yes, but correct, I'm not so sure.
> > > The key thought for the MS approach is that, with today's results, the
>SAR
> > > point that MS will plot on tomorrow's bar is calculated but not shown 
>on
> > the
> > > chart. It is not shown because it could change if the SAR line changed
> > from
> > > one direction to the other.
> > > Perhaps, Neo, you can tell us if this is what Wilder intended?
> > > Why not simply back the line up one day?
> > > David
> > >
> > > ----- Original Message -----
> > > From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
> > > To: <metastock@xxxxxxxxxxxxx>
> > > Sent: May 5, 2002 6:18 PM
> > > Subject: Re: Parabolic SAR - Wilder's Original Definition
> > >
> > >
> > > > Hi Neo
> > > >
> > > > Thanks for the information. I don't expect to be able to get as far 
>as
> > you
> > > > have even, but it's a challenge that I can put aside for a rainy 
>day.
> > I'll
> > > > post results if I come up with anything.
> > > >
> > > > Regards
> > > >
> > > > Roy
> > > >
> > > > > Although I do not post much, my knowledge of MetaStock programming
>is
> > > > fairly
> > > > > extensive. I would love to see you do it.
> > > > >
> > > > > I have Wilder's book here. It was written for the days of
>handwritten
> > > > charts
> > > > > and I am amazed at his book.
> > > > >
> > > > > Roy, there were several problems as I recall:
> > > > > 1. Initialization. I am not always in a trade in a particular
> > security.
> > > As
> > > > I
> > > > > recall, I used either the HHV or LLV (depending on long or short)
>for
> > 2
> > > > > days.
> > > > > 2. I was unable to program the rules for B & C in the MetaStock
> > formula
> > > > > language because of the lack of global variables and the lack of a
> > > simple
> > > > > If-Then statement instead of the If-Then-Else.
> > > > >
> > > > > My very best wishes. Let me know how you do or if there is 
>anything
>I
> > > can
> > > > do
> > > > > to help.
> > > > >
> > > > > neo
> > > > >
> > > > > _____________________________________________
> > > > >
> > > > > Wilder's SAR
> > > > >
> > > > > FORMULA
> > > > >
> > > > > SAR[tomorrow]=SAR[today] + AF * (EP[trade]-SAR[today]
> > > > >
> > > > > DEFINITIONS
> > > > >
> > > > > SIP=the extreme price point while in the previous trade
> > > > > AF=begins at .02 and is increased (depending on the rules below) 
>by
> > .02
> > > > per
> > > > > day until .20
> > > > > AF is never increased beyond .20
> > > > > EP[trade]=Extreme Price Point for the trade made so far
> > > > > If long, the extreme high price for the trade
> > > > > If short, the extreme low price for the trade
> > > > >
> > > > > RULES
> > > > >
> > > > > ENTRY
> > > > >
> > > > > A position is entered when a price penetrates the SAR
> > > > >
> > > > > STOP AND REVERSE (SAR)
> > > > >
> > > > > A. For the first day of entry, the SAR is the previous SIP
> > > > > 1. If long, the lowest price while in the previous short trade
> > > > > 2. If short, the highest price while in the previous long trade
> > > > >
> > > > > B. For the second day and thereafter
> > > > > 1. Long - use the formula above but only increase the AF on days
>when
> > a
> > > > new
> > > > > high for the trade is made
> > > > > 2. Short - use the formula above but only increase the AF on days
>when
> > a
> > > > > new low for the trade is made
> > > > >
> > > > > C. Never move the SAR into the previous day's or today's range.
> > > > > 1. Long - never move the SAR for tomorrow above the previous day's
>or
> > > > > today's low. If the SAR is above then use the lower low between
>today
> > > and
> > > > > the previous day as the new SAR. Make the next day's calculations
> > based
> > > on
> > > > > this SAR.
> > > > > 1. Short - never move the SAR for tomorrow below the previous 
>day's
>or
> > > > > today's high. If the SAR is above then use the higher high between
> > today
> > > > and
> > > > > the previous day as the new SAR. Make the next day's calculations
> > based
> > > on
> > > > > this SAR.
> > > > > ____________________________________________
> > > > >
> > > > >
> > > > > Neo
> > > > >
> > > > > > I have found it impossible to properly program the SAR as
>described
> > by
> > > > > > Wilder with MetaStock's formula language. I can in Excel. I
>believe
> > > the
> > > > MS
> > > > > > indicator is not programmed properly.
> > > > >
> > > > > Could you possibly post the text for the SAR composition so I can
>take
> > a
> > > > > look?
> > > > >
> > > > > Thanks
> > > > >
> > > > > Roy
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>------------------------------
>
>Date: Thu, 9 May 2002 10:07:59 +1200
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>Subject: Re: Parabolic SAR - Wilder's Original Definition
>
>David
>
> > The following is from Equis, confirming what you have been telling me.
> > " The indicator in MetaStock was approved By J. Welles Wilder himself so
>I'm
> > pretty sure it is right. Now it was created has a dll and not the
>MetaStock
> > language.
> > With the MetaStock language it is simply impossible to recreate this
> > indicator.  Thanks,  Patrick. "
>
>Sometimes there are ways to do things with the standard MFL that even Equis
>aren't aware of, but in this case I think Patrick may be right.
>
> > Roy, you say " there is no problem writing a system or an exploration 
>for
> > the SAR. " With my limited TA experience, I see the Parabolic SAR as
> > produced by the canned indicator in MS (and working with the variable
> > parameters provided) as sufficient for my needs. Could you help me with
>the
> > bones of an exploration to get me started?
>
>The problem comes in writing a 'profitable' system. As Neo has pointed out
>the SAR was never intended for use in an EOD system. The entry/exit points
>occur intraday. In a very real sense an EOD exploration is only going to
>tell you what you should have done yesterday, and I don't see the use of
>that for either of us.
>
>If you were to write an exploration it could be as simple as,
>Column A: Long
>Cross(C,SAR(.02,.2));
>Column B: Short
>Cross(SAR(.02,.2),C);
>
>However as I read the use of SAR the actual prices that should be used in a
>system test, but can't be because of its inadequacies, are,
>EnterLongPrice:=If(Cross(H,Ref(SAR(.02,.2),-1)),Ref(SAR(.02,.2),-1),0);
>EnterLongPrice;
>EnterShortPrice:=If(Cross(Ref(SAR(.02,.2),-1),L),Ref(SAR(.02,.2),-1),0);
>EnterShortPrice;
>This code is not strictly accurate either for a number of reasons, but its 
>a
>starting point for use with the Trade Equity indicators and explorations
>
>Roy
>
>------------------------------
>
>Date: Thu, 9 May 2002 10:23:26 +1200
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>Subject: Re: Referring from a 5 minute chart, to a 1 hour chart of the same 
>security?
>
>Nick
>
> > I wonder if anyone can help me with a coding problem. My goal is to base
>signals in an expert on a 5-minute chart, partially on moving
> > average conditions found in a 1 hour chart of the same security. I 
>cannot
>see a way to do this using the 'security' function because that
> > only seems to be able to reference a different security altogether.
> >
> > Logically I guess you could do some simple calculations based on groups 
>of
>12 bars, i.e. 12 bars of 5 mins each equals 1 hour.
> > However I cannot see a way in Metastock to 'loop' the calculation in 
>order
>to do this to a sufficient extent for a long-term moving
> > average eg 144 hours.
> >
> > Maybe I'm missing something obvious. Can anyone help?
>
>You need a series of indicators that compress 5 minute bars down into 1 
>hour
>bars, then you need a mechanism to apply the new data array to your
>preferred indicators. To get you started here are some indicators providing
>15 and 30 minute bar prices which I'm sure you can adapt. The next step 
>will
>be a little more difficult as you need to sample a given price only once
>rather than on every 5 minute bar. I haven't worked out the details of how
>to do this but I'm confident it can be done with a little thought and
>effort.
>
>Roy
>
>   {30 minute frame close - 5 minute bars}
>Eb:=(Minute()=25 OR Minute()=55);
>ValueWhen(1,Eb OR Cum(1)=1,CLOSE);
>
>   {30 minute frame high - 5 minute bars}
>Sb:=(Minute()=00 OR Minute()=30);
>Eb:=(Minute()=25 OR Minute()=55);
>In:=Cum(1)=1;
>Hh:=ValueWhen(1,In OR Eb,HighestSince(1,In OR Sb,H));
>Hh;
>
>   {30 minute frame low - 5 minute bars}
>Sb:=(Minute()=00 OR Minute()=30);
>Eb:=(Minute()=25 OR Minute()=55);
>In:=Cum(1)=1;
>Ll:=ValueWhen(1,In OR Eb,LowestSince(1,In OR Sb,L));
>Ll;
>
>   {30 minute frame open - 5 minute bars}
>Sb:=Minute()=25 OR Minute()=55;
>Eb:=Minute()=00 OR Minute()=30;
>In:=Cum(1)=1;
>Op:=ValueWhen(1,Sb OR In,ValueWhen(1,Eb OR In,OPEN));
>Op;
>
>   {15 minute frame close - 5 minute bars}
>E15:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
>C15:=ValueWhen(1,E15 OR Cum(1)=1,C);
>C15;
>
>   {15 minute frame high - 5 minute bars}
>Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
>Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
>In:=Cum(1)=1;
>Hh:=ValueWhen(1,In OR Eb,HighestSince(1,In OR Sb,H));
>Hh;
>
>   {15 minute frame low - 5 minute bars}
>Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
>Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
>In:=Cum(1)=1;
>Ll:=ValueWhen(1,In OR Eb,LowestSince(1,In OR Sb,L));
>Ll;
>
>   {15 minute frame open - 5 minute bars}
>Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
>Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
>In:=Cum(1)=1;
>Op:=ValueWhen(1,Sb OR In,ValueWhen(1,Eb OR In,OPEN));
>Op;
>
>------------------------------
>
>Date: Thu, 9 May 2002 09:36:09 +0800
>From: "Nick Channon" <channon@xxxxxxxxxxxx>
>Subject: Re: Referring from a 5 minute chart, to a 1 hour chart of the same 
>security?
>
>Many thanks for your help Roy - I'll give it a go.
>Cheers,
>Nick
>
>
>- ----- Original Message -----
>From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
>To: <metastock@xxxxxxxxxxxxx>
>Sent: Thursday, May 09, 2002 6:23 AM
>Subject: Re: Referring from a 5 minute chart, to a 1 hour chart of the same
>security?
>
>
> > Nick
> >
> > > I wonder if anyone can help me with a coding problem. My goal is to 
>base
> > signals in an expert on a 5-minute chart, partially on moving
> > > average conditions found in a 1 hour chart of the same security. I
>cannot
> > see a way to do this using the 'security' function because that
> > > only seems to be able to reference a different security altogether.
> > >
> > > Logically I guess you could do some simple calculations based on 
>groups
>of
> > 12 bars, i.e. 12 bars of 5 mins each equals 1 hour.
> > > However I cannot see a way in Metastock to 'loop' the calculation in
>order
> > to do this to a sufficient extent for a long-term moving
> > > average eg 144 hours.
> > >
> > > Maybe I'm missing something obvious. Can anyone help?
> >
> > You need a series of indicators that compress 5 minute bars down into 1
>hour
> > bars, then you need a mechanism to apply the new data array to your
> > preferred indicators. To get you started here are some indicators
>providing
> > 15 and 30 minute bar prices which I'm sure you can adapt. The next step
>will
> > be a little more difficult as you need to sample a given price only once
> > rather than on every 5 minute bar. I haven't worked out the details of 
>how
> > to do this but I'm confident it can be done with a little thought and
> > effort.
> >
> > Roy
> >
> >   {30 minute frame close - 5 minute bars}
> > Eb:=(Minute()=25 OR Minute()=55);
> > ValueWhen(1,Eb OR Cum(1)=1,CLOSE);
> >
> >   {30 minute frame high - 5 minute bars}
> > Sb:=(Minute()=00 OR Minute()=30);
> > Eb:=(Minute()=25 OR Minute()=55);
> > In:=Cum(1)=1;
> > Hh:=ValueWhen(1,In OR Eb,HighestSince(1,In OR Sb,H));
> > Hh;
> >
> >   {30 minute frame low - 5 minute bars}
> > Sb:=(Minute()=00 OR Minute()=30);
> > Eb:=(Minute()=25 OR Minute()=55);
> > In:=Cum(1)=1;
> > Ll:=ValueWhen(1,In OR Eb,LowestSince(1,In OR Sb,L));
> > Ll;
> >
> >   {30 minute frame open - 5 minute bars}
> > Sb:=Minute()=25 OR Minute()=55;
> > Eb:=Minute()=00 OR Minute()=30;
> > In:=Cum(1)=1;
> > Op:=ValueWhen(1,Sb OR In,ValueWhen(1,Eb OR In,OPEN));
> > Op;
> >
> >   {15 minute frame close - 5 minute bars}
> > E15:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
> > C15:=ValueWhen(1,E15 OR Cum(1)=1,C);
> > C15;
> >
> >   {15 minute frame high - 5 minute bars}
> > Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
> > Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
> > In:=Cum(1)=1;
> > Hh:=ValueWhen(1,In OR Eb,HighestSince(1,In OR Sb,H));
> > Hh;
> >
> >   {15 minute frame low - 5 minute bars}
> > Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
> > Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
> > In:=Cum(1)=1;
> > Ll:=ValueWhen(1,In OR Eb,LowestSince(1,In OR Sb,L));
> > Ll;
> >
> >   {15 minute frame open - 5 minute bars}
> > Sb:=Minute()=00 OR Minute()=15 OR Minute()=30 OR Minute()=45;
> > Eb:=Minute()=10 OR Minute()=25 OR Minute()=40 OR Minute()=55;
> > In:=Cum(1)=1;
> > Op:=ValueWhen(1,Sb OR In,ValueWhen(1,Eb OR In,OPEN));
> > Op;
> >
> >
> >
>
>------------------------------
>
>Date: Thu, 9 May 2002 14:52:39 +0100
>From: "Theo Lockefeer" <sky40912@xxxxxxxxx>
>Subject: Test (ignore please)
>
>This is a multi-part message in MIME format.
>
>- ------=_NextPart_000_000C_01C1F769.2A6E4120
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>Test
>
>
>- ---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.360 / Virus Database: 199 - Release Date: 7/05/2002
>
>- ------=_NextPart_000_000C_01C1F769.2A6E4120
>Content-Type: text/html;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META http-equiv=3DContent-Type content=3D"text/html; =
>charset=3Diso-8859-1">
><META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT face=3DArial size=3D2>Test</FONT></DIV>
><DIV>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2><BR>---<BR>Outgoing mail is certified =
>Virus=20
>Free.<BR>Checked by AVG anti-virus system (<A=20
>href=3D"http://www.grisoft.com";>http://www.grisoft.com</A>).<BR>Version: =
>6.0.360 /=20
>Virus Database: 199 - Release Date: 7/05/2002</FONT></DIV></BODY></HTML>
>
>- ------=_NextPart_000_000C_01C1F769.2A6E4120--
>
>------------------------------
>
>End of metastock-digest V1 #1570
>********************************
>




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com