Rick 5 posts msg #35544 - Ignore Rick |
4/7/2005 10:21:15 PM
I've been trying to do a filter to emulate the DeMarker Indicator but haven't figured out how to use if/then logic in SF. Any help in adapting the following set of rules to a SF filter would be appreciated.
---
The value of the DeMarker for the "i" interval is calculated as follows:
The DeMax(i) is calculated:
If high(i) > high(i-1) , then DeMax(i) = high(i)-high(i-1),
otherwise DeMax(i) = 0
The DeMin(i) is calculated:
If low(i) < low(i-1), then DeMin(i) = low(i-1)-low(i),
otherwise DeMin(i) = 0
The value of the DeMarker is calculated as:
DMark(i) = SMA(DeMax, N)/(SMA(DeMax, N)+SMA(DeMin, N))
Where:
SMA = Simple Moving Average;
N = the number of periods used in the calculation.
---
|
stockfetcher 980 posts msg #35546 |
4/8/2005 6:38:01 AM
You can use the max function.
In the case of DeMax(i):
If high(i) > high(i-1) , then DeMax(i) = high(i)-high(i-1),
otherwise DeMax(i) = 0
Use:
For Demin(i):
If low(i) < low(i-1), then DeMin(i) = low(i-1)-low(i),
otherwise DeMin(i) = 0
Use:
So for DeMarker with N=10 you have:
Hope this helps,
Steve
StockFetcher.com Support
|
Rick 5 posts msg #35550 - Ignore Rick |
4/8/2005 4:45:41 PM
Thanks for suggestions, it does help. The resulting DMARK chart is somewhat different from the output from Prophet.Net (which is the result I'm looking to achieve, so I will tweak the parameters a bit and see if I can make the two match.
I am trying to draw two horizontal lines on the DMARK chart, one at 30 and one at 70. As far as I can tell from the manual, I should use something like:
and draw DMARK
and draw DMARK line at 30
and draw DMARK line at 70
...but neither line shows. What am I doing wrong?
TIA
|
Rick 5 posts msg #35552 - Ignore Rick |
4/8/2005 8:11:34 PM
I'm having some trouble getting accurate results with the DeMarker filter.
I am using the filter shown below, which is the one Steve suggested (but changed 10 days to 7 days).
set{zero, high - high }
set{demax1, high - high 1 day ago}
set{demax, max(demax1,zero) }
set{demin1, low 1 day ago - low}
set{demin, max(demin1, zero) }
set{denom, CMA(demax,7) + CMA(demin,7)}
set{DEMARK, CMA(demax,7) / denom}
draw DEMARK
show stocks where DEMARK is between .35 and .40
and price is between .5 and 10 and
and average volume greater than 10000
When I ask for SF to show stocks where DEMARK is between .35 and .40 maybe two-thirds of the results are in the desire range, but the othe third are not...for example, on today's screen, some of the out of range results I get are:
FAX .70
IMNR .15
AVNX .60
Am I doing something wrong or is this is glitch of some kind in SF?
|
Rick 5 posts msg #35555 - Ignore Rick |
4/9/2005 7:08:36 AM
This is an addendum to my previous message asking about why some of the Demark indicators are out of range. I've included an Add Column to show the DEMARK values, and I have confirmed that all of the values for flagged stocks *are* in the desired range. For example, show stocks where DEMARK is between .35 and .45 produces valid results. But the Demark line in some of the charts are wrong. For example, FDRY is showing up on the list as having a demark value of .45 but on the graphical chart, the line is showing as .18.
This issue seems to affect 25-33% of the charts; while the other 66-75% match the numeric value shown for the corresponding stock.
|