Inside Bar Trading Revisited - MT4/MT5 Resources
An interesting technique is used in the thread here where it describes the system of trading using Inside Bars on the 30M chart.
( Well, that post was just deleted and all the good stuff is now in the trash. Shame on the FX factory ).
The owner of the thread wants to keep it "pure", so this thread is a companion thread that takes a 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 IB technology. In particular, it would be interesting to learn what works for you and what doesn't.
Ultimately, my personal goal is to create an EA that can run on IB technology.
====
Attached is the latest EA. I'll make it the first post from now on.
These are the properties and default values in the EA.
// The magic number used to identify our transactions.
extern int magicNumber = 20081224091300;
//Print program debugging comments.
external boolean debugmode = false;
// Lot size used for each trade. Must be a multiple of 2.
External double lot size=0.02;
// ATR period, 40 may be beneficial for EURUSD external int ATRPeriod = 20;
// We will look back to find the maximum number of recent IB bars. Includes two columns forming IB.
extern int MaxBars = 6;
// ** Maximum size of outer/containing IB bars. Keep the level high and the results will be better.
External integer MaxIBSize = 6000;
// ** Minimum size of outer/containing IB columns.
external int MinIBSize = 100;
// ** The maximum deviation allowed when we open an order. This avoids taking trades when the price jumps between ticks.
external int MaxStart = 40;
// Target price profit factor. If it is 2, then TP will be doubled and so on. The higher this value, the more losers you will get.
external int TPFactor = 1;
// The minimum volume required for our trade. Doesn't seem to affect trade win rate
extern int minimum volume = 6;
// ** Our InsideBar and the number of PIPs that trigger the IB offset.
external int BarOffset = 30;
// True if we only want to place long trades above the daily pivot and short trades below it.
extern bool UsePivotIndicator = false;
// Do we want to follow the trend or just fix the price target.
extern bool TrailTrends = true;
// What ATR factor do we want to use to track the trend external double TrailATRFactor = 0.5;
// ** The minimum value that ATR should return; determine the minimum TP.
external int MinATR = 10;
// Do we want to use external indicators?
extern bool UseExternalInd = false;
// Paste anything here and it will be passed to the external indicator.
extern string ExtIndParams = "External indicator parameters";
// True if we want to use the inner bar for the breakout instead of the traditional outer bar
extern bool UseIBForBreakout = false;
// True if we want to ignore the first IB breakout and only take subsequent breakouts.
extern bool IgnoreFirstIBBreak = false;
// Track SL and price changes before the first TP occurs.
extern bool UseTrailingSL = true;
// true if we want to use random metrics
extern bool UseStoch = false;
// The value of the random offset (used to determine the upper limit of the selling range and the lower limit of the buying range)
external int StochOffset = 20;
// Daily Trading Hours - Please see attached spreadsheet for calculations.
// Use BAR time.
extern int Sunday trading time = 16777215;
extern int TradingHoursMonday = 16777215;
extern int TradingHoursTuesday = 16777215;
extern int TradingHoursWednesday = 16777215;
extern int TradingHoursThursday = 16777215;
extern int TradingHoursFriday = 16777215;
extern int Saturday trading time = 16777215;
For brokers using 4 digits instead of 5 digits, anything with a ** in the note will need to be adjusted. (For 4-digit brokers, divide by 10)
====
There is a common interface that allows you to write your own code that helps the EA decide whether a trade is valid or not.
Get started:
( Well, that post was just deleted and all the good stuff is now in the trash. Shame on the FX factory ).
The owner of the thread wants to keep it "pure", so this thread is a companion thread that takes a 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 IB technology. In particular, it would be interesting to learn what works for you and what doesn't.
Ultimately, my personal goal is to create an EA that can run on IB technology.
====
Attached is the latest EA. I'll make it the first post from now on.
These are the properties and default values in the EA.
// The magic number used to identify our transactions.
extern int magicNumber = 20081224091300;
//Print program debugging comments.
external boolean debugmode = false;
// Lot size used for each trade. Must be a multiple of 2.
External double lot size=0.02;
// ATR period, 40 may be beneficial for EURUSD external int ATRPeriod = 20;
// We will look back to find the maximum number of recent IB bars. Includes two columns forming IB.
extern int MaxBars = 6;
// ** Maximum size of outer/containing IB bars. Keep the level high and the results will be better.
External integer MaxIBSize = 6000;
// ** Minimum size of outer/containing IB columns.
external int MinIBSize = 100;
// ** The maximum deviation allowed when we open an order. This avoids taking trades when the price jumps between ticks.
external int MaxStart = 40;
// Target price profit factor. If it is 2, then TP will be doubled and so on. The higher this value, the more losers you will get.
external int TPFactor = 1;
// The minimum volume required for our trade. Doesn't seem to affect trade win rate
extern int minimum volume = 6;
// ** Our InsideBar and the number of PIPs that trigger the IB offset.
external int BarOffset = 30;
// True if we only want to place long trades above the daily pivot and short trades below it.
extern bool UsePivotIndicator = false;
// Do we want to follow the trend or just fix the price target.
extern bool TrailTrends = true;
// What ATR factor do we want to use to track the trend external double TrailATRFactor = 0.5;
// ** The minimum value that ATR should return; determine the minimum TP.
external int MinATR = 10;
// Do we want to use external indicators?
extern bool UseExternalInd = false;
// Paste anything here and it will be passed to the external indicator.
extern string ExtIndParams = "External indicator parameters";
// True if we want to use the inner bar for the breakout instead of the traditional outer bar
extern bool UseIBForBreakout = false;
// True if we want to ignore the first IB breakout and only take subsequent breakouts.
extern bool IgnoreFirstIBBreak = false;
// Track SL and price changes before the first TP occurs.
extern bool UseTrailingSL = true;
// true if we want to use random metrics
extern bool UseStoch = false;
// The value of the random offset (used to determine the upper limit of the selling range and the lower limit of the buying range)
external int StochOffset = 20;
// Daily Trading Hours - Please see attached spreadsheet for calculations.
// Use BAR time.
extern int Sunday trading time = 16777215;
extern int TradingHoursMonday = 16777215;
extern int TradingHoursTuesday = 16777215;
extern int TradingHoursWednesday = 16777215;
extern int TradingHoursThursday = 16777215;
extern int TradingHoursFriday = 16777215;
extern int Saturday trading time = 16777215;
For brokers using 4 digits instead of 5 digits, anything with a ** in the note will need to be adjusted. (For 4-digit brokers, divide by 10)
====
There is a common interface that allows you to write your own code that helps the EA decide whether a trade is valid or not.
Get started:
- Place the additional IBTrader EA into your MetaTrader installation directory.
- Place the two IBTrader-Ind files into the Expert\Library directory of your MetaTrader installation.
- Just restart MetaTrader.
To create your own indicator, you need to edit the IBTrader-Ind.mq4 file and add your own logic. An example of the RSI indicator is included. If your indicator requires parameters, then you can pass them to the indicator via EA string properties as external input parameters . Of course, if there are multiple parameters, you will need to parse the string.
Make sure that the EA property Use External Index is set to true otherwise your new routine will not be called.
























Original post attachment (5)
📦 Summary of post attachments (34)
Below are all the files (34) shared in the reply.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •