MQL4-TUTORIAL-PLATIN-SYSTEM-ACCUMULATION-DISTRIBUTION-OSCILLATOR

video
play-sharp-fill

 

 

 

In this video, we are going to create an entry module for this Oscillator here. 

 

It is called the accumulation distribution oscillator. Usually, Oscillators are used as filters, but in this video, we are going to create an MQL file to create an entry signal. 

 

So, let’s see how this is done.

 

The Accumulation Distribution Oscillator is shown on a separate chart below the candlestick chart.

 

It has a single signal line that indicates a value.

 

To use it, we need to make a separate MQ4 file in the same folder as the other Platinum System files.

 

The name of the file is CheckEntry_ I A D.mq4, and it only has one function called CheckEntry.

 

The buy and sell signals for our system are calculated by this function.

 

In fact, oscillators are usually not used to make signals, instead, they are used to filter other signals.

 

But that doesn’t mean we can’t use them, because all we need for our trading system is a clear signal that works.

 

We start by creating the signal string variable.

 

This will eventually be sent back to our main function, but first we need to make the signal.

 

That can be done with the builtin MQL4 function IAD.

 

We only need to provide three parameters.

 

The first one is for the current symbol on the chart.

 

The second parameter is for the period that we have selected on that chart.

 

Parameter three is for the candle.

 

We want to calculate the value for candle 0 and store it in a variable and we also calculate it for the candle 1 and store that in a different variable.

 

Now we are able to calculate the entry signal.

 

If the current value is bigger than the value for the last candle, we would consider that to be a buy signal.

 

Therefore we assign the word buy to our signal.

 

Otherwise if the current value is smaller than the last value, that would be a sell signal and then we assign the word sell to our signal.

 

Finally we want to return the calculated signal to the main module, therefore we use the return statement.

 

Please don’t forget to save your input file, but you don’t have to compile it right away.

 

Compilation is done in the main module, but before you do that, find the include statement for the input signal and change it to use our new file, CheckEntry_ I A D.mq4.

 

If you put two slashes at the beginning of a line, you can turn off other input modules.

 

After this, you can press F7 or click the Compile button to compile your main module and the entry signal file that we have included.

 

There shouldn’t be any mistakes.

 

If you do have mistakes, you might want to buy the premium course or watch one of the basic tutorial videos to learn how to do it.

 

Okay, if everything is okay, you should have a working version for the Accumulation distribution oscillator, now. 

 

As I said, you can use it as a filter, or use it as an entry signal in the Platin System or in your own system. 

 

Thank you for watching, and I will see you in the next video.