TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum
Bruce - thank you - Dan
1. Something is still incorrect. Out of 6300 optionable stocks today, only 3 show as gap-downs: CSBR, ASSG, and NLY. However, none of them are gap-downs.
2. Is it possible to speed up the algorithm so that only the first bar is analyzed for stocks with no gap-up or gap-down? Simply set Plot = 0 to for these, and it is not necessary to look at bars two through 15. Since a vast majority of stocks are not gap-ups or gap-downs, that should speed up the algorithm significantly.
Thanks .. have a great weekend.
The formula seems to work for gap-ups, but 1) it does not identify any actual gap-downs, and 2) misidentifies some gap-ups as gap-downs, e.g., NFLX today >> plot = -1.03.
The idea is to find gap-ups with subsequent bars that break to the upside (long trades), and gap-downs, with subsequent bars that break to the downside (short trades).
On the first bar, I just need to know if the gap is up or down compared to yesterdays close, there has to be a gap between yesterdays close and the low on gap up (or high on gap down) of the first bar.
On the second bar, it has to be an engulfing candle.
On subsequent bars, the high (or low) is ONLY compared to the second bar high (or low).
line b should read
b) 2nd 1 minute bar is engulfing candle of 1st one minute bar, ie, high(2) > high(1) AND low(2) < low(1) AND
Thanks for your rapid response. I see I need to modify the algorithm.
a) 1st minute bar is a gap up or gap down from yesterday's close AND
b) 2nd 1 minute bar is engulfing candle of 1st one minute bar, ie, high(2) > high(1) AND low(2) < low(2) < low(1) AND
c) IF a AND b are true, analyze 3rd through 15th bar
IF High(n) > High(2) AND 1st bar was gap up, THEN PLOT = 1+bar/100 else
IF Low(n) < Low(2) and 1st bar was gap down, THEN PLOT = -1-bar/100
d) If a AND b AND c not true, PLOT=0.
e) After bar 15, Freeze PLOT at value of 1st bar when a AND b AND c are true, otherwise PLOT = 0.
Thanks again for your patience. Dan
Would you please code the following algorithm.
Thank you ... Dan
BarCount = number of 1 minute bars beginning at start of trading day
Set Plot(1)=0 for 1st 1 minute bar
If plot(currentbar-1) <> 0, Plot(barcount) = Plot(Barcount -1) (ie, freeze all future plot values at 1st non-zero value)
a) If 2nd one minute bar is engulfing candle of 1st one minute bar & any one of 15 subsequent bars breaks the top of the 2nd one minute bar, then set Plot = 1 + Barcount/100.
b) If 2nd one minute bar is engulfing candle of 1st one minute bar & any one of 15 subsequent bars breaks the bottom of the 2nd one minute bar, then set plot= -1 - Barcount/100.
c) Otherwise Plot = 0.
d) If barcount > 15, stop algorithm (do not analyze or waste CPU Power), set Plot=Plot(15)
thank you... Dan
As usual, I need your coding expertise. The following code is not compiling. Please debug.
Thanks ... Dan
Bruce, If I did not have SMI indicator in the indicator, could I limit the amount of data backtested?