How To Build an Automated SCT Trading System (Part 2)

Discussion in 'Automated Trading' started by greaterreturn, Oct 6, 2008.

  1. FYI, this thread discusses ideas and charts. But actual code or very specific rules will probably not be shared since this ATS runs on a proprietary platform. So any code or specific rules will never work with any of the popular, commercial trading platforms.

    You can always work out the specifics with a little effort.

    ES Data Disclaimer: My plan was to get ES data for continuation of this thread. That turned out to be far to much trouble reworking my current interface code to get data. Besides, the synthetic volume numbers for USD/JPY seem to work just fine as a proxy.

    Latest status:

    I made great progress at automated more of SCT. However, at this point it seems I might start out using a "mixed" automation/discretionary system and gradually automate parts of it as I figure them out.

    Click Here for Part 1 of this thread.
  2. In the next few posts, I'll mention different areas where I'm finding success or challenges so you can help or ask question, whichever.

    About the P,V relationship.

    I feel like I figured out the P,V relationship finally. One big help was working out a PRV (pro-rated volume) formula. The problem is that PRV used by Jack and Spyder is only useful during live or replay data. On a historical chart, it's useless. In other words, you can't "see" how the PRV develops intra-bar on a static chart.

    Another factor to consider, Jack says volume needs to be watched at twice the frequency of price.

    So I created an indicator that draws TWO volume bars for each price bar. Whereas, the price bars are 5 minutes (or 300 seconds) the volume bars show half that or 150 seconds.
  3. The standard SCT PRV simply takes the amount of volume "so far" every 5 minutes and pro-rates it for the entire 5 minutes.

    Unfortunately, that means a slightly high volume in the first 10 seconds can appear like EXTREME volume at first. Then as the bar progresses it often turns into a low volume bar. So PRV can be misleading at the beginning of each bar.

    However, from the middle time of each bar, it becomes more useful.

    So a better PRV is useful. It always uses actual volume of a constantly sliding 150 seconds (2.5 minutes). As that bar progresses it may decrease or increase. It looks more stable and you can see it decreasing, increasing, or staying flat as the bar progresses.
  4. Also I built a market replay mechanism with acceleration so I can replay market data and experiment to get a feel for how the P,V relationship unfolds during the day.

    FYI, the replay tool positions the latest bar 30% away from the right side of the screen (as Jack recommends) so the channels can be projected into the future. He strongly recommends this so you can see the projection of channels in the future.

    Also, the replay I built allows the bars to build without scrolling until they reach horizontal or vertical limits, then it smoothly and automatically repositions the chart back the to the vertical center and 30% from the right.

    That repositioning allows smooth trading of the SCT on the replay even at 50 times acceleration.


    Using the replay showed a couple flaws in the tape bars formula. So that's fixed.
    That are now very tight to the bottoms or tops of the bars like Jacks.

    Also, I incorporated consideration of OB (outside bars) on the building of tapes. But there seems to still be a little more work to do related to OB's.
  5. Simply using tapes and the P,V volume indicator, I have been "drilling". That is manually traded and re-trade through the same day on accelerated replay while reviewing after each time to learn from successes and mistakes.

    That really improves your skill drastically at timing the turns in the market, even without automation.

    That has made it obvious how real P,V relationship really is.

    Also, I found Jack's point is valid, when playing counter to trend against the left channel line, it does at first feel like you might "fall off the edge of the planet." But after drilling, you build confidence that the market can go only so far past the left line before it bounces back. That makes it safe to trade against the trend at extreme volume points.

    At first it seems a little crazy to trade against extreme volume. But after you see so many examples of the market turning at that point and some practice, you can actually build in a "reflex" muscle memory action to "reverse" when the market jumps like that.

    Why? Well, I keep replaying certain days trying to time the turns correctly, and found that any hesitation and you miss the turns on extreme volume.

    So after practicing many times, I could nail the turns accurately.

    Then when I traded a completely fresh day, that I never tried before, AMAZINGLY, my hand hit the reverse key almost automatically at a rapid extreme volume point and perfectly timed several market turns.

    It's a very cool experience.

    Clearly, the more I drill and review the more accurate trading becomes.

    Frankly, it seems far easier to teach my brain than this STUPID computer.
  6. These are clearly areas for assisted automation. It might be that the best use of automating is in the area of "housekeeping" or annotating charts, and perhaps, logging.

    Also, these automation points seem helpful.

    Low Liquidity or Volume

    Sideline when liquidity or volume becomes too low. The system can automatically go flat and disallow trading when liquidity is low either from low volume, DOM size, or if the spread gap gets too large.

    Extreme Volume

    During extreme volume situations you must react more quickly. So I might automate that trade. It seems there's at least 2 different extreme volume situations. Both happen at or near the end of a tape.

    There's extreme volume trading in the direction of the trend which blows out and then the tape reverses. Otherwise, extreme volume against the trend also reverses the tape.

    It's tricky though because sometimes the market trades for a while at extreme volume levels. It seems the definition of "extreme" volume can vary. That's difficult to teach to a stupid computer however much you love automation like myself.
  7. Folks, I need help in this area or at least need to do more work.

    I tried using the 1, 2, 3 approach to drawing IT channels. Of course, that works for a human to do it. But I'm having trouble automating it because the simple rule pick points that don't always make sense to human looking at the chart.

    However, when trading during accelerated replay, I realized that the market often turns at that IT channel level so it helps you anticipate to see where those are.

    I did it simply by "eyeballing" where the IT channel was pointing.

    Still, it would be necessary to somehow workout an algorithm that make sensible IT channels.

    I might simply need to fine tune the 1, 2, 3 point selection.

    But one issue is that after to get several 1, 2, points in succession, it seems to make more sense to draw a line through all of them to get a better sense of the true S/R level.

    Okay, that's all for now. Hope you enjoy and also welcome any contributions or suggestions.

  8. I have tried automating a strategy similiar to this and found it very dificult making an algorithm that is capable of auto drawing channels...

    I am still trying to do it, but what the mind can see very easily its hard to teach the computer how to see it...
  9. Are you talking about intermediate or tape (short term) channels?

    I got the tape channels working very well.

    I decided I like the tape channels to "hug" the bars making many trades possible when price touches the line.

    I'll post a chart this evening.

    Here's how I did it. I start with the tape the same way Jack does it basically.

    But after the second bar, I consider every bar to still be part of the tape unless it meets 3 conditions below, if it meets all 3 then it starts a new tape.

    1. It must have the midpoint ( (high+low)/2 ) lower than the midpoint of the previous bar.

    2. It must close below the right line.


    3. It must not be an OB (outside bar).

    Any other bars, I use a linear regression of the lows (for an uptrend) or highs ( for the down trend) to get the right channel line.

    This gives a line where some of the bars extend past the right line a little and some just above. In other words, it hugs the bars.

    For the left channel line, I take the average deviation from the right line. That way if bars extend way out, it will move out but move back gradually.

    This gives more opportunity to see extreme price movement.

    See if you like them when I post a chart later tonight.


    P.S. For intermediate term, I haven't figured out a simple clean algorithm yet, it seems to require a human eyeball to do it. But maybe I'll get somewhere with that next weekend.
  10. Yea intermediate term is the one that seems to be giving some major fits... I look forward to seeing your chart on the tape however.
    #10     Oct 6, 2008