Page 1 of 3

N bars strategy

PostPosted: Thu Mar 17, 2011 12:26 am
by Alexander.Gettinger
Strategy don't use indicators.

Strategy open/close orders if there is N consequent one-direction bars.

At picture N=5:
N_Bars_Strategy.png


Download:
N_Bars_Strategy.lua
(10.62 KiB) Downloaded 1712 times


The Strategy was revised and updated on December 11, 2018.

Re: N bars strategy

PostPosted: Sat Jun 18, 2011 6:03 pm
by alishus
what time frame is best to use this strategy?
regards

Re: N bars strategy

PostPosted: Thu Jun 23, 2011 1:48 pm
by mfoste1
Could you make a strategy like this to work with heiken ashi smoothed? I have done some backtesting and this type of algo would be very profitable with proper risk management :) So it would work like this:

[if (number) consecutive color bars after candle color change, then open position]
[if (number) consecutive color bars after candle color change, then close position]


Additional parameters it would need
1. trend filter(allow specified side, buy, sell or both)
2. time allowed to trade (allow to trade between (T) hours and (T) hours)
3. Allow multiple positions in the same direction

Re: N bars strategy

PostPosted: Fri Jun 24, 2011 6:30 am
by Apprentice
Heiken_AshiSmoothed_N_Bars_Strategy.png

Heiken_AshiSmoothed_N_Bars_Strategy.lua
(14.04 KiB) Downloaded 1690 times


Heikin-Ashi Smoothed is required.
viewtopic.php?f=17&t=606&p=10600&hilit=HASM#p10600

Re: N bars strategy

PostPosted: Fri Jun 24, 2011 7:05 am
by Apprentice
Time Options Added.

Re: N bars strategy

PostPosted: Fri Jun 24, 2011 8:01 am
by mfoste1
It looks good, but it seems like it is triggering more orders than it should, which would lead me to believe it works on tick data instead of candle close? Could there be an option added for order execution based on the choice of tick or close? It seems like close would work much better :D

Re: N bars strategy

PostPosted: Fri Jun 24, 2011 10:04 am
by Apprentice
I update this one.
Try new version or Set Allow Multiple to No on existing one.

Re: N bars strategy

PostPosted: Sat Jun 25, 2011 10:56 am
by t1982t
It seems it's not working Heiken-Ashi smoothed parameters. Its changes do not affect back test

Re: N bars strategy

PostPosted: Mon Nov 21, 2011 5:15 pm
by Kowmung
Does anyone know if this issue has been resolved yet?

This strategy looks very attractive.

Re: N bars strategy

PostPosted: Tue Nov 22, 2011 2:27 am
by Apprentice
I have fix this bug.