View Single Post
  #319 (permalink)  
Old 01-25-2008, 06:01 PM
Big Be Big Be is offline
Member
 
Join Date: Oct 2006
Posts: 69
Big Be is on a distinguished road
Announcing Kiko_v2!

Monik7 / Kiko, thanks for starting the EA.

I have been working on my own EA that uses the VQ indicator. Studying the backtest results of Kiko's EA, and the code of it and the VQ indicator, looking at what is right about them and what is wrong has helped me to get things more right.

So I have also modified Kiko.mq4.
Kiko_v2 usually makes a profit, which is pretty good for an EA only using one indicator!
The default settings are for GBPUSD H1.
It is intended to work with the VQforEA indicator.
VQforEA.mq4 is VQ.mq4 stripped down, and modified to work with EA’s.

With the 50 pip SL, the Lots are sized at about 2% of the initial $10,000 deposit, which limits drawdown.
My max 1 year drawdown is about 18%.


DETAILS:
Tested with Alpari data, "every tick", and 90% modeling quality.

The first problem I had was that it was slooow. I added a couple lines that fixed that. The new lines only lets the EA look at data from the first tick of a new bar. This requires that you look at the Close data from the earlier bar, and compare it where necessary to the bar(s) earlier to that one.

This is a good setup, as the first tick is the very next tick after the close of the last bar, and gets around the primary backtest problem in Metatrader. (My understanding of the problem is that Metatrader "knows" the close of the current bar as soon as it opens.)

The next problem I noticed, looking at backtest charts, (after running a backtest you click on 'Open Chart' and LOOK) was that it often took a wrong (previous) direction trade AFTER the color (direction) of VQ had turned. Upon further investigation with MT’s deluxe debugging tool -uh, print statements- showed a 2 bar lag!! As I am not a professional coder, it took me a LONG time to solve this. Ultimately I commented out a couple lines in VQ that causes it to rewrite a couple datums in an earlier bar, and thus caused the 2 bar lag! These lines do not affect the core of VQ, only line color during the transition bar from Up to Down or the other way.

My own work convinced me it should only trade right after the VQ color changes, and that is how Kiko_v2 works now.

I have changed the variable names so I could follow the logic easier (in English, anyway).

Also the Trailing Stop was messing things up, I guess it wasn’t coded right, so I disabled it.
It now only exits on TP or SL.

I have stripped a lot of the code from VQ and from Kiko as they were either unneccessary for this purpose or actually causing a problem.

I have tried a lot of filters but I could not consistently improve above 39-48% win percentages, using straight TakeProfit and Stoploss settings.
The default settings are for GBPUSD H1. They are a compromise of best settings for different years. The Length setting makes a big difference. For example Length 7 instead of 5 will win bigger, but also lose bigger! (Length is how many bars back are averaged to be used as a basis for the volatility calculations.) TP and SL also matter.

IDEA: An automatically adjusting Length setting - but what do we base it on??

If you find settings that will work better, for ANY six month or one year period of a pair, over at least three years, let us know.
If you add an exit that improves results, do tell.
If you find an additional filter or two that improves the percentages consistently, let us know!

The Money Management does not work. If I get positive feedback I will fix that with a good one.

P.S. VQ has a lot of “bells and whistles”. Can someone explain how to use the MTF feature?


Enjoy!
Big Be

Corrections Feb. 5: changed code to call indicator correctly (Thanks mikerock!), added code to prevent taking trade if reverse arrow occurs when you would enter (rare).

This is for Jan. 1 to Nov. 30, 2007 and is not the best one:
Attached Images
File Type: gif Kiko_v2 2007 .4 A.gif (5.9 KB, 1391 views)
Attached Files
File Type: htm Kiko_v2 2007 .4 A.htm (96.1 KB, 228 views)
File Type: mq4 Kiko_v2_1.mq4 (5.3 KB, 312 views)
File Type: mq4 VQforEA.mq4 (5.3 KB, 313 views)

Last edited by Big Be; 02-24-2008 at 08:06 AM. Reason: Corrections
Reply With Quote