danielbender 
Gold User, Member, Platinum User, TeleChart

Registered User 




Unsure 

Saturday, January 14, 2006 
Wednesday, March 06, 2019 12:23:46 AM 
436 [0.15% of all post / 0.07 posts per day] 

Bruce  thank you  Dan

Bruce
1. Something is still incorrect. Out of 6300 optionable stocks today, only 3 show as gapdowns: CSBR, ASSG, and NLY. However, none of them are gapdowns.
2. Is it possible to speed up the algorithm so that only the first bar is analyzed for stocks with no gapup or gapdown? 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 gapups or gapdowns, that should speed up the algorithm significantly.
Thanks .. have a great weekend.
Dan

Bruce
The formula seems to work for gapups, but 1) it does not identify any actual gapdowns, and 2) misidentifies some gapups as gapdowns, e.g., NFLX today >> plot = 1.03.
The idea is to find gapups with subsequent bars that break to the upside (long trades), and gapdowns, with subsequent bars that break to the downside (short trades).
Thanks...Dan

Bruce
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).
Thanks.. Dan

Sorry
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

Bruce
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 = 1bar/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

Bruce
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(currentbar1) <> 0, Plot(barcount) = Plot(Barcount 1) (ie, freeze all future plot values at 1st nonzero 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

Hello Bruce
As usual, I need your coding expertise. The following code is not compiling. Please debug.
Thanks ... Dan
If(Price.MaxHigh(10.1)  Price.MinLow(10.1)) / Price.MinLow(10, 1) > 0.10 And_
Price.Netchange(1, 1)<0 And Price.close>Price.open Then
Plot = 1
ElseIf (Price.MaxHigh(10.1)  Price.MinLow(10.1)) / Price.MinLow(10, 1) > 0.10 and_
Price.Netchange(1, 1) > 0) And Price.close < Price.open) Then
Plot = 1
Else
Plot = 0
End If

Bruce, If I did not have SMI indicator in the indicator, could I limit the amount of data backtested?

