N bars strategy

Strategies are published here.

Moderator: admin

N bars strategy

Postby Alexander.Gettinger » Thu Mar 17, 2011 12:26 am

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.
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: N bars strategy

Postby alishus » Sat Jun 18, 2011 6:03 pm

what time frame is best to use this strategy?
regards
alishus
 
Posts: 22
Joined: Thu Jun 16, 2011 3:44 am

Re: N bars strategy

Postby mfoste1 » Thu Jun 23, 2011 1:48 pm

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
mfoste1
 
Posts: 66
Joined: Thu Oct 21, 2010 6:55 pm



Re: N bars strategy

Postby mfoste1 » Fri Jun 24, 2011 8:01 am

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
mfoste1
 
Posts: 66
Joined: Thu Oct 21, 2010 6:55 pm

Re: N bars strategy

Postby Apprentice » Fri Jun 24, 2011 10:04 am

I update this one.
Try new version or Set Allow Multiple to No on existing one.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: N bars strategy

Postby t1982t » Sat Jun 25, 2011 10:56 am

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

Re: N bars strategy

Postby Kowmung » Mon Nov 21, 2011 5:15 pm

Does anyone know if this issue has been resolved yet?

This strategy looks very attractive.
Kowmung
 
Posts: 1
Joined: Mon Jun 20, 2011 8:05 pm

Re: N bars strategy

Postby Apprentice » Tue Nov 22, 2011 2:27 am

I have fix this bug.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Next

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 16 guests