jfehrman 3 posts msg #107388 - Ignore jfehrman |
8/6/2012 2:24:54 PM
Looking to make a DeMarker II filter. It is a variation on the DeMarker filter. Very new to the syntax used on StockFetcher, so any help would be greatly appreciated!
Formula goes like this:
The numerator is the 5 day sum of DeMax 1 + DeMax 2 values, where:
DeMax 1 value= High - Close 1 day ago*
*If yesterday's close is greater than today's high, DeMax 1 should equal 0 i.e. DeMax 1 may not be negative
DeMax 2 value= Close - Low
The denominator is the numerator plus the 5 day sum of DeMin 1 + DeMin 2 values, where:
DeMin 1 value = Close 1 day ago - Low*
*If low is greater than yesterday's close, DeMin 1 should equal 0 i.e. DeMin 1 may not be negative
DeMin 2 value= High - Close
So far I have:
set{demax,high - close 1 day ago}
set{demax_2,close - low}
set{demin,close 1 day ago - low}
set{demin_2,high - close}
set{num, max(demax,0)} <--- not sure how to return a 0 value for demax if the yesterday's close is greater than today's high?
|
Cheese 1,374 posts msg #107400 - Ignore Cheese |
8/6/2012 6:51:54 PM
Here you go. Good luck.
|
Kevin_in_GA 4,599 posts msg #107411 - Ignore Kevin_in_GA |
8/7/2012 7:44:15 AM
Nice first post, Cheese.
Maybe it's just me, but your coding style on this looks very familiar.
|
Cheese 1,374 posts msg #107412 - Ignore Cheese |
8/7/2012 8:44:29 AM
Kevin_in_GA, thank you for all the great ideas that you've provided in this forum and on your website.
My coding style may look familiar because I've been learning from you and other people in this forum.
Cheers.
|
Kevin_in_GA 4,599 posts msg #107413 - Ignore Kevin_in_GA |
8/7/2012 8:57:11 AM
What drew my attention in your code was the first line - if you are not familiar with some of the work done by Chetron here in these forums (someone from whom I learned most of what I know about SF coding) then you should review some of his work.
Chet used to add a specific descriptor at the start of many of his filters, so that he could quickly search and find them if needed. He was also Canadian.
|
jfehrman 3 posts msg #107415 - Ignore jfehrman |
8/7/2012 9:03:43 AM
Thank you very much! Unfortunately the indicator values returned do not match the proprietary values I recieve from Bloomberg. Most likely a problem with my interpretation of the formula, DeMark is regretably obtuse in his description of the indicator. Will keep working on hammering out the formula, but I very much appreciate the code! Learned a lot. Ultimate goal is creation of a TD Alignment indicator which is an amalgamation of 5 DeMark indicators. Will share upon completion.
|
mystiq 650 posts msg #107464 - Ignore mystiq |
8/8/2012 11:29:24 AM
Kevin_in_GA
8/7/2012 8:57:11 AM
What drew my attention in your code was the first line - if you are not familiar with some of the work done by *Chetron* here in these forums (someone from whom I learned most of what I know about SF coding) then you should review some of his work.
*Chet* used to add a specific descriptor at the start of many of his filters, so that he could quickly search and find them if needed. He was also Canadian
---->was about to sign off...but if true: welcome back :-)
|
Cheese 1,374 posts msg #107471 - Ignore Cheese |
8/8/2012 3:27:19 PM
Sorry to disappoint you but I am not Chet. I did learn a lot of Chet and I missed his contributions,
especially how Chet weaseled filters for the "cheap seats".
|
Kevin_in_GA 4,599 posts msg #107472 - Ignore Kevin_in_GA |
8/8/2012 3:47:18 PM
No disappointment for me in having another competent coder here in the forums. Welcome.
|