(Hmm, that thread just got deleted and all that good stuff is now in the bin. Shame on Forex Factory).
The owner of the thread would like to keep it 'pure', so this thread is a companion thread that takes the pure system and suggests improvements or alternative ways of working. Hopefully we can come up with a new system that enhances the current one.
Everyone is welcome to discuss the IB technique. In particular, it would be interesting to hear what works, and doesn't work, for you.
Ultimately, my personal goal is to create an EA that can work based upon the IB technique.
Attached is the latest EA. I'll always place it in the first post from now on.
These are the properties in the EA and the defaults.
// The Magic Number used to identify our trades.
extern int magicNumber = 20081224091300;
// Print the programs debug comments.
extern bool Debug_Mode = false;
// The lot size used in each trade. MUST be a multiple of TWO.
extern double LotSize =0.02;
// ATR Period, 40 might be good on EURUSD
extern int ATRPeriod = 20;
// The maximum number of bars that we will look back to find a recent IB. Includes the two bars forming the IB.
extern int MaxBars = 6;
// ** The maximum size of Outer/Containing IB bar. Keep it high, works better.
extern int MaxIBSize = 6000;
// ** The minimum size of Outer/Containing IB bar.
extern int MinIBSize = 100;
// ** The maximum deviation allowed when we open an order. This avoids opening a trade when price jumps between ticks.
extern int MaxStart = 40;
// The TP profit factor. If this is 2, then the TP will be doubled, etc. Higher this is the more losers you'll get.
extern int TPFactor = 1;
// The minimum volume required for us to trade. Doesn't seem to affect trade win ratio
extern int MinVolume = 6;
// ** The number of PIPs that our InsideBars are offset from trigger IB.
extern int BarOffset = 30;
// True if we want to only trade long when above daily pivot and short below it.
extern bool UsePivotIndicator = false;
// Do we want to follow trends or just fixed TP.
extern bool TrailTrends = true;
// What factor of ATR we want to trail trends with
extern double TrailATRFactor = 0.5;
// ** The minimum value that the ATR should return; Determines min TP.
extern int MinATR = 10;
// Do we want to use the external indicator
extern bool UseExternalInd = false;
// Stick anything in here and it will be passed to the external indicator.
extern string ExtIndParams = "Params for external indicator";
// True if we want to use the Inner Bar for breakout, rather than the traditional Outer Bar
extern bool UseIBForBreakout = false;
// True if we want to ignore the first IB breakout and only take the subsequent ones.
extern bool IgnoreFirstIBBreak = false;
// Trail the SL with price changes before the first TP has happened.
extern bool UseTrailingSL = true;
// True if we want to use Stochiastic measure
extern bool UseStoch = false;
// The value of the Stochastic offset (used to determine the upper SELL and lower BUY bands)
extern int StochOffset = 20;
// Trading Hours by day - See attached spreadsheet for calculation of this.
// Uses the BAR time.
extern int TradingHoursSunday = 16777215;
extern int TradingHoursMonday = 16777215;
extern int TradingHoursTuesday = 16777215;
extern int TradingHoursWednesday = 16777215;
extern int TradingHoursThursday = 16777215;
extern int TradingHoursFriday = 16777215;
extern int TradingHoursSaturday = 16777215;
Anything with ** in the comments needs to be adjusted for brokers that use 4 digits and not 5. (Divide by 10 for 4 digit brokers)
There is a generic interface that allows you to write your own code that will help the EA decide whether a trade is valid or not.
To get started:
- Put the attached IBTrader EA in the experts directory of your MetaTrader installation.
- Put both IBTrader-Ind files in the experts\libraries directory of your MetaTrader installation.
- Restart MetaTrader and you're off.
To create your own indicators you will need to edit the IBTrader-Ind.mq4 file and add your own logic. An example RSI indicator is included. If your indicator needs parameters then you can pass them into the indicator through the EA string property ExtIndParams. You will, of course, need to parse the string if you have multiple parameters.
Make sure that the EA property UseExternalInd is set to true otherwise your new routine will not be called.