Cable Ambush - page 2

 

Thanks for your advice Linuxser,

Would you be able to help me modify it so that it works on other time-frames? I would like it to work on smaller timeframes than H1.

I am not a professional programmer either, and I am not sure how to convert it.

Thanks again, Kris

PS. I attache the indicator that is being discussed, in case someone else would be willing to look into the code.

Linuxser:
I'm not an expert coder but by looking the code it's like you interpret the session for 24 hours.

When we move to another timeframe candles needs to be recalculated to complete a full day.

We have 1440 1 minute candles for one day as we have 24 hourly candles for one day.

1440/Timeframe would give you exactly the needed candles to calculate the session.

1440/5 minutes says you need 288 candles to complete a day.

1440/30 minutes says you need 60 candles to complete a day and so on.

I'm using this calculation for mi pivots indicators.
Files:
 

Well, my Ambush strategy seems to be marginally profitable and currently stuck in a range (see attached).

Time to shift gear to lower time-frame.

Cheers, Kris

 

Thanks to Linuxser, I found a way to shift gear to M30 timeframe.

Back-tests look encouraging (see below). From now I will be demo/forward-testing the Ambush on M30 time-frame.

My demo test will be done on IBFX, mini account.

Cheers, Kris

PS. Attachments:

* Ambush_Cable_M30 is an indicator file

* Ambush_Cable_II is an EA file

 

Please, see this modified code. It works from M1 to H4, but check if this is what you need.

Files:
 

Awesome! This is exactly what I was after!

I have applied your logic (I hope) and I updated "DataPeriod numbers" for M5 and M1 cases.

I renamed this indicator to Fibs_Ambush as it is based on Fibonacci retracement and extension levels.

Thanks a stack, Kris

Linuxser:
Please, see this modified code. It works from M1 to H4, but check if this is what you need.
Files:
 
Tokarus:
Awesome! This is exactly what I was after!

I have applied your logic (I hope) and I updated "DataPeriod numbers" for M5 and M1 cases.

I renamed this indicator to Fibs_Ambush as it is based on Fibonacci retracement and extension levels.

Thanks a stack, Kris

Glad to help, sorry for the wrong numbers I forgive to correct the code after test.

 

Cable Ambush EA

Well, well, well.

It turns out that the same strategy, on the same currency pair, over the same period of days, performs better on M15 than on M30, while M30 performs better than H1. Shorter than M15 however, deteriorates rapidly, i.e M5 is worse than M15.

It actually makes sense, as we get more precise entries and exits.

This EA opens positions and closes them at "Bar-Close". This way we avoid being stopped by the market noise. However, during news, the 15-min bar can close way beyond a reasonable stop level. So, I added a SpikeStop (of 50-pips), which closes the position "on touch" to protect ourselves from adverse news. It improved the performance by approx 10%.

Also, please note that diff currency pairs have diff characteristics. This EA is specific to Cable. In back-tests it doubled the account over 2 months!

Furthermore, this EA modifies the session settings of the indicator. To keep it in synch, adjust the indicator parameters (JP_open, EU_open, US_open) in line with the EA settings.

Attached please find the:

* Ambush_Fibs.mq4 - indicator file, and

* Ambush_III_GBP.mq4 - latest version of the EA.

Cheers, Kris

PS. Does anyone know how to get maximum data for back testing? My account has severe historical data limitations.

 
Tokarus:
Well, well, well.

It turns out that the same strategy, on the same currency pair, over the same period of days, performs better on M15 than on M30, while M30 performs better than H1. Shorter than M15 however, deteriorates rapidly, i.e M5 is worse than M15.

It actually makes sense, as we get more precise entries and exits.

This EA opens positions and closes them at "Bar-Close". This way we avoid being stopped by the market noise. However, during news, the 15-min bar can close way beyond a reasonable stop level. So, I added a SpikeStop (of 50-pips), which closes the position "on touch" to protect ourselves from adverse news. It improved the performance by approx 10%.

Also, please note that diff currency pairs have diff characteristics. This EA is specific to Cable. In back-tests it doubled the account over 2 months!

Furthermore, this EA modifies the session settings of the indicator. To keep it in synch, adjust the indicator parameters (JP_open, EU_open, US_open) in line with the EA settings.

Attached please find the:

* Ambush_Fibs.mq4 - indicator file, and

* Ambush_III_GBP.mq4 - latest version of the EA.

Cheers, Kris

PS. Does anyone know how to get maximum data for back testing? My account has severe historical data limitations.

Links with information:

https://www.mql5.com/en/forum

https://www.mql5.com/en/forum/general

Video with explanation: https://www.mql5.com/en/forum

External link with Codersguru detailed explanation: MetaTrader Strategy Tester | www.metatrader.info

 
Tokarus:
Well, well, well. Furthermore, this EA modifies the session settings of the indicator. To keep it in synch, adjust the indicator parameters (JP_open, EU_open, US_open) in line with the EA settings.

I am not sure if I understand what to do for AlpariUK broker (GMT+1, their data). What should I adjust the numbers to? This is what they are as default in the downloadable files:

EA Indic

JP_open 3 0

EU_open 10 8

US_open 14 13

Should they all be same in EA and in Indic? (like JP both be 3?)

Can you please advise what to use for AlpariUK?

Thank you for the help, Ltrd

 

Cable Ambush EA - Alpari UK

You should try to tweak the parameters and back-test it to get optimal settings for your particular broker. Then let it run/forward-test on your demo account to validate the findings.

I find that on different platforms I get different results. This morning, I back-tested it on Alpari UK, standard account (1 lot = 100,000), H1 timeframe, (dates) from 1-Jan-2008 to 23-May-2008, the best settings were JP_open=6; EU_open=11; US_open=15.

If you open the EA code, you will see my various back test results. I attach Cable Ambush optimised for Alpari UK. It works best on H1 & M30 timeframes.

Cheers, Kris

Files:
Reason: