SpikeTrade.com is a moderated blog.
To post a message, please send it to Spikeblog@spiketrade.com
You may add a comment to any previous post in the blog whenever you like.
Thank you for being an active SpikeTrader!

Wednesday, June 17, 2009

MACD Divergence Scan - a Question from Danny B

I recently reviewed John T's presentation to the Spiker Group. In his presentation he touched on a stock scan using MACDH Divergences and New High/Low criteria.

I have been attempting to create such a scan in Trade Station for several weeks to no avail. I have searched the TS support forums and tried to copy and paste code but my proficiency level is sub par.

Are there any TS Spikers who can assist me with constructing such a scan? If so, I thank you in advance and will look forward to reading your reply's to this post. And thanks to John T's presentation and drawing attention to this scan. Otherwise I would still be (and continue to be) a student of TS programing code.

Regards,

Danny B

4 comments:

  1. I understood that John uses a product from Fidelity named Wealth-Lab for scanning divergences, not TS. Writing an algorithm for identifying MACD divergences seems to be pretty hard but not impossible.

    Meanwhile, review sectors (200)- a pretty fast process- and when you see a divergence, chances are that one or several underlying stocks draw one as well.

    Good luck

    ReplyDelete
  2. Danny,
    Thanks for reviewing the presentation; thanks for the comments. I don't use TS so I can't be much help wrt to programming. Maybe you've already got the logic designed for a macdH divergence but if not, maybe the following can help a little.
    1. Test for macdH <0 between "beginning of last week" and 2 to 3 months ago
    2. Test for macdH >0 after last 2 to 3 month macdH low
    3. If both true, continue.
    4. (What is your time period for Price Low?) Whatever it is, say 9 months, find low price in last 9 months and name it.
    5. (How recently is your time period for Price New Low? Do you want it yesterday? Within last week?) Whatever it is, find Price New Low in last 2 to 5? days.
    6. If Price New Low < Price Low, continue
    7. Determine how close, how much lower you want Price New Low to be compared to Price Low. Example, if Price New Low > 0.90 of Price Low AND Price New Low < 0.99 Price Low, continue. (You wouldn't want something that gapped down and was half the value it was 9 months ago, etc.)
    8. Is macdH value at time of Price New Low greater than MacdH low value of last 2 or 3 month low? If true, now have new low price of last "9" months with positive macdH divergence.
    Although kind of a "crude" description, this logic should outline the general idea of finding a new low price in the last week or so, making sure that the histogram was below 0 at some relatively low price within the last few months (weeks), that the histogram is now at a higher value than it was those "few months" ago, and that the macd H had at some point between there gone positive which would complete the divergence.

    If you already had the logic designed for your ideas, then this is probably not much help. If not, maybe this can be a little help to get the "flow chart" design done. When I've asked forums for programming help, I have gotten decent response if I can lay out a flow chart and ask for specific blocks. (If you happen to see flaws in my logic, please let me know and I'll correct.)

    ReplyDelete
  3. Hi Danny-
    I'm developing a scanner to identify MACD / MACDH divergences and want to make it available through the SpikeTrade Traders Shop.

    The code is running as a strategy in TradeStation and about backtested to death. Implemented as a scanner in StockFinder too.

    Scanning a huge list of stocks is not exactly TradeStation's forte. Would it meet your needs to have an indicator to sort a list in TradeStation RadarScreen and puts divergences on top? Or did you have in mind another way of scanning in TradeStation?

    Kind regards,
    Jackie

    ReplyDelete
  4. Update: TradeStation RadarScreen's present capabilities insanely limit scanning.
    StockFinder works better in that regard and is the first scanner I support with divergence detector software.

    ReplyDelete