Coders wanted! Please help!

 

I have a really neat system that I would absolutely love to have coded into an EA. I really hope someone can help!

Okay, here's the parameters:

Daily Chart

Bollinger Bands: 22 Period, 1 Deviation

150 Period EMA is the long/short filter when price is above 150 EMA, only take longs, below the 150 EMA, only take shorts.

There are 2 trade types: Breakouts/Breakdowns, and Bollinger Band Trades

Trade type #1: Breakouts/Breakdowns

Buy 8 day breakouts with buy stops at 8 day high +5 pips if breakout trigger is above the 150 EMA.

The Stop for this trade is the 15 day ATR x1.5 in pips, not to exceed 3% of account equity per trade.

There is no target. As long as the stop isn't hit, exit the trade at the close of the 7th bar that you've been in the trade. (Obviously, this would be at the open of the 8th day, as you have to wait for the 7th day to close first.) Note: Bar number one is the day the trade was triggered.

Short 8 day breakdowns with sell stops at 8 day low -5 pips if breakdown trigger is below the 150 EMA. (See picture)

Stops for this is the same as above.

Trade Type # 2: Bollinger Band Trades

Bollinger Band Longs:

When the market closes above the lower Bollinger Band, following a day that the market closed below the lower Bollinger Band, Buy! (at the next open, obviously, since you have to wait for the bar to close before a trade is triggered.) This BB long trade is only valid if the close is above the 150 EMA, remember.

The stoploss is the same as all the others, 1.5x the 15 day ATR, not to exceed 3% equity risk.

The target for the BB trade, however, is different. The target is the upper Bollinger Band. But since Bollinger Bands are dynamic with price, the target must too be dynamic, and go up and down just as the level of the top Band does.

Bollinger Band Shorts:

When the market closes below the upper Bollinger Band following a close above the upper Bollinger Band, go short! That is, of course, if and only if the close is also below the 150 EMA. (See picture)

The stoploss is the same as the other trades previously discussed.

The target for the short BB trade is the lower Bollinger Band. This target has to be dynamic, and constantly changing with price and the lower band, as stated above.

Thanks in advance for your time and your help

Good trading!

 

Here is EA for your bolinger bands strategy. Set EA input "TakeProfit" to 0 to turn it off. Positions are closed by EA when it reaches the other band as you have described. Also stop loss is dynamic with ATR, so it's not important what you set in "StopLoss" EA input. You can use it on any timeframe. I think there would be not much trading oportunities on daily. It takes much time to backtest on daily, so you can check it yourself. I've just tested on smaller timeframes that logic is the same as you have described.

Files:
bb_trades.ex4  68 kb
 
EACreator:
Here is EA for your bolinger bands strategy. Set EA input "TakeProfit" to 0 to turn it off. Positions are closed by EA when it reaches the other band as you have described. Also stop loss is dynamic with ATR, so it's not important what you set in "StopLoss" EA input. You can use it on any timeframe. I think there would be not much trading oportunities on daily. It takes much time to backtest on daily, so you can check it yourself. I've just tested on smaller timeframes that logic is the same as you have described.

Thanks EACreator! Once again, you are the man!

 

Both strategies?

EACreator:
Here is EA for your bolinger bands strategy. Set EA input "TakeProfit" to 0 to turn it off. Positions are closed by EA when it reaches the other band as you have described. Also stop loss is dynamic with ATR, so it's not important what you set in "StopLoss" EA input. You can use it on any timeframe. I think there would be not much trading oportunities on daily. It takes much time to backtest on daily, so you can check it yourself. I've just tested on smaller timeframes that logic is the same as you have described.

EACreator,

Are both of the aforementioned strategies coded in the EA? Or just the Bollinger Band trade?

It appears as though the EA isn't taking the breakout trades...?

Please advise.

Thanks.

 
ahillsdale:
EACreator,

Are both of the aforementioned strategies coded in the EA? Or just the Bollinger Band trade?

It appears as though the EA isn't taking the breakout trades...?

Please advise.

Thanks.

Is there a way to run both strategies simultaneously?

 

One of your rules:

"As long as the stop isn't hit, exit the trade at the close of the 7th bar that you've been in the trade. "

Currently time counter for exiting signals functionality is not available in EACreator online tool. There is only tick counter, however it would not be possible to use it for daily bars. If you find some custom indicator which gives such signal I can make it and post unlimited EA to this thread.

After several days it will be available for everyone to create one-month backtesting EAs for free and without any registrations, so you can try it by ourself what's possible

 

OK.

Thanks for your help. I really appreciate it.

Reason: