Semi-Automated S&R Trading

Discussion in 'Journals' started by PetaDollar, Jun 18, 2012.

  1. Simulated success ... it traded both the breakout of Friday's high and the pullback to 2630 in the NQ today. Everything was perfect. Real $ starting again tomorrow. :D
     
    #31     Jul 30, 2012
  2. Here we go... NQ: a hinge is forming, so I'll go with a breakout on either side of the premarket range. Here's the log file thus far (it could use a little work):

    Code:
    Input parameters
    
    sim ticks file:<running live>
    input file: /home/peter/SQTP/20120731/input2.xml
    output file: /home/peter/SQTP/20120731/
    log: false
    max trades: 5
    client: 2
    
    Server Version:65
    TWS Time at connection:20120731 08:03:00 CST
    Debug: SubscribeToMarket placing key 1854659387 for requestID 1
    Debug: monitoring preconditions
    Debug: creating precondition call list
    Debug: creating BCIS object
    Debug: getting all trade specifications
    Debug: got 2 specifications
    Debug: creating Callable for the following spec:
    ==================== SingleTradeSpecification id: 2-pml-breakout
    SELL 1 2637.5 tgt pts : 9.0
    conditions:
    2012-07-16T00:01:00.000 - 2012-07-31T15:15:00.000
    fig.trading.bots.modules.BreakoutDown@1eec5e9e
    stops:
    initial pts: 5.0 1st move: offset:0.0 pct:0.2 2nd move: offset:2.0 pct:0.75 time: minutes=15
    Creating its PriceChecker
    Connecting its PriceChecker
    Generating Callable
    Adding Callable to the list
    Debug: creating Callable for the following spec:
    ==================== SingleTradeSpecification id: 1-pmh-breakout
    BUY 1 2651.5 tgt pts : 9.0
    conditions:
    2012-07-16T00:01:00.000 - 2012-07-31T15:15:00.000
    fig.trading.bots.modules.BreakoutUp@1ef0939e
    stops:
    initial pts: 5.0 1st move: offset:0.0 pct:0.2 2nd move: offset:2.0 pct:0.75 time: minutes=15
    Creating its PriceChecker
    Connecting its PriceChecker
    Generating Callable
    Adding Callable to the list
    Submitting Callables for parallel execution
    waiting for price LTEQ 2650.0
    waiting for price GTEQ 2638.5
    got price 2643.75 GTEQ 2638.5
    got price 2643.75 LTEQ 2650.0
    waiting for price LTEQ 2638.5
    waiting for price GTEQ 2650.0
    
     
    #32     Jul 31, 2012
  3. I've never been so happy about losses in my life. I was totally and completely wrong in three trades and lost a grand total of 4.00 NQ points (-$80) or -1 1/3 points per trade. I think back in the day, when I was doing this manually, this would have been one of those disaster days. The kind where you look back and say..."if I would have just followed the rules, I only would have lost $80, not $800."

    Hopefully we'll see what being totally right looks like tomorrow!
     
    #33     Jul 31, 2012
  4. I decided to run market-profile type trades right now on the NQ. It's basically the opposite of what failed this morning. What are the chances of being completely wrong again? About 90% :D Anyway, it's running.
     
    #34     Jul 31, 2012
  5. Right idea, wrong parameters, so no trades. I set my buy area a little too high, so it got spooked out, never took the entry, and canceled itself after the first dip. I set my sell area a little too high, so it never got there. It's well deserved, since I haven't yet taken the time to figure out a statistically sound area to place these parameters. Intuitively I'd guess a band +/- 2 pts around the previous high/low, but I didn't even do that today. I failed at this part today, because anyone trading market profile today should have cleaned up.

    Everything worked perfectly though- real $, breakouts on both sides, support and resistance trades. No open positions, no surprises, no errors.
     
    #35     Jul 31, 2012
  6. Today- dusted off the trading notebook and took a little more time being a trader rather than software developer. Plan:

    • Buying a breakout of 2657
    • Market profile of Sunday - Today (selling the top of the range, buying the bottom)

    Notes- I have only very simple support/resistance recognition in the program once I tell it where the band is. So I decided to place the band near the end of the range. This way I can at least keep the risk low. Later on, I can try writing some more advanced pattern recognition to get some entries at the beginning of the band. Until then, I will just have to pass up those entries. It's a recurring issue with my trading; I'm never satisfied to just take a piece. I want EVERYTHING. It's a blessing if I use that motivation to do things properly. It's a curse if I try and do things without adequate preparation and patience.
     
    #36     Aug 1, 2012
  7. Decent day yesterday; shorted the open for a quick 6.5 pts. Then I had a malfunction (I think) where the program should have passed on buying @ 2630 with that precipitous drop, but ended up losing 3.0 pts. Looking at the log, it somehow received a tick of 2646.00. I suspect it was a fault on my end, but couldn't check since I don't have a raw-incoming data log (I'll fix that this weekend; good to collect anyway). In the meantime I modified the program to start with fresh data structures for each trade.

    This has the additional effect of taking a trade that was cancelled out (not stopped out, but cancelled out) in the past, as long as the preconditions are once again met. I hope this will be a net gain.

    Today:

    Just trying to short around yesterday's close if it gets back up there.

    I don't have many ideas cooked up for days like today, where there is a big movement in the premarket and we're already far out of the previous ranges. I feel like some sort of volatility trading would be better than directional trading on days like today.
     
    #37     Aug 2, 2012
  8. Another decent day. Lost -5.0 on the way up and gained +6.5 on the way down. The +6.5 is notable because that resulted from the last change I described. Previously, I would have not traded that s/r level again. Now, as long as the conditions are satisfied (there indeed was a little pullback on the way down) it will still trade.

    After the second trade the program threw a null pointer exception-- once again from the (now very small) area of the program not under tests. (OK! OK!) So I'll need to track that down this weekend and won't be running today.

    My goal is by the end of August to get the remainder of the program under tests and then scale up. Instead of adding size with the NQ I'd rather trade different contracts simultaneously. I believe this will make for a smoother equity curve as sometimes s/r trades are missed by just a few ticks.
     
    #38     Aug 3, 2012
  9. The error came from a rather convoluted section of code (the way I was handling incoming ticks). I redesigned it and everything got better (shorter and clearer code) throughout the library and also the tests. Speaking of tests... I could never be successful without automated testing. After such a major change, I'll still be running live tomorrow with real $ because of the confidence I have in the tests.

    [​IMG]
     
    #39     Aug 5, 2012
  10. Today I'm trading:
    • Breakout/pullback to 2686
    • Support at 2676

    Net from last week (including malfunctions but not sim):
    +$16.71
     
    #40     Aug 6, 2012