BUG REMOVAL & MODIFICATION ON RM ADVANCED COMBINED V2.0 Bug Removal Let me describe the bug first. After the EA is attached to a chart and if I want to change any of the settings by right click>Expert Advisor>Properties and after I made the changes and click OK, the EA would STOP trading and the only way that I could get it started again is to remove and to reattach the EA to the chart. Needless to say, this is very frustrating. I should be able to change the settings at any time that I want without affecting the on-going trade cycle. Please resolve this bug. The Modification To change the single Order Lot Size with a sequence of orders. The new EA shall be name as “RM G3 HA Chameleon v1.0”. (a) The Adjustable Parameters After the modification, the new EA shall have the following adjustable parameters (please note that I will primarily be trading the XAUUSD pair, so please code the given values as default): Previous Candle be Red/Green - Yes/No (default No) Order Sequence - (please see below) First Spacing - 300 Subsequent Spacing - 100 Universal TP in $$ - 100 Stop Loss in $$ (zero when not used) - 0 Virtual Stop Loss - 300 Magic Number - 801 Trade Comment - RM G3 HA Chameleon v1.0 Max Spread in points - 1000 (b) The Order Sequence Please code the following order sequence as default: 0.02,0.03,0.05,0.07,0.1,0.15,0.2,0.25,0.3 Please make sure that the last of the figure in the order sequence – in the above example would be 0.3 – will be continuously used by the EA for all subsequent orders beyond the last in the order sequence. Please also pay special attention on how the EA apply the order sequence (explained below). (c) How The EA Trades The present EA will only trade in one direction at a time following the Heiken Ashi (“HA”) indicator signal. However, whenever the HA signal for the present candle changes colour, the EA will immediately change the trade direction. For example, let’s say the HA was green when we first attached the EA to the chart. The EA will start a BUY cycle and after trading the buy cycle for a while, the HA signal for the current candle changed to red, so the EA will immediately stop the buy cycle and start a SELL cycle and so on and on and on and on……. It is very important to note in such a scenario that firstly, the EA does NOT close up all the previously opened buy orders, the EA will continue to monitor these opened buy orders while changing over to the sell cycle and the EA must take into account ALL of the opened orders (both buy and sell orders) in calculating the Universal TP or SL in $$. Secondly, whenever the EA changes direction, it must use the ‘First Spacing’ to issue the first virtual pending order. The new EA will maintain all the above, the only difference is the way the EA will apply the Order Lot Size. In the present EA, it apply a single constant order lot size. The new EA will implement an Order Sequence instead and apply a Martingale strategy in the following manner: Let’s continue with the example given above and use the default Order Sequence as stated above. When the EA started the buy cycle when it first attached to the chart (because the HA signal is green), the EA will apply the 1st level in the Order Sequence, namely, 0.02. And so long as there is no change of HA signal/direction, the EA will continue to apply the 0.02 lot size throughout that buy cycle. However, when the HA signal changed to red and the EA changes direction to the sell cycle, the EA must apply the next level in the Order Sequence, namely, 0.03. And so long as there is no change of HA signal/direction, the EA will continue to apply the 0.03 lot size throughout that sell cycle. But if there is another change of the HA signal back to green again, the EA must change direction and revert to buy again and must apply the next level, namely, 0.05 and so on and on and on….. It is vitally important to point out that the EA will only apply the next level in the order sequence when there are actual orders triggered during the previous cycle. Let’s say in the first buy cycle, no buy orders were triggered, so when the EA changes to the sell cycle following the HA signal, the EA must still apply the 1st level in the order sequence, namely, 0.02 and NOT 0.03. Another working example – let’s say there were 3 buy orders triggered in the first buy cycle and so when the EA changes to sell cycle, it must apply the 2nd level ie 0.03 but there were NO sell orders triggered and the EA changes back to the buy cycle following the HA signal – in such a scenario, the EA must revert back to 0.02 and must NOT use 0.03 because there was NO sell orders triggered for the 0.03 level. But of course, if there were actual 0.03 sell orders triggered, then the EA must apply the next level which is 0.05 when it reverts back to the buy cycle and so on and on and on and on…….. Bottom line is, there must be actual orders triggered in the previous cycle before the EA apply the next level in the order sequence. If there was no actual order triggered, the EA must continue to use the previous lot size level. Herein below I will describe the trade logic of the present EA, it is purely intended to assist you to understand the trade logic and it’s not part of the modification. Before attempting to modify the EA, I highly recommend you to first backtest it in ‘visual mode’ and attach the Heiken Ashi indicator on the visual mode backtest chart to observe how the trade logic of the EA is applied in order to grasp and understand how it works. THE TRADE LOGIC When the EA is turned on/attached to a chart, the EA will immediately start to trade following the HA signal and it will do the following: (a) mark the present price point as the Virtual Reference Point (‘vRP’). The EA will mark this vRP with a visible White Colour Line on the chart; (b) set the Virtual Stop Loss (‘vSL’) using the user pre-set value (with the vRP as the reference point) and mark the vSL with a visible Red Colour Line on the chart; and (c) issue the Virtual Pending Order (‘vPO’) using the user pre-set ‘First Spacing’ value (with the vRP as the reference point) and mark it with a visible Orange Colour Line on the chart. It is vitally important to point out at this juncture that there are two different spacings (First Spacing and Subsequent Spacing) which the EA will use under different circumstances – explained below. In the event that the price moves in our desired direction and triggers the vPO (turning them into real executed orders), the EA will do the following: (d) move the vRP (white colour line) to the present price point (where the vPO had just been triggered); (e) move the vSL to the new position with the new vRP as the reference point; and (f) issue a ‘subsequent’ fresh vPO with the new vRP as the reference point by applying the ‘Subsequent Spacing’. In the event that the price moves in the opposite direction than the desired direction and the vSL is hit, the EA will do the following: (g) move the vRP (white colour line) to the present price point (where the vSL had just been hit); (h) move the vSL to the new position with the new vRP as the reference point; and (i) issue a fresh vPO with the new vRP as the reference point by applying the ‘First Spacing’. All the white, red & orange lines will be visible at all times. It is important to point out that the EA does NOT close up any of the real executed orders when the vSL is hit. The real individual executed orders will only be closed in the following manner: (j) when the Universal TP or SL is hit; (k) when it is closed manually by the user; and (l) when it is closed by another EA. First Spacing & Subsequent Spacing Explained The ‘First Spacing’ is used under two circumstances: (m) when the EA is first started/attached to the chart; and (n) every single time when the vSL is hit. The only circumstance when the ‘Subsequent Spacing’ is used is when the previous vPO has been triggered into a real executed order and the ‘Subsequent Spacing’ will be used to issue the next vPO. END. 2 | Page