Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   Lets Automate a Simple Renko Strategy! (https://www.forexfactory.com/showthread.php?t=531783)

shreyash Mar 19, 2015 10:10am | Post# 1

3 Attachment(s)
Hey,

I have been trading a simple Renko strategy for quiet some time now and it yields some very decent profits.
Now I want to automate this strategy into an EA so that we dont have to wait for Renko bars to paint for long hours.

The whole concept is about keeping the trading strategy simple yet Accurate & Profitable!

Ok guys so lets first see how to build a Renko chart.

How to Install renko EA:
1. Open 1Min Chart
2. Attach your Renko EA (i.e. Renko_Mod.mq4)
3. Settings for this EA are :

RenkoBoxSize=10.0
RenkoBoxOffset=0
RenkoTimeFrame=2
ShowWicks=true
EmulateOnLineChart=true
BuildChartsWhenMarketOffline=true
CalculateBestBoxSize=false
ATRPeriod=24
ATRTimeFrame=60
UseATRMA=true
MAMethod=0
MAPeriod=120
Click OK and DONE.

4. Open Offline Chart : File > Open Offline > Select EURUSD M2 (Double Click to Open this Chart)
5. Your Renko Chart is now Active.

What we are doing here is that we are getting the Renko_mod.mq4 EA to generate a renko chart in offline mode but updates on live basis.

Now on the current chart you can see renko bricks of 10 pips each.

Now add EMA 50 and EMA 21 indicators to your chart and we are done!

The Rules of the strategy are very simple!

Entry Criteria:

Buy after the brick color changes from red to green and 2 consecutive green bricks have formed and closed.
Our entry will be at the i.e. open of the third green brick.

Sell after the brick color changes from green to red and 2 consecutive red bricks have formed and closed.
Our entry will be at the i.e. open of the third red brick.

Filter:

As a filter we use 21EMA and 50EMA.
If the prices are above the EMAs we take only buy trades.
If the prices are below the EMAs we take only sell trades.

Exit Criteria:

1.When a brick of the opposite color is formed.
OR
2. Trail the trade as more number of bricks are formed until your trailing stop loss takes you out!.

Stop loss:

There are 2 concepts -
1. Last significant hi or low.
2. Hi or low of the last green or red color brick -
i.e. for a buy trade we will use the low of the last red brick from where the price turned.
for a sell trade we will use the high of the last green brick from where the price turned.

Additionally, you can use a trailing Sl of 20-30 pips to safe guard your profits.
You can choose one that best suits your style of trading.


If you are using trailing stop loss don't keep target so that we can let our profits run during times of long trends.

Now you chart should look something like this!

Sell Setup Example :

Attachment 1635545

Buy Setup Example :

Attachment 1635609

I humbly request All the talented and senior programmers on this forum to help me code a EA based on this strategy.

Fellow Members please refer this thread to anyone and anywhere where you can find talented programmers.

As I want an EA that can trade out of the offline renko chart!

All constructive suggestions will be welcomed with open arms.

Also, if you like my strategy please dont forget to thank me!!!
Renko Mod.mq4

89578251 Mar 19, 2015 11:25am | Post# 2

No red color is showed on the bars. Why?

medIce Mar 19, 2015 12:08pm | Post# 3

I might test this. I just hate that Renko is almost impossible to backtest properly. At least i havent found any good way.

babasemi Mar 19, 2015 1:46pm | Post# 4

Hi

Can you post template pls.
It makes everyone to be on the same page with you.

tnx

Jeg Mar 19, 2015 2:38pm | Post# 5

Hi shreyash
I am also interested in Renko charts, they look great when they are trending but how do you manage when it goes sideways? Thanks and regards

IAmRetep Mar 19, 2015 2:41pm | Post# 6

2 Attachment(s)
Hello,
here a diagram for a "quick and dirty" EA. If you think, we can talk about it, here is the source. Made with ForexGenerator and "Copy and paste".
Have fun and let me know, how we can improve it.
Click to Enlarge

Name: diagram.jpg
Size: 307 KB
renko_hunter.mq4

reinerh Mar 19, 2015 4:37pm | Post# 7

i am curious as to how long have you been trading this strategy ?

and how many pips have you been able to generate a month approx ?

sure sounds quite logical and promising to me.

especially since you traded this manual for a while and must have some result data.

green pips to ya

reinerh Mar 19, 2015 4:44pm | Post# 8

Hi Can you post template pls. It makes everyone to be on the same page with you. tnx
yes i second this.

Magix Mar 19, 2015 4:59pm | Post# 9

Hello, here a diagram for a "quick and dirty" EA. If you think, we can talk about it, here is the source. Made with ForexGenerator and "Copy and paste". Have fun and let me know, how we can improve it. {image} {file}
A couple of things I have noticed...but overall not terrible.

1. if ((iMA(NULL, NULL,21,0,MODE_EMA,PRICE_CLOSE,current) > iMA(NULL, NULL,50,0,MODE_EMA,PRICE_CLOSE,current)) && (Ask > iMA(NULL, NULL,21,0,MODE_EMA,PRICE_CLOSE,current)))

This is looking for the ASK to be > than the Moving Average, where as this specificity could actually miss out on the beginning of trend trades.

2. if ((Close[3] > Open[3]) && (Close[2] > Open[2]) && (Close[1] > Open[1]))

A little wordy, because in dealing with Renko, all bricks being the same size, you can simply state, (Close[1]>Close[3]);

Though I am not exactly sure this would make much of a difference...might just me being all sensitive n shit.

Personally...If it were me working the code, I would prefer to look for the beginning of the trend on confirmation, so that on longs and exit if the price closed against the Moving average...

if ((iMA(NULL, NULL,21,0,MODE_EMA,PRICE_CLOSE,current) > iMA(NULL, NULL,50,0,MODE_EMA,PRICE_CLOSE,current))&& (Bid< iMA(NULL, NULL,21,0,MODE_EMA,PRICE_CLOSE,current)) && Close[2]]<iMA&&Close[1]>iMA).....

And work the closing on:
if (Close[2]>iMA...&&Close[1]<iMA).....

This would eliminate a lot of the chop and extend the range of the trend.

It will still suck hard as an EA, but would allow you to be a lot more selective in your trades and eliminate a lot of the DD in a sideways channel.

My dos centavos

medIce Mar 19, 2015 5:09pm | Post# 10

My Mt4 Freeze after opening offline chart... Any idea what to do?

Magix Mar 19, 2015 5:22pm | Post# 11

My Mt4 Freeze after opening offline chart... Any idea what to do?
Buy a new computer...

medIce Mar 19, 2015 5:28pm | Post# 12

{quote} Buy a new computer...
It is new Lenovo with 16gb ram, 4th gen i5, geforce 840 4gb, 1tb ssd. If thats not enough them what is?

Magix Mar 19, 2015 5:31pm | Post# 13

{quote} It is new Lenovo with 16gb ram, 4th gen i5, geforce 840 4gb, 1tb ssd. If thats not enough them what is?
Proper installation of the Meta4, outside of your system32...

&&

Dropping all of the charts that you don't use.

Renko is a huge resource hound, so is meta...the combination can tax the most serious system if there is too much going on at the same time.

Right click on market watch screen.
Remove all.

This helps.

Delete historical charts of anything you are not watching
Remove the zillion indicators from any open charts and try again.

IAmRetep Mar 19, 2015 5:41pm | Post# 14

Ok, I'm out of the office until Monday, more then. On the fly, "((Close [3]> Open [3]) && (Close [2]> Open [2]) && (Close [1]> Open [1]))" is necessary because bar number 2 can have another color and so your suggestion is not true, right?
I think the recognition of a trend is simple. It starts with 3 same colored bars and ends when a bar with a different color occurs.

Is there anybody out there who can help me, setting a tester within an offline chart?

Magix Mar 19, 2015 5:58pm | Post# 15

Ok, I'm out of the office until Monday, more then. On the fly, "((Close [3]> Open [3]) && (Close [2]> Open [2]) && (Close [1]> Open [1]))" is necessary because bar number 2 can have another color and so your suggestion is not true, right?
Nope.

Really, as it is already written, makes no difference...

I did state that it's just wordy...doesn't mean it isn't as effective if not the flat out same.

All at the same time, if you check the charts previously posted...

When FASTMA>SLOWMA, price still went below for confirmation, typical trend change and then bought back...

I still thing that for longs, and for a greater run cycle, if(FASTMA>SLOWMA&&Close[2]<FASTMA[2]&&Close[1]>FASTMA[1])return (buy);, would be the way to go...

Close on if(Close[2]>FASTMA[2]&&Close[1]<FASTMA[1]);

Plus, it's your code...why the fuck would you listen to me anyways?

Do whatever you want or whatever the op wants...was just a suggestion.

IAmRetep Mar 19, 2015 6:20pm | Post# 16

[quote=Magix;8150988]{quote}

Ok guy, have you had an off day? Go and buy a book on polite conversation! Hear from you next week

MathTrader7 Mar 19, 2015 6:37pm | Post# 17

1 Attachment(s)
Here is the first version of the EA I just created. It has not been tested yet. I just started running it on a demo account on my VPS. Use this EA at your own risk.

Note: In order to enable trading on an offline chart, you have to uncheck the Offline chart option in the Common tab of the Renko chart properties (press F8 to bring up the properties window).

Edit: There is a bug in this version that may prevent the EA from opening SELL positions. I fixed the bug in Version 1.1 (see Post 45).
MathTrader7_RenkoEA.ex4

mozhixing Mar 19, 2015 6:49pm | Post# 18

I will forward test it from today, thanks.

Magix Mar 19, 2015 7:04pm | Post# 19

[quote=IAmRetep;8151020]
{quote} Ok guy, have you had an off day? Go and buy a book on polite conversation! Hear from you next week

Bit of a delicate peach, aren'tcha?

sirwolf Mar 19, 2015 8:08pm | Post# 20

Here is the first version of the EA I just created. It has not been tested yet. I just started running it on a demo account on my VPS. Use this EA at your own risk. {file}
Does this have to be applied to a Renko CHart? I have never used them before. Thanks!


© Forex Factory