In today’s short video we shall trade with the Accumulation Distribution Indicator which you see on the chart. It is an oscillator and we shall receive a buy or a sell signal based on the Indicator’s value. Let’s add some speed here and we can notice its generating profit. Okay, so let’s see how we can code this Expert Advisor which will execute trades based on the signals. Let’s begin the code by starting the Metaeditor so please click the little button here or hit the F4 key in your Metatrader. In the Metaeditor please click on “File/ New/ Expert Advisor (template)” from template, click on “Next”, let’s name our file as: “CheckEntry_IAD” and this is the file we are going to call in the main module. Click on “Next”, “Next” again then “Finish”. Please remove all the things above the “OnTick” function and the two comment lines as well. In most cases we use the “OnTick” function because we want to call it based on a new thick, a new tick is generated with each price change on our chart. Now we continue our code by creating the signal, we start with a new check entry (CheckEntry) function which is a string variable and I shall use it in my main module. My main module is the Forex Trading Framework; it is the German version for MQL4. I haven’t finished the English version yet but you can use your own main module or download the Forex Trading Framework from my website which soon will be available. Let’s get back to the check entry (CheckEntry) function. So the first thing we code is the string variable for the signal. We name it as “Signal” to keep our code clean and simple to read. We do not add any value to it because that will be done later. Next we define the IAD value (IADValue), for that purpose we use the MQL4 function: “iAD” which comes with MQL4. Let’s highlight it and press F1 on the keyboard. Now you can read that the “iAD” calculates the Accumulation Distribution Indicator and returns the calculated values. It needs 3 parameters: the symbol, the period and the shift. The symbol is the currency pair which is actually in your chart, the period is the time frame sat on your chart. Now we have a 1 minute chart here but this could be 5 minutes or 15 minutes, etc. The shift would move the Indicator to the left or the right. In our simple example here we say we get a sell signal when the “IADValue” goes above the zero line and then we assign the word: “sell” to the signal. If the opposite happens and the “IADValue” drops below the zero line then we get a buy signal so we assign the word: “buy” to the signal. Our final step is to return the signal to the main module (the Forex Trading Framework) by the function called: “return”. After all we call the check entry (CheckEntry) function here so it can return the value for the signal. The entry module needs not to be compiled but saved only so please click on “Save”. However the main module needs to be compiled so please click the “Compile” button here or press F7 in your keyboard. Good, we got no errors or warnings; let us return into Metatrader by clicking here or pressing the F4 key. When inI Metatrader we shall make a simple trick, click on “Insert/ Indicators/ Volumes/ Accumulation Distribution”, let’s just use the standard values, click “OK” you can see the Indicator below the candles. Okay, now let’s do a right mouse click in the template here, we select “Template/ Save Template” then save it with a name: “tester.tpl” and this way the back-tester will display our desired template when running in visual mode. Let’s open the “Strategy Tester” so we can start a test. Please click on “View/ Strategy Tester” or use the shortcut (press CTRL + R), here I select my main module the Forex Trading Framework and you need to use your own main module. Let us not forget to enable the visual mode then click on “Start”. Our little Expert Advisor is right here and running, we could increase the speed as well. In this short video you just learned how to code an Expert Advisor which can exec...