Monday, January 23, 2012

Happy Chinese New Year

I am super adaptive (and I put it in my resume). I celebrate all holidays of all regions and all religions. (Yeah, why not.) Today is the big one, the lunar new year or Chinese New Year. According to Chinese tradition, people give Red Envelops to symbolize good luck and ward off evil spirits. Here is a small one from me. Wish you a great new year.

i did some quick coding in TOS based on an article from Connie Brown. In general it is one of a series of practices to apply moving average and macd to RSI. Like RSI and derivatives, it is easy to apply. Extreme reversal, zero line breach, divergence. Be aware, this is just the very first version. it may contain mistakes and/or misunderstanding. By no means it can serve as a sole indicator for trading. I am not responsible for any consequence or coincidence.

The code: See comments area.

How to use it: A daytrading program's week (hypothetical) using DivG indicator on 15 min ES.


(click to enlarge) 

Easy Tuesday: Woke up in the morning and realized price trend down, RSI down, DivG convergent with the trend. So the plan is to short the pop until I see a trend change.

12:15 ES rebounced and rejected at MA. DivG make a peak then reversing, RSI made a small pull back then resumed down trend. Short at 1296.
3:15 ES made a new low at 1286, but DivG formed a divergence. RSI traveled to oversold territory then pull back. It's time to cover. (+10 points)

Strong Wednesday: Overnight, ES formed a double bottom at 1286, which was also Tuesday low. DivG and RSI both made a higher low, or divergence. The plan is to long on pull back. 9:50 ES took the MA. Long at 1292. After a small pull back to 1294, ES printed 1301. DivG didn't follow and formed a div, while RSI was rejected at 70 line. Set a stop at previous swing high 1298. Stopped out 1:30. After that, price and oscillators kept on making new divergence. Not sure what it is and I choose not to look at it. (+6)

Sit on hand Thursday: correction finished overnight and market was super strong after good econ news. It was a confusing day. Not only I was confused, but the entire market. Pull back never closed below MA. Osc never gave signal. RSI and DivG, which is a derivative of RSI disagreed in the afternoon. Why bother trading, sit on hand is the best choice. (0)

Friday is January Option Expiration day. It was a boring day and I should not trade. But after a boring Thursday I could not help myself. At 11:30 ES dip to overnight low of 1305 and found support. DivG made a positive divergence. RSI made a reversal in the green box. The range was small that day. I never got chance to get out. 2:30 ES made a higher low at 1306 with another divergence on DivG. Add 2nd batch. It turned out to be good. Closed at 1311 before close.(+6, +5)

DivG actually suggested holding short over weekend, since it could not make new high with the price, but it is against the rule.

1 comment:

  1. # MY_RSI_DIVG

    declare lower;


    # input over_Bought = 70;
    # input over_Sold = 30;
    input price = hlc3;
    input length = 14;
    input Period1 = 5;
    input Period2 = 3;
    input Period3 = 9;

    def NetChgAvg = WildersAverage(price - price[1], length);
    def TotChgAvg = WildersAverage(AbsValue(price - price[1]), length);
    def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

    def RSI = 5 * (ChgRatio + 1);
    # plot OverSold = over_Sold;
    # plot OverBought = over_Bought;

    def Exp_RSI = ExpAverage(RSI, Period1);
    def Exp_AvrgRSI = ExpAverage(Exp_RSI, Period2);
    def SMA_Exp_AvrgRSI = Average(Exp_AvrgRSI, Period3);

    plot DivG = Exp_AvrgRSI - SMA_Exp_AvrgRSI;

    DivG.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
    DivG.AssignValueColor(if Divg > 0 then Color.UPTICK else Color.DownTick);
    DivG.SetDefaultColor(GetColor(8));

    ReplyDelete