I am trying to recreate a TC2000 scan as outlined on the WishingTree blog webinar called YellowBand. The code is scanned in daily but includes weekly and monthly timeframes. I think managed the majority of conditions except for one:
The monthly (yellowband1): the stock has made a monthly bar all-time high 2 bars ago, and has spent 1 or 2 months consolidating, so the recent bar is below the ATH value. I tried many options using ValueWhen and HHVBars - but can't figure it out.
wc = TimeFrameCompress( Close, inWeekly ); mc = TimeFrameCompress( Close, inMonthly ); Yellowband1 = Ref(mc,-2) > HHV(mc,100) AND mc < Ref(mc,-2); Yellowband2 = wc > MA(wc,10) AND MA(wc,10) > MA(wc,30) AND MA(wc,4) > MA(wc,10); Yellowband3 = StochD(10,1) <= 25 OR StochD(10,1,1) <= 25 OR StochD(10,1,2) <=25; Yellowband4 = C > Ref(C,-1); Yellowband5 = StochD(1,1) >= 40; Yellowband = Yellowband1 AND Yellowband3 AND Yellowband3 AND Yellowband4 AND Yellowband5;
I guess my questions are
Is the correct way to source other timeframe data?
And what is the best way to identify and chain events, so something like if Y occurs with X bars, and now Z happens within W bars, trigger true?