MQL5 TUTORIAL SIMPLE IVIDYA STANDALONE EXPERT ADVISOR

Опубликовано: 01 Январь 1970
на канале: MQL5 Tutorial
456
14

https://mql5tutorial.com/?s=standalone

Introduction to IVIDYA Standalone Expert Advisor (00:00 - 00:02)

Introduction to creating an Expert Advisor for the Variable Index Dynamic Average Indicator.
Understanding the IVIDYA Indicator Signals (00:02 - 00:26)

Explanation of the IVIDYA Indicator, where the red line above the price indicates a sell signal, and below the candles indicates a buy signal.
Creating the Expert Advisor in MetaEditor (00:26 - 01:01)

Steps to create a new Expert Advisor in MetaEditor, including file naming and setup.
Setting Up the Expert Advisor (01:01 - 01:30)

Instructions on including necessary files and creating an instance of the CTrade class for opening positions.
Calculating Ask and Bid Prices (01:30 - 01:49)

Calculating the Ask and Bid prices using SymbolInfoDouble and NormalizeDouble functions.
Preparing Signal Calculation (01:49 - 02:07)

Creating a string variable for the signal and preparing for its calculation.
Setting Up Price and Expert Advisor Arrays (02:07 - 02:47)

Creating and sorting price and Expert Advisor data arrays for the IVIDYA function.
Defining the IVIDYA Function (02:47 - 03:17)

Defining the IVIDYA function with parameters for the current symbol, period, and other settings.
Filling the EA Array with IVIDYA Data (03:17 - 04:10)

Using CopyBuffer to fill the EA array with data based on the IVIDYA definition.
Calculating the Current IVIDYA Value (04:10 - 04:32)

Calculating the current IVIDYA value for the signal determination.
Determining Buy and Sell Signals (04:32 - 05:02)
Logic for determining buy and sell signals based on the IVIDYA value and close price.
Executing Trades Based on Signals (05:02 - 05:29)
Executing sell or buy trades based on the calculated signals.
Displaying the Current Signal on the Chart (05:29 - 05:44)
Creating a chart output to display the current signal.
Compiling and Testing the Expert Advisor (05:44 - 06:41)
Instructions on compiling the Expert Advisor and testing it in MetaTrader.

In this video we are going to create an Expert Advisor to calculate this Indicator; it’s the Variable Index Dynamic Average, whenever the red line is above the price that would be a sell signal and in the other case when the red line is below the candles – like here – that would be a buy signal.
Now how can we create an Expert Advisor that is going to actually trade our signal and output our buy and sell signals directly on the chart?
To do that please click on the little button here or press F4 on your keyboard and now you should see the Metaeditor window and here you want to click on: “File/ New/ Expert Advisor (template)” from template, I will call this file: “SimpleIVIDYAStandaloneEA”, click on “Continue”, “Continue” and “Finish”.
Now we can remove everything that is above the “OnTick” function and let’s also delete the two comment lines here.
We start by including the file: “Trade.mqh”. Sometimes people ask me where the file is?
Well, it’s included in MQL5 and we can create an instance of the class: “CTrade” that will be called: “trade” and we are going to use it later on to open positions.
Inside of the “OnTick” function we are going to calculate the Ask price and the Bid price. We get the prices by using “SymbolInfoDouble”, we use “SYMBOL_ASK” to calculate the Ask price and “SYMBOL_BID” to calculate the Bid price.
With “NormalizeDouble” and “_Digits” we calculate the number of digits behind the dot.
Let’s create a string variable that will be called: “signal” and we are going to calculate the signal value later on so we don’t assign a value right now.
We also need to create a price array (PriceArray) that is done by using “MqlRates”, lets sort the array from the current candle downwards by using “ArraySetAsSeries” and with “CopyRates” we fill our array (PriceArray) with price data for the current symbol on the chart and the currently selected period, we are going to start from the current candle 0 (zero) and we need the price for 3 candles – that’s for the prices.
Now we need to create an array for the Expert Advisor data that will be called: “EAArray”, let’s also sort that one by using “ArraySetAsSeries”.
Now we actually can define the Expert Advisor by using the integrated “iVIDyA” function. If you mark that one and hit F1 you will see all the parameters for the Variable Index Dynamic Average Indicator, it has only one buffer and the parameters are: the current symbol on the chart, the currently selected period on the chart, here we have a 9, a 12 and a 0 (zero) – so let’s click on: “Insert/ Indicators/ Trend/ Variable Index Dynamic Average” and you will see that we have a “Period CMO:” that is 9, the “Period EMA:” that is 12 and the “Shift:” value of 0 (zero) and that’s exactly what we use here and the value will be calculated based on the close price (PRICE_CLOSE).


Смотрите видео MQL5 TUTORIAL SIMPLE IVIDYA STANDALONE EXPERT ADVISOR онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MQL5 Tutorial 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 456 раз и оно понравилось 14 людям.