Rol's Trading Journal

Discussion in 'Journals' started by Rol, Feb 2, 2011.

  1. heech

    heech

    FYI, I would find it interesting (and others probably would as well) if you ran correlation with S&P weekly numbers.

    Just paste your % gains/losses every week into a column, and calculate S&P weekly columns in another. Use Excel's =CORREL().
     
    #301     Jul 29, 2011
  2. Hey Rol, I'm also considering into automating my system, however I have zero programming experience. I was looking into hiring someone but as I have some free time at nights I would like to take a shot at it myself. How difficult would you say the process is and more importantly how and where do you start?
     
    #302     Jul 29, 2011
  3. Rol

    Rol

    Thanks for the idea heech. What I came up with is presented here. It shows my usual % profit vs. SP500, and a correlation chart below it. 1 means it was correlated that week and -1 means it was not. I started out the year highly correlated it would appear, but later on it appears relatively uncorrelated.

    [​IMG]
     
    #303     Jul 29, 2011
  4. Rol

    Rol

    Hi prjctdork,

    I have always been a "do-it-yourselfer" so I went with building my system myself from the ground up. This way when problems arise, I know how to fix them myself. I would say the route I took was very difficult and time consuming, but now most of the hard labor is complete, thankfully.

    There are so many ways I see people approaching automation, I'm not sure I am qualified to be giving advice. You might get some good books on the subject. I think automation works when you use it more for executing your trading plan on a consistent basis, rather than relying on the results of a curve-fitted backtest. I began with some simple strategy code and kept building upon it and revising it over time.

    My goal is to be able to churn out steady gains over a long period, and to be able to scale up as equity grows. I am not trying to "swing for the fences" as that would potentially blow my account quickly or cause me to confuse skill with luck.
     
    #304     Jul 29, 2011
  5. I completely understand, and I thank you for the reply. I've developed a strategy that works well for me. However, I would like to be able to automate it to take out the human emotion and anxiety out of the equation. I see myself making the same mistakes over and over again that go against my rules. So, taking out the advice, which books would you recommend someone to read, who has 0 knowledge on programming and when I mean 0, I mean what is coding? :)
     
    #305     Jul 29, 2011
  6. heech

    heech

    Hey Roi,

    Sorry, gave you incomplete instructions. Run CORREL over both series (like, =CORREL(A1:A25, B1:B:25)). The result should be a single number between -1.0 and +1.0.
     
    #306     Jul 29, 2011
  7. Rol

    Rol

    That is what I was thinking at first, as an array. Using these weekly changes, I get a correlation coeffecient of 0.47. So it appears I am about half way correlated if zero would be no correlation, and a negative coefficient would be inverse correlation.

    Code:
    Date	% Chg	SP Chg	COR
    			0.47
    12/31/2010	0.00%	0.00%	
    1/7/2011	1.90%	1.11%	
    1/14/2011	3.42%	1.70%	
    1/21/2011	-2.64%	-0.72%	
    1/28/2011	-0.74%	-0.51%	
    2/4/2011	3.09%	2.69%	
    2/11/2011	4.28%	1.49%	
    2/18/2011	1.19%	1.07%	
    2/25/2011	-5.30%	-1.64%	
    3/4/2011	2.73%	0.11%	
    3/11/2011	2.34%	-1.23%	
    3/18/2011	1.41%	-2.35%	
    3/25/2011	5.40%	2.77%	
    4/1/2011	1.59%	1.41%	
    4/8/2011	0.30%	-0.22%	
    4/15/2011	4.24%	-0.62%	
    4/21/2011	1.46%	1.32%	
    4/29/2011	1.90%	1.98%	
    5/6/2011	4.67%	-1.63%	
    5/13/2011	2.55%	-0.12%	
    5/20/2011	-0.05%	-0.32%	
    5/27/2011	0.64%	-0.07%	
    6/3/2011	-0.72%	-2.31%	
    6/10/2011	-5.90%	-2.16%	
    6/17/2011	3.40%	-0.43%	
    6/24/2011	4.87%	-0.19%	
    7/1/2011	1.65%	5.61%	
    7/8/2011	-1.43%	0.47%	
    7/15/2011	2.61%	-2.13%	
    7/22/2011	2.22%	2.19%	
    7/29/2011	-8.53%	-3.24%
    
     
    #307     Jul 30, 2011
  8. Rol

    Rol

    As an example, here is code for a moving average cross long entry:
    Code:
    { Buys if Price crosses over Avg and then stays above Avg for one or more bars }
    
    inputs: Price( Close ), Length( 9 ), ConfirmBars( 1 ) ;
    variables: Counter( 0 ) ;
    
    if Price > AverageFC( Price, Length ) then 
    	Counter = Counter + 1 
    else
    	Counter = 0 ;
    
    if CurrentBar > ConfirmBars and Counter = ConfirmBars then
    { CB > ConfirmBars check used to avoid spurious cross confirmation 
      at CB = ConfirmBars }
    	Buy ( "MACrossLE" ) next bar at market ;
    
    
    { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** 
      ** TradeStation reserves the right to modify or overwrite this strategy component 
         with each release. ** }
    And here is code for a moving average cross long exit:

    Code:
    inputs: Price( Close ), Length( 9 ) ;
    variables: Avg( 0 ) ;
    
    Avg = AverageFC( Price, Length ) ;
    
    if CurrentBar > 1 and Price crosses under Avg then
    { CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
    	Sell ( "MACrossLX" ) next bar at market ;
    
    
    { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** 
      ** TradeStation reserves the right to modify or overwrite this strategy component 
         with each release. ** }
    
    [​IMG]

    It is a canned entry and exit strategy written in EasyLanguage that comes with Tradestation that I applied to a 15 minute chart of SPY going back 30 days. As you can see, the results are inconsistent. Trade 30 is when it caught that move on 7/18 you can see on the chart. The code includes a description of what the strategy does.

    I personally think these types of entry and exit rules are junk, but they give you an idea how to start looking at charts, and seeing how consistent rules applied to a chart play out.

    I haven't read any books on automated trading, per se. The code I came up with for my strategy was mostly hacked together from bits and pieces from searching the TS forums, and entry and exit rules I developed that seem to give me some sort of edge.

    Many here at ET seem to use Ninja Trader and IB. However, I feel good about the execution side of TS, which can be a weak link in an otherwise good strategy.
     
    #308     Jul 30, 2011
  9. Rol, do you trade stocks which have released earnings? Quite a few of them fall throw the floor last week. Thanks.
     
    #309     Jul 30, 2011
  10. Rol

    Rol

    I have considered filtering out stocks with upcoming earnings, but decided it would be too much trouble and would interfere with automation. Stock price responds in a great variety of ways to earnings, many times in unexpected ways. I may even benefit from earnings and have many times before.

    Here is VPRT that just released earnings Friday. Earnings were in line with Wall Street estimates, but guidance for next year pointed to shrinking earnings despite sharply higher sales targets. I managed to sidestep it because my system took trades in other stocks the past few days. Even so, it would have been a nice opening gap fade Friday, opening at 26.35 and getting as high as 30 before closing at 26.70.

    [​IMG]

    The chance of a stock crashing from my entry is the main reason I do not buy more than 100 shares initially, whether it is during earnings season or not. Some may have noticed, but my system does not add to a position the same day, which incidentally makes coding easier.
     
    • vprt.jpg
      File size:
      47.9 KB
      Views:
      440
    #310     Jul 30, 2011