https://mql5tutorial.com
In this video, we want to check out this Oscillator here. It is called the Stochastic oscillator, and it is very popular. So let's find out how we can create an entry signal for this one with MQL5.
Introduction to DeMarker Oscillator (00:00 - 00:13)
Introduction to the DeMarker Oscillator, explaining its purpose and how it's used in trading.
Understanding the DeMarker Oscillator Interface (00:13 - 00:27)
Overview of the DeMarker Oscillator's appearance on the chart, including its scale and lines.
Using Oscillators for Entry Signals (00:27 - 00:34)
Explanation of how oscillators like the DeMarker can be used to generate entry signals.
Setting Up the MQ5 File (00:34 - 00:43)
Instructions on creating a separate MQ5 file for the DeMarker Oscillator in the Platin System.
Function of the CheckEntry iDEMARKER MQ5 File (00:43 - 00:55)
Description of the CheckEntry iDEMARKER MQ5 file and its role in determining entry signals.
Preparing the Signal Variable and Price Array (00:55 - 01:05)
Setting up a string variable for the signal and a price array to hold floating type values.
Defining the DeMarker Oscillator in MQL5 (01:05 - 01:15)
Using the iDEMARKER function in MQL5 to define the oscillator with specific parameters.
Configuring Parameters for the DeMarker Oscillator (01:15 - 01:26)
Setting the chart symbol, period, and the number of candles for the DeMarker Oscillator calculation.
Sorting and Filling the Array with Data (01:26 - 01:38)
Sorting the array from the current candle downwards and filling it with data using CopyBuffer.
Determining the Current Candle's Value (01:38 - 01:49)
Calculating the current candle's value in the array and formatting it with Normalize Double.
Criteria for Buy and Sell Signals (01:49 - 02:09)
Establishing criteria for buy signals (value below 0.3) and sell signals (value above 0.7).
Returning the Signal to the Main Module (02:09 - 02:20)
Sending the calculated signal back to the main module using the return command.
Saving and Compiling the MQ5 File (02:20 - 02:31)
Reminder to save the MQ5 file and instructions on compiling it in the main module.
Including the New File in the Main Module (02:31 - 02:44)
Adding the new file to the include statements in the main module and compiling both files.
Conclusion and Practical Application (02:44 - 03:01)
Closing remarks on the successful compilation and the practical use of the DeMarker Oscillator.
In this video, we're going to make an entry signal for this little oscillator that an expert advisor can use. It's called the "Stochastic oscillator," and a lot of people use it. So let's find out how MQL5 can help us do that.
The Stochastic oscillator is shown in a separate window below the candle chart.
It has two lines and a scale.
Most of the time, oscillators are used to filter out signals, but they can also be used to make entry signals, which is what we'll do here.
To use it, we make a separate MQ5 file and put it in the same folder as the other Platin System files.
The file is called CheckEntry Stochastic.mq5, and it has only one function called CheckEntry.
It will figure out what our entry signal is and send that information back to the main module.
We want to make a string variable for the calculated signal, but we won't give it a value yet because that will be worked out later.
Now we need two double-type arrays to hold the different prices.
The first one is called the K-Array and the second one is called the D-Array.
We sort both arrays from the current candle downwards by using Array set as Series.
MQL5 comes with a function called iStochastic which we can use to create a definition for our oscillator.
We need to pass a few parameters. The first parameter is for the symbol on the chart. The second parameter is for the period on the chart.
Parameters 3, 4 and 5 are the standard values for the Stochastic oscillator to define the so-called K-period, the D-period and the slowing. You will also see these values when you drag the Stochastic indicator onto one of your charts.
In the last two parameters, we define that we want to use MODE_SMA which stands for the simple moving average mode and we want to calculate the result based on the low and high prices.
With CopyBuffer we fill both arrays with data and we do that for buffer 0 and buffer 1. In both cases from the current candle 0 and for 3 candles.
Let’s continue and calculate the value for the current candle by looking at the value of candle 0 in both arrays.
Afterwards we do the same for the candle before by looking at the values for candle 1 in both arrays.
To calculate the buy signal, we check for a crossover.
So if the K-value and the D-value for candle 0 are below 20, we want to know if the K-value is now above the D-value and if it was below for the candle before.
That would be a buy signal and that is when we assign the word buy to our signal.
Смотрите видео MQL5 TUTORIAL - PLATIN SYSTEM - DEMARKER OSCILLATOR онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MQL5 Tutorial 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 433 раз и оно понравилось 14 людям.