Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   Follow the BIG Candle (https://www.forexfactory.com/showthread.php?t=472331)

abokwaik Feb 22, 2014 6:09am | Post# 1

This is a very simple idea for Auto-Trading (using Expert Advisor)

My idea is to follow the big candle. Open a trade in the direction of the big candle.

Big Candle is identified as follows:
The size of candle (from Low to High) is greater than ATR(atr_period) x ATR_Multiplier

So for example, for GBP/USD, H4, suppose ATR(21) was 30 pips, and we set ATR_Multiplier to 2.5, so we are looking for H4 candles with range > 2.5 * 30 = 75 pips.
So If High-Low of current H4 candle reaches 75 we go long if candle is up, and we go short if candle is down.
(There is an option to open a trade in the current candle (recommended) OR wait for the candle to close)

Take Profit, Stop Loss and Trailing Stop can be of Fixed Pips or Multiple of ATR (recommended).

It is preferable to use large TP in order to utilize Trailing Stop which produces better R:R ratio.
EA will close the trade if an opposite candle appears, and opens a new trade in the other direction,
Or will wait for either SL or Trailing Stop or TP reached and wait for another trigger.

Expert Advisor versions:

  1. Version 1: Big_Candle_01 , with initial parameters
  2. Version 2: Big_Candle_02 , with removed fixed pips and added parameters for Close on Opposite Signal & MA
  3. Version 2 for older MT4 builds < 600 : Big_Candle_02_x
  4. Version 3: Big_Candle_03, with added parameters for Break Even Stop & Candle Effective Size
  5. Version 3 for older MT4 builds < 600 : Big_Candle_03_x
  6. Verison 4 Big_Candle_04 Latest, see post # 226 on Page 14


Khalil


abokwaik Feb 22, 2014 6:59am | Post# 2

1 Attachment(s)
Here's the EA.

Parameters :

  1. tp_pips : Take Profit in Pips, default 0 (in order to use ATR multiples)
  2. sl_pips : Stop Loss in Pips, default 0 (in order to use ATR multiples)
  3. ts_pips : Trailing Stop in Pips, default 0 (in order to use ATR multiples)

If you like to use the above (Fixed Pips instead of ATR multiples, notice if your broker is using 4 or 5 digits. For 4-digit brokers 100 means 100 pips, while for 5-digit brokers it means 100 points, so change it to 1000 if you want 100 pips)

  1. atr_period : default 21, you can use other value but its better not less than 14. This is used to get the average candle size.
  2. atr_multiple : default 2.5, this is the actual trigger for trade open/close. For larger time frames this multiplier will get smaller, for smaller time frames it should be bigger. (2,2.5,3) are suitable for H4 timeframe. For Daily you can try 1.5 or 2. For H1 3,4,5 and so on.
  3. tp_atr : Take profit in terms of ATR multiples, set it High (50,100 ... etc), as we are looking to use Trailing Stop for better RR ratio
  4. sl_atr : Stop Loss in terms of ATR multiples. Depends on which pair you are trading (3, 4 or 5 are good for GBP/USD)
  5. ts_atr : Trailing Stop in terms of ATR multiples. Again depends on which pair you are trading, 5 is good for GBP/USD
  6. candle_period : default 0, means to open a trade before the current candle close. 1 If you prefer to open after candle close. 0 is recommended in order to take advantage of the big candle.
  7. risk_perc : Default 0.02 (2%). This is actually not risk percentage, it is the automatically calculated trade size (lots) as a percentage of the current balance (so if set to 0.02 and your current balance is 10,000 , the trade will be opened with 2 micro lots)
  8. fixed_lots : default 0. If you like to use fixed lots instead of balance precentage you can set this field to 0.01, 0.1, 0.5, 1 ... etc. depending on your balance. And the system will use this volume for all trades.
  9. trail_stop_jump : default 10 pips (for 5-digit broker change to 100). In order to not send many modify orders, it is better to set this to a min. of 5 pips.

That's it. Give it a try on DEMO, and share your feedback.


I know there could be many ways to improve this EA.

In the next few posts I will share some of the testing results.

Good Day,

Khalil
Big_Candle_01.ex4


ZiC Feb 22, 2014 8:00am | Post# 3

nice, so the calculation to open new order mean where the order start automatically.. right? i'll get it to try. will be back here with the result. Which best timeframe you suggested?

abokwaik Feb 22, 2014 8:47am | Post# 4

1 Attachment(s)
These are the test results for GBP/USD, H4 from 1/1/2013 to 31/12/2013.
Parameters :
tp_pips = 0,sl_pips=0,ts_pips=0,
atr_period=21,atr_multiple=2.5,
tp_atr =50,sl_atr=3,ts_atr=5,
candle_period=0,
risk_perc=0.02 (2%),fixed_lots=0,
trail_stop_jump=10
Click to Enlarge

Name: Big_Candle_GU_H4_2013.JPG
Size: 106 KB

abokwaik Feb 22, 2014 8:53am | Post# 5

nice, so the calculation to open new order mean where the order start automatically.. right? i'll get it to try. will be back here with the result. Which best timeframe you suggested?
Larger time frames are better. Minimum H1, better H4 or Daily.

ZiC Feb 24, 2014 7:58am | Post# 6

thanks for sharing abok, i make some test and gotta very good results, all of them make prfit. Im very interesting now, will post the charts here soon..

abokwaik Feb 24, 2014 9:34am | Post# 7

I've thought of some improvements on the EA:

1. Include a moving average parameter in order to take only the trades that go with the Trend.
2. Ignore Signals that are way too far from the moving average.
3. Take Partial Profit at specific distance from the moving average, and leave the rest trailed.

I'm gonna include these modification in the next release.

New ideas are welcome,

Happy Trading

Moga Inv Feb 25, 2014 5:38am | Post# 8

Waiting

Moga Inv Feb 25, 2014 5:40am | Post# 9

What MA period are u looking at 55,60,100,or 200 MA

abokwaik Feb 25, 2014 5:48am | Post# 10

What MA period are u looking at 55,60,100,or 200 MA
Almost done, MA period will be settable by user. However I think it should be small (20) for Large time frames and large (200) for smaller time frames.

Moga Inv Feb 25, 2014 5:57am | Post# 11

ok

abokwaik Feb 25, 2014 6:25am | Post# 12

2 Attachment(s)
Here you go. The new release with test results for GBP/USD as before (H4,2013), parameters are in tester image attached.

Modifications done are:
1. Removing Fixed TP,SL and Trailing Stop. Every thing will be based on ATR so that it will be easier to apply to any pair.
2. Adding of the following new parameters:

  1. Close_on_Opp : Close on Opposite Signal, better set it to false (in order to ride the trend for as long as possible)
  2. ma_period : Moving Average Period (for Trend Identification) 20 is OK for GU/H4.
  3. ma_open_atr : Max Distance from MA to open a trade (in terms of ATR multples). The idea behind this parameter is that we do not want to open a new trade if price is too far from MA as most probably it will go back to MA. In the test I have set this to 3.0. So if a Big Bullish candle appears when price is above its MA by 3xATR we will ignore the signal.
  4. ma_tp_atr : Distance from MA to take 1st profit (in terms of ATR multples). This is where we take our 1st Take Profit (50% of opened Lots). In the test I have set this to 3.0. Remaining Lots will be stopped by the trailing Stop.

Please note that this is a work in progress, do not try with live trading. Use only for testing or demo. Our goal is to reach an optimum solution.
The general idea is to catch price swings based on momentum (hence the big candle).

Again, Ideas are welcome.

Khalil
Click to Enlarge

Name: Big_Candle_02_GU_H4_2013.JPG
Size: 107 KB
Big_Candle_02.ex4


abokwaik Feb 25, 2014 6:36am | Post# 13

Notes about the second release:

1. Profit factor has increased from 1.89 to 3.02. We had 18 won trades out of 20 taken !!!
2. Although we have increased the risk percentage from 0.02 to 0.05, relative draw down has not changed much (from 17.19 to 19.12). Maximal draw down is almost the same (17%).

As we have many options I encourage everyone to test with different parameter settings on different pairs/timeframes. May be we have some potential here.

ukmartin Feb 25, 2014 7:39am | Post# 14

Hi Abowaik

I'd very much like to test your EA, i've added it to my experts folder, but when I go to the Navigator/Experts, to drag it on a chart, it isn't in there?

Martin

Andy B Feb 25, 2014 7:47am | Post# 15

Hi Abowaik I'd very much like to test your EA, i've added it to my experts folder, but when I go to the Navigator/Experts, to drag it on a chart, it isn't in there? Martin
Martin

If you're on a new build of MT4 (600 or higher) then EA's and indicators need to go into a different file location

Go to where you have stored the EA (presumably in the Experts folder) and copy it. Inside Metatrader click File > Open Data Folder. Then open the MQL4 folder, then the Experts folder, and copy the EA into there. Close and re-open MT4 and the EA should be there

Andy

abokwaik Feb 25, 2014 7:49am | Post# 16

Hi Abowaik I'd very much like to test your EA, i've added it to my experts folder, but when I go to the Navigator/Experts, to drag it on a chart, it isn't in there? Martin
Please note that in the latest release of mt4, folders were changed. If you have the latest release, then expert should go in the Experts folder which is under MQL4 folder. (i.e. .../MQL4/Experts/).

Regards,

abokwaik Feb 25, 2014 9:36am | Post# 17

2 Attachment(s)
Lets try shorter time frames. These are two tests on EUR/USD and GBP/USD on M30 for 2013. Results attached.

Notice that since we are using a shorter time frame here, I've set MA to 100 and ATR multiple for candle size to 5.
Also the other parameters are bigger (compared to H4).

Ideas to improve guys.
Click to Enlarge

Name: Big_Candle_02_EU_M30_2013.JPG
Size: 109 KB
Click to Enlarge

Name: Big_Candle_02_GU_M30_2013.JPG
Size: 110 KB

ukmartin Feb 25, 2014 11:09am | Post# 18

Thanks for that Andy B, got it working now

ZiC Feb 25, 2014 2:10pm | Post# 19

1 Attachment(s)
same test with whatever set i like . wow.. its work too on cent.. should implemented in demo now.. then .. is it ready for live? i m sure 'yesss'..

Click to Enlarge

Name: ubkkkk.png
Size: 45 KB

letterB Feb 25, 2014 2:26pm | Post# 20

abokwaik, I am still on old MT4 and I put it in expert folder and I don't see it in MT4.

is this only for build 600?


© Forex Factory