![]() ![]() ![]() Let’s copy the data for 3 candles and the result will be stored in our EA array (EAArray). That’s because arrays are zero based in MQL5 so the first item in an array is always called by calling the index zero. Now we use “CopyBuffer” to fill our Expert Advisor array (EAArray) according to the IOBV definition (IOBVDefinition) that we have created here for the first buffer… well, a buffer is in our case this line here, some Indicators have more than one buffer for example if I would “Insert/ Indicators/ Trend/ Bollinger Bands”, this one has three different lines, so it uses 3 buffers and the first buffers is always called buffer 0 (zero), the second buffer would be number one and so on. This is a very simple Indicator, we start by creating an array for the Expert Advisor (EAArray), this one will be a double array so it can hold floating type values, now we use “ArraySetAsSeries” to sort the array (EAArray) from the current candle downwards and to define the Onbalance Volume we use the included function that is called: “iOBV”, so let’s mark that and press F1, here we see that it uses the current symbol on the chart, the currently selected period on the chart and the third parameter is called: applied volume so let’s click on this link and we see that we could use the tick volume or the real volume. Now you can delete everything above the “OnTick” function and let’s also remove the two comment lines here. ![]() To do that please click on a little button here or press F4 in your Metatrader, now you should see the Metaeditor window and here we click on: “File/ New/ Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleIOBValue”, click on “Continue”, “Continue” and “Finish”. Investopedia (says that the Onbalance Volume should show us that whenever the Indicator increases without a significant price change the price should follow and now we are going to find out how to automate the Onbalance Volume Indicator in MQL5. In this video we are looking at this little Indicator, it’s the Onbalance Volume Indicator. Copy and paste this HTML code into your webpage to embed. ![]()
0 Comments
Leave a Reply. |