Hi all,

As a certain renko system turned down my help recently, I have time to hunt for new systems to help code EAs for and this one caught my eye due to its simplicity and the positive dynamics of it's participants.

Anyway, I made an EA for this method just now but since trading is now closed, I've not had a chance to fully test it. I thought more can help out with the testing process so I'm sharing it here since there seems to be interests.

Inputs Explanation

EA_MAGIC_NUM = 3947947

Every trade opened by this EA will have this number tagged to it so that it doesn't manage the wrong trades that're opened by other EAs, keep this unique. If you want to attach the EA to other charts using the same account, use a different number.

IsECN = true

If you set this to True, it will open trade with no SL and TP then immediately modify it to add in the SL and TP. This is necessary for ECN-like brokers. set it to false and it will sent all info at one go. If in doubt, leave this as true.

CheckHourOfAttach = true

If this is set to true, EA will be disabled if you attach it at the hour of the sessions' open. This is to prevent taking wrong trades. See it as a failsafe. Always attach the EA at an hour other than the predefined open session hour. That way, the EA will be "waiting" for the session open and not the other way round.

Session1 = "London Session"
SessionOpenHour1 = 8
Session2 = "New York Session"
SessionOpenHour2 = 13

These are the session timings in accordance to GMT 0. check with your broker what is your GMT offset and make the changes accordingly.

GraceMinutes = 5

When a session opens, it will look for opportunity to buy or sell for this amount of minutes. the logic is that if price hasn't moved for 2 pips in 5 minutes. something is terribly wrong and we should avoid trading.

Show_Comments = true

This is to toggle the display on the top left corner of your chart. Useful info about the EA is being displayed there if this is set to true.

UserDefinedSpread = 0

till now, I still don't understand the logic of this setting but it was something that's requested by my past clients and so I left it in. Basically, you get to set the spread that the EA will work with. if you want to EA to use market spread (which sounds more logical), keep this as 0.

Slippage = 3

Self explanatory.

Pip_Distance = 2

The amount of pip movement from the open price for the EA to trigger a trade.

TakeProfit = 140

Self explanatory

StopLoss = 5

I didn't set this as 2 by default because so MT4 brokers restricts a minimum stop loss of 5 pips. try setting it lower if you want but I'm not sure if the order will get through.

UseFloatingStop = false
UseJumpingStop = false
TrailingStop = 0

This is the trailing stop mechanism that's built into all my EAs, a bit hard to explain. basically my trailing stop has 2 modes. Floating stop means the stop loss level move in pip by pip together with the market price. while Jumping stop takes leaps. Some like the former for its profit locking, others like the latter cos it gives the trade more breathing space. Anyway, this strategy did not mention the use of trailing stop so I set it to be off by default.

Add_Spread_To_StopLoss = false

Self explanatory.

Use_Spread_Filtering = true
Spread_Filter = 1.0

If spread is more than the said amt of pips, no trade will be opened.

MoneyManagement = true
RiskPercent = 0.25
UseEquity=false

This opens trades with position size according to the percentage of risk and stop loss amt you're willing to take. in this case, if a trade goes sour, you will lose 0.25 percent of your balance. The UseEquity setting flips this method upside down by using your amount of equity to decide how much to open. if it's set to true, it will use 0.25 percent of your total equity to calculate how big a position size you can open (disregard stop loss level, so potential for huge losses/gains).

Use_BE=true
BreakEven_Pips=5.0

If price has moved in your favor for said amt of pips, move the SL level to break even.

FixedLots = 0.1

this only comes into play if you set MoneyManagement to false.

MaxLots = 15.0
MinLots = 0.01

the EA checks all calculated lot size according to these settings.

LotsDecimalAllowed = 2

again with the lot size handling. If your broker cannot handle micro lots, please set it to 1 and the EA will round up/down the calculated lot size accordingly.


Other features

Inputs Validation

The EA won't run if there's invalid info given in the inputs, e.g. session hour set to 26 (no such hour, EA won't run). You'll get an alert message telling you what you've keyed wrong. If more validations are required, please tell me and I can add it in. This is to reduce silly mistakes. I'm a firm believer of murphy's law.

Log files

The EA writes logs of important info into text files that can help in debugging potential issues. they can be found in your
[MetaTrader Installation folder]\experts\files folder

Each day and each currency pair creates a new file. the naming convention will be CBBP-[Currency Pair Symbol]-[DD]-[MM]-[YYYY].log

Fractional Pips handling

The EA should be able to handle 5 digit and 3 digit brokers with no issues.

ECN ready

As described earlier.
___________________

It kinda sound like a sales pitch doesn't it but I assure you its not... anyway the source code is attached. So there you have it. My first EA after more than a year away from forex and FF.

Note that I've not coded MQL in a long time and this EA is kinda like a Frankenstein's monster of my past works so don't test it in live account straightaway.

Happy trading to all.
