ludowillems 111 posts msg #149724 - Ignore ludowillems |
12/1/2019 12:16:31 PM
Dear members,
I look for candles where :high > ma(180) and low < ma(180).
The low of the day was below the MA and the High above the MA on that same day . That works.
Now I'd like the number of times this happenend in the last n days, and display a column with the results.
How do you formulate this?
Thanks for your time,
ludo
|
xarlor 587 posts msg #149725 - Ignore xarlor |
12/1/2019 12:36:05 PM
Note: count limit is 100.
|
arenas 14 posts msg #149728 - Ignore arenas |
12/1/2019 4:52:27 PM
Hello, Here is another scan when after a down trend a doji candlestick appears in an oversold Stochastic and the next day is a gap up. def down = if high[1] < low[1] and high[2] < low and high[3] < low [3] < 3 and high[4] < low and high[5] < low [5] then 1 else 0; def doji = if open[1] == close[1] then 1 else0; def stoch = if StochasticFast().OverSold[1] is true then 1 else 0; def gap = open > high[1] plot scan = if down and doji and stoch and gap then 1 else 0;
|
ludowillems 111 posts msg #149737 - Ignore ludowillems modified |
12/2/2019 5:34:33 AM
Thanks xarlor and arenas for your time.
I added my trigger conditions to the filter (found this code here on the forum). The final decision to enter could be the slope of the MA(180).
All I want is a green day after the trigger day !
I wonder if there is a way to backtest this ?
PS: the filter works also with 220 days !?
|
ludowillems 111 posts msg #149738 - Ignore ludowillems |
12/2/2019 7:57:13 AM
adding " 5 day slope of ma(180) > 0" eliminates some false signals.
|
xarlor 587 posts msg #149749 - Ignore xarlor |
12/2/2019 12:02:23 PM
You're right, count limit is 252 (1 year in trading days). Change it to 253 or higher and it breaks.
|