Podcasts about metaeditor

  • 3PODCASTS
  • 458EPISODES
  • 6mAVG DURATION
  • 1MONTHLY NEW EPISODE
  • Dec 15, 2024LATEST

POPULARITY

20172018201920202021202220232024


Best podcasts about metaeditor

Latest podcast episodes about metaeditor

MQL5 Tutorial
MQL5 Tutorial – How to simply adjust user input with MQL5

MQL5 Tutorial

Play Episode Listen Later Dec 15, 2024 1:51


  Introduction to Enhancing a Simple Expert Advisor (00:00 – 00:07) Introduction to improving a simple expert advisor by allowing user adjustments, following the results of a year-long test. Reviewing the Year-Long Test Results (00:07 – 00:19) Overview of the test results: 73 trades made, with 54 short trades and 19 long trades, and the lack of adjustable inputs. Enabling User Adjustments for Lot Size (00:19 – 00:30) The goal to enable users to adjust the lot size of trades, which is currently hard-coded in the source code. Modifying the Expert Advisor to Include Input Variables (00:30 – 00:43) Steps to modify the expert advisor to include input variables, specifically for adjusting the lot size. Creating a Dynamic Input Variable for Lot Size (00:43 – 00:56) Instructions on creating a dynamic input variable for lot size, allowing it to be changed by the user. Replacing Fixed Lot Size with the New Variable (00:56 – 01:03) Replacing the fixed lot size in the code with the new variable and saving the changes. Compiling the Code and Testing the New Feature (01:03 – 01:17) Compiling the updated code and testing the new feature in Metatrader, with visualization enabled. Observing the Adjustable Lot Size in Action (01:17 – 01:28) Observing the first trade with the new adjustable lot size and stopping the test to change the input. Changing the Lot Size and Testing Again (01:28 – 01:43) Adjusting the lot size to a different value and testing again to demonstrate the flexibility of the new input feature.   In one of our other videos we have created a simple buy trade system and this is the result of a whole year. It made seventy three trades, fifty four were short trades and nineteen were long trades. You see under the input tab we have absolutely no values here so we cannot set anything that is not hardcoded in our source code. Now we want the user to be able to adjust the Lot Size of a trade here, to do that we simply click on Simple Buy Trade and click Modify. This is how our short E.A. looks like and this is the Lot Size. To create a dynamic value that can be changed by the user you have to make it an input variable and will be a double variable, and we will call it MyLotSize. Let’s assign ten Micro Lot here, copy the name and exchange the fixed ten Micro Lot Size here with our new variable. I will save it as Simple Buy Trade with input. Let’s compile the code and hit F4 to bring up the Meta Trader. I will select the system here, check the visualization option and start the test. This is our first trade and its ten Micro Lot. Let’s stop the test, go to inputs and change it to 0.2, now it is 20 Micro Lot. If you make something adjustable by the user, you can do it by making it an input. Afterwards the value can be simply changed without recompiling the code. The post MQL5 Tutorial – How to simply adjust user input with MQL5 appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 46 SIMPLER COMMODITY CHANNEL INDEX Expert Advisor

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 8, 2024 7:13


In diesem Video wollen wir uns einmal diesen Oszillator hier anschauen. Das ist der Commodity Channel Index. Der wird normalerweise als Filter genutzt. Wir wollen jetzt aber mal schauen, wie man den in MQL5 als Signal programmieren kann. Um das zu tun, klicken Sie bitte im Metaeditor bitte auf dieses kleine Symbol hier oben oder drücken Sie die F4 Taste. Das ruft dann hier den Metaeditor auf. Und hier klicken wir auf Datei, Neue Datei, Expert Advisor aus Vorlage, Weiter. Ich vergebe hier einmal den Namen SimplerCommodityChannelIndexEA, klicke auf Weiter, Weiter und Fertigstellen. Jetzt kann alles oberhalb der OnTick Funktion hier gelöscht werden. Und wir entfernen auch die zwei Kommentarzeilen. Wie so oft starten wir hier mit einem include Statement für die Datei Trade.mqh. Danach erstellen wir eine Instanz von der Klasse CTrade. Die bekommt den Namen trade. Und wir werden sie verwenden, um Positionen zu eröffnen. In der OnTick Funktion ermitteln wir zunächst den Ask Preise. Das übernimmt die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Mit SYMBOL_ASK, alles in Großbuchstaben bitte, lässt sich hier der Ask Preis ermitteln. Und zusätzlich nutze ich noch NormalizeDouble und _Digits, um die richtige Anzahl von Nachkommastellen zu ermitteln. Das können je nach Währungspaar drei oder fünf Nachkommastellen sein. Das gleiche wiederholen wir jetzt nochmal für den Bid Preis. Hier unterscheidet der Name der Variable und der Parameter hier heißt SIMBOL_BID. Ansonsten sind diese beiden Zeilen nahezu identisch. Mit MqlRates erstellen wir uns ein Array für die Preisinformationen. Das wird im Anschluss mit ArraySetAsSeries von der aktuellen Kerze an abwärts sortiert. Und mit CopyRates füllen wir unser Preis Array mit Preisdaten für drei Kerzen. Dieser Ausdruck für das aktuelle Währungspaar kann auch so geschrieben werden. Seit einiger Zeit wurde die Sprache entsprechend angepasst. Wenn man das hier mal markiert und die F1 Taste drückt, dann wird das in der Hilfe hier auch so beschrieben. Im nächsten Schritt erstellen wir uns eine leere Variable mit dem Namen signal. Die ist vom Typ string, hat hier aber noch keinen Wert. Um den zu ermitteln erstellen wir uns ein weiteres Array für den Expert Advisor. Und mit der eingebauten MQL5 Funktion iCCI können wir jetzt für das aktuelle Währungspaar und die auf dem Chart ausgewählte Zeiteinheit den Commodity Channel Index für 14 Kerzen aufgrund der Schlusskurse berechnen. Die 14 taucht auch hier in Klammern auf. Und wenn man einmal mit der rechten Maustaste auf den Oszillator klickt und Eigenschaften auswählt, dann sieht man, dass das hier die Standardwerte sind. Auch dieses Array sortieren wir von der aktuellen Kerze an abwärts. Und im Anschluss nutzen wie CopyBuffer, um anhand der Definition, die wir hier oben getroffen haben, für Buffer null, das ist diese Linie hier, von der aktuellen Kerze null an für drei Kerzen unser Array mit Daten zu füllen. Und das ermöglicht es uns, den aktuellen Wert für den Commodity Channel Index zu berechnen, indem wir auf Kerze null in unserem Array zugreifen. Wenn sich der Wert oberhalb der Einhunderter-Linie befindet, das wäre hier die obere gestrichelte Linie, dann möchten wir gerne verkaufen. Darum weisen wir den Wert Verkaufen unsere signal Variable hier zu. Im umgekehrten Fall, wenn der Wert kleiner ist und sich unter der unteren gestrichelten Linie befindet, das wäre hier diese minus einhundert Linie, dann möchten wir gerne kaufen und weisen diesen Wert der signal Variable zu. Und wenn unser signal auf Verkaufen steht und die Funktion PositionsTo...

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Bulls Power Expert Advisor

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Mar 2, 2024 5:20


Das hier ist der sogenannte Bulls Power Indikator. Es handelt sich hierbei einen Oszillator, der anzeigen soll, wie stark die Bullen sind. Man sagt ja, dass im Trading jeden Tag die Bullen gegen die Bären kämpfen und bei maximalen Ausschlägen kann man davon ausgehen, dass hier nach den höchsten Werten der Preis erst mal in den Keller geht. Im Umkehrschluss, wenn diese Linie hier überschritten wird, dann geht es in der Regel erst mal aufwärts. Dieser Oszillator hier wurde erstellt von einem professionellen Trader mit dem Namen Alexander Elder. Er sagt hier, dass ein fallender Wert über null ein Signal zum Verkauf ist. Der Oszillator wird auf 13 Kerzen berechnet. Man nutzt einen exponentiellen Moving Average und es wird empfohlen, den Bulls Power Indikator zusammen mit einem anderen Trend Indikator, wie zum Beispiel den Moving Average, zu nutzen. Wie also können wir jetzt für diesen diesen Bulls Power Indikator einen ExpertAdvisor in MQL5 erstellen? Um das zu tun, klicken wir hier im MetaTrader zunächst auf diesen kleinen Knopf hier oben oder drücken die F4-Taste. Das ruft hier den Metaeditor auf und hier klicken wir auf „Datei neu, „ExpertAdvisor von Vorlage, „Weiter, vergeben hier den Namen „Simple Bulls Power EA, klicken auf „Weiter, „Weiter, „Fertigstellen und löschen alles oberhalb dieser OnTick-Funktion und die beiden Kommentarzeilen. Und im ersten Schritt erstellen wir, wie so oft, ein Array für unsere Preisdaten vom Typ „Double und vergeben den Namen „My Price Array. Danach definieren wir die Eigenschaften für den Bulls Power EA, indem wir die in MQL5 eingebaute Funktion „i Bulls Power nutzen, und zwar für das aktuelle Währungspaar auf dem Chart und die dort eingestellte Zeiteinheit, zum Beispiel das Minuten-Chart oder das 60-Minuten-Chart. Und die Berechnung wird auf die letzten 13 Kerzen erfolgen, denn das ist der Zeitraum, der von Herrn Elder definiert wurde. Und im nächsten Schritt sortieren wir die Preise wieder abwärts von der aktuellen Kerze an, indem wir die Funktion „Array Set as Series nutzen. Das Ganze machen wir mit unserem Price-Array, das wir hier oben definiert haben. So, jetzt füllen wir Wir haben hier unseren Expert-Advisor noch mit Daten. Dazu nutzen wir hier die Definition aus dieser Zeile, die Funktion „Copy Buffer. Diese Null hier steht für den Indikator. Diese Null hier beschreibt die aktuelle Kerze und die drei bedeutet, dass wir die Preise von der aktuellen Kerze für drei Kerzen kopieren möchten und danach speichern wir das Resultat in unserem Price Array. Und aus diesem Price-Array hier holen wir uns jetzt aus der Kerze 0 den aktuellen Bulls Power-Wert und wir machen das mit einer Float-Variable. Normalerweise würde das hier eine Double-Variable sein. Das sind mir aber zu viele Nachkommastellen und außerdem braucht die Float-Variable gegenüber der Double-Variable nur 4 Byte statt 8 Byte im Speicher. In einem letzten Schritt lassen wir uns jetzt auf dem Chart noch unseren Wert und den Text Bulls Power-Wert ausgeben. Das machen wir mit der Comment-Funktion und nach diesem Text wird der Wert ausgegeben, den wir in der Zeile hier ermittelt haben. Kompilieren wir das Ganze, dann bekommen wir hier unten die Warnung, es gibt einen möglichen Datenverlust, weil wir hier einen Float statt einen Double-Wert berechnen. Trotzdem war der Compiler-Vorgang mit null Fehlern erfolgreich. Also klicken wir hier oben auf diesen kleinen Knopf oder drücken die F4-Taste, zurückzuwechseln in den MetaTrader. Im MetaTrader selbst klicken wir auf „Ansicht, „Strategietester oder drücken die Steuerung und die R-Taste. Das ruft dann hier unten den „Strategietester auf und hier wählen wir d...

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE COMMODITY CHANNEL INDEX

MQL4 TUTORIAL

Play Episode Listen Later Feb 22, 2024 5:43


In this video we are going to trade the Commodity Channel Index, that's the Indicator right here; you see the two dotted lines and whenever the line here crosses the upper dotted line we consider that to be a sell signal and when it crosses the lower dotted line that would be a buy signal. In this video we are going to find out how to automatically calculate this signal with a few lines of MQL4 code. To do that please click on the little button here and now you should see the Metaeditor window and here you want to click on “File New Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleCommodityChannelIndex”, click on “Continue”, “Continue” and “Finish” and now you can remove everything above the “OnTick” function and the two comment lines here. Let's start with a string variable for the signal, that variable will also be called: “signal” – we don't assign a value because we are going to calculate that later on. Let's define our indicator that is done by using the “iCCI” function that comes with MQL4 and if you mark it and hit the F1 key you will see it takes a few parameters. The first parameter is for the symbol – that's actually the currency pair on your chart –, the second one is for the time frame, in our case we use the 1 minute time frame – another time frame could be 5 minutes or 15 minutes and so on –, the third parameter is for the averaging period, that's actually the period we use to calculate the signal and if you click on “Insert Indicators Custom CCI” you will see that the CCI period is 14, so that's what we are using here followed by a typical price. You could also use a close or an open price, the highest or the lowest price, and the last parameter here is for the shift. You could use a shift value to move the Indicator window to right or to the left. We are not going to use it so our last parameter will be 0. Now that we know the value we want to find out if it is above 100, so if the “ICCIValue” we have defined here is greater than 100 – that would be the case when it's above the dotted line here, because this is the 100-plus line –, we consider our currency pair to be oversold so we assign the word: “sell” to our signal. In the other case if our value is below -100, so if our “ICCIValue” is below -100 – that would be the case when the line is below the dotted line here, because the lower line is the minus 100 line – in that case we consider it to be a buy signal so we assign the word: “buy” to our signal. In the last step we create a chart output that is done by using the “Comment” function and we want to output the word: “Signal:” followed by the calculated signal (signal) and in a new line we want to have the output: “ICCI Value:” followed by the current ICC I value (ICCIValue). Okay. Please don't forget the closing bracket and when you are done you can click on the “Compile” button here or press F7 on your keyboard and now you should see an output like this. We have compiled it without any errors and without any warnings and in that case you can click on a little button here or press F4 to go back to Metatrader and in Metatrader we use a little trick; please click on “Insert Indicators Custom CCI” we will go with the default values here so please click on “OK”. Now you should see the little window with the Indicator below the candles and now we right-click in our chart and select: “Template Save Template” and save it as: “tester.tpl” because this is the template that our strategy tester is going to use for the next back test. If you don't see the strategy tester panel you can click on “View Strategy Tester” or press CTRL and R,

MQL5 Tutorial
MQL5 TUTORIAL – SIMPLE ICCI EXPERT ADVISOR

MQL5 Tutorial

Play Episode Listen Later Feb 18, 2024 5:48


In this video we are taking a look at the ICCI Indicator, that’s the Commodity Channel Index Indicator. You can see that this signal here is creating buy and sell signals and whenever the blue line here is above the upper dotted line that would be a sell signal, in the other case if the blue line here is below the lower dotted line that would be a buy signal. Now, how can we create an Expert Advisor that is able to calculate the Commodity Channel Index Indicator? 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, “Continue”, I will call this one: “SimpleCommodityChannelIndex”, click on “Continue”, “Continue” and “Finish” and now you can delete everything that is above the “OnTick” function and let's also delete the two comment lines here. Here we need to create a string for the signal that will be also called: “signal” but we don’t assign any value here. We also need to create an array for the price data that will be called: “myPriceArray”, it’s a double array so it can hold floating type values and now we define the ICCI Expert Advisor by using the “iCCI” function that is built in into MQL5, it uses a few parameters; the first one is for the current chart – we use “_Symbol” to get the current currency pair on the chart and “_Period” to get the currently selected period. Right now we are trading the 1-minute chart but another period could be 30 or 60 minutes, the third parameter is the number of the candles. We use 14 candles and if you click on: “Insert/ Indicators/ Custom/ CCI/ Inputs” you would see a period of 14 candles is the default value. When I click on “OK” that’s what we see within the round brackets here, let’s right-click and select “Properties”, go to the “Parameters” tab until you see that we use a typical price and in MQL5 that's “PRICE_TYPICAL” for the last parameter and now that we have defined the ICCI we want to use “ArraySetAsSeries” to store the price data from the current candle downwards for our price array (myPriceArray) we have created here and with “CopyBuffer” we fill our price array (myPriceArray) according to our “ICCIDefinition” for buffer 0 from the current candle 0 and for 3 candles and to get the ICCI value (ICCIValue) we just need to have a look at candle 0 in our price array (myPriceArray) and we assign the result to the variable ICCI value (ICCIValue) and whenever the ICCI value (ICCIValue) is greater than 100 that would be considered to be a sell signal so we assign the word: “sell” to our signal. In the other case if the ICCI value (ICCIValue) is below -100 that would be a buy signal so we assign the word: “buy” to our signal. Now let’s make that a capital and in the last step we want to create an output on the chart that will output the word “Signal:” followed by the calculated signal. Please don’t forget the closing bracket. I will enable the toolbar so now I can click on the “Compile” button here or press F7 on the keyboard to compile the code. We have one warning here because we used the float value here, usually that would be a double value so let’s correct that, press F7 and now the warning is gone, it doesn’t really make a difference because we use the ICCI value (ICCIValue) to find out if something is above 100 or below -100, you can store a lot of digits behind the dot in double value but that’s not very helpful if you just want to find out if something is above plus or below minus 100. Okay, if you could compile your code without any errors you could now click on the little button here or press F4 on your keyboard to go back to Metatrader. In Metatrader you want to click on “View/ Strategy Tester” or press CTRL and R on your keyboard and here in a Strategy Tester please select the “SimpleCommodityChannelIndex.ex5” file, mark the visualization option here and start your test and here’s our little Expert Advisor at work it creates outputs for buy and sell signals on your chart and now you know how you can code it and you have coded it yourself with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL- SIMPLE ICCI STANDALONE EA How to create an ICCI Expert Advisor with MQL5 How to create a commodity channel index EA with MQL5 MQL5 Tutorial - How To Code A Simple Commodity Channel Index MQL5 TUTORIAL - SIMPLE STOCHASTIC STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – SIMPLE ICCI EXPERT ADVISOR appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Average True Range Expert Advisor

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Feb 11, 2024 5:58


  Einführung in den Average True Range Indikator (00:00 – 00:19) Einführung in den Average True Range (ATR) Indikator, der für die Analyse der Marktvolatilität verwendet wird und aus einer einzigen Linie besteht, die auf 14 Kerzen basiert. Analyse des Average True Range Indikators (00:19 – 01:04) Analyse des ATR Indikators anhand von Chartbeispielen, die zeigen, wie der Indikator starke oder schwache Kursbewegungen anzeigt. Erstellung eines Expert Advisors für den ATR Indikator (01:04 – 03:06) Anleitung zur Erstellung eines Expert Advisors im MetaEditor, der den ATR Indikator berechnet, inklusive der Einrichtung des MetaEditors und der Definition des Arrays und der Indikator-Eigenschaften. Berechnung und Ausgabe des ATR Werts (03:06 – 03:46) Schritt-für-Schritt-Anleitung zur Berechnung des ATR Werts und zur Ausgabe dieses Werts auf dem Chart. Kompilieren und Testen des Expert Advisors im MetaTrader (03:46 – 04:23) Anleitung zum Kompilieren des Expert Advisors und zum Testen im MetaTrader mit dem Strategie-Tester. Demonstration des Expert Advisors im MetaTrader (04:23 – 05:38) Demonstration des Expert Advisors im MetaTrader, Anzeige des ATR Werts und Interpretation der Signale, inklusive der Verbesserung des Indikators durch Anpassung der Kerzenanzahl. Zusammenfassung und Anwendungsmöglichkeiten (05:38 – 05:49) Zusammenfassung des Gelernten über den ATR Indikator und Anleitung zur Programmierung des Indikators in einem Expert Advisor in MQL5.   Diesmal sehen wir uns den Average True Range Indikator an der auch mit dem MetaTrader 5 ausgeliefert wird. Das ist ein sehr einfacher Indikator der aus einer einzigen Linie besteht. Er wird rückgerechnet auf 14 Kerzen und vom Prinzip geht es darum, dass dieser Indikator anzeigen soll ob wir gerade sehr schwache oder sehr starke Kursbewegungen haben. Sobald diese Linie hier unten weit unten landet, bekommen wir hier oben den Text schwacher Average True Range Wert angezeigt und die Theorie ist, dass nach sehr kleinen Kerzen und wenig Bewegung dieser Indikator wieder nach oben geht und in dem Moment wo wir hier sehr große Kerzen sehen und die Volatilität steigt, zeigt uns hier oben unser ExpertAdvisor „STARKER AverageTrueRangeWert“ an und der Wert hinter diesem Text sollte immer übereinstimmen mit dem Wert aus dem Indikator hier unten. Das ist z.b nützlich für Systeme bei denen man sich in schwachen Phasen raushalten möchte. Für viele Strategien ist es einfach nicht sinnvoll in einen Seitwärts-Markt einzusteigen, also wartet man ab bis sich der Markt etwas stärker bewegt. Wie kann man jetzt für den AverageTrueRange Indikator einen ExpertAdvisor erstellen? Dazu klicken wir hier oben im MetaTrader auf dieses kleine Symbol oder drücken die F4 Taste. Das ruft dann den MetaEditor auf und hier gehen wir auf Datei, neu, ExpertAdvisor von Vorlage. Klicken auf Weiter und vergeben den Namen „SimplerAverageTrueRangeEA“, klicken noch mal auf weiter, weiter, fertigstellen und löschen jetzt alles oberhalb der „OnTick“ Funktion. Auch die beiden Kommentarzeilen hier können verschwinden. Das Erste was wir jetzt brauchen ist ein „Array“ für Preis Daten. Das ist vom Typ „double“ und trägt den Namen“ PreisArray“. Im nächsten Schritt nutzen wir die eingebaute mql5 Funktion „iATR“ für das aktuell auf dem Chart angezeigte Währungspaar und die für das Chart ausgewählt Periode wie z.b. das Minuten Chart und wir wollen unser Ergebnis berechnen aufgrund der letzten 14 Kerzen. Der Grund dafür ist, dass der Average True Range Indikator von „J. Welles Wilder, Jr“ für diese 14 Kerzen definiert wurde. Wenn man übrigens bei Wikipedia auf den Namen klickt,

MQL5 Tutorial
MQL5 Tutorial – Simple Adaptive Moving Average Robot

MQL5 Tutorial

Play Episode Listen Later Feb 11, 2024 6:13


Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it to find entries or exits like you could with a simple moving average. Now if that is almost the same, why should we prefer to use an Adaptive Moving Average? Well Perry J. Kaufmann created this fascinating formula here for a reason. The Adaptive Moving Average has less lagging and generates less false signals. Let’s see if that is true. Now how can we create an Adaptive Moving Average Expert Advisor for Meta Trader 5? First please click on the little button here, that should bring up the MetaEditor. And here you want to select File, New, Expert Advisor from template, Continue and we will call that Simple Adaptive Moving Average. Now click on Continue, Continue, finish, and you can remove everything above the Ontick function here and I will also delete the two comment lines. So let’s create an array that will hold our prices, I will call it my price array and it is a double array because double and float variables can hold floating point types. And the adaptive moving average has six digits behind the dot and now we want to use the integrated MQL5 function iAMA for the current symbol on the chart and the current period, we want to calculate our prices based on the last nine candles. The Fast Moving Average has a value of two because if you Insert, Indicators, Trend, Adaptive Moving Average, you will see the values here, these are the nine candles. The fast EMA, that’s an Exponential Moving Average, is calculated for two candles and the slow EMA is calculated for thirty candles. And we do not need any shift, so we will use the exact same values here: nine candles, two candles for the fast EMA, thirty candles for the slow EMA. Zero for no shift and I would like to have the values calculated based on the close prices because the close price is also the default setting here. Okay let’s move on and sort the price array from the current candle downwards by using the array set as Series function for the price array we have created here. And now we want to fill it with data, that is done by using Copy Buffer for the Defined Moving Average, that’s the Adaptive Moving Average Definition we have created in this line. We just need one line, that’s the zero here, and we want to copy values from the current candle that’s candle zero for three candles that’s the three here, and we want to store the results in our price array. And now what we have done that, we want to get the value of the current candle, that’s candles zero of our price array and we use the normalized double function to get six digits behind the dot and the calculated value should be stored in a variable that is called Adaptive Moving Average Value. And the last step is to create a chart output by using the comment function. It will output the text AMA value and the calculated value for the Adaptive Moving Average Value we have extracted here. Okay that’s it, now please click the Compile bottom and you should get no errors and no warnings here so now you can click the button or hit the F4 key to go back to MetaTrader. And in MetaTrader you want to click on View, Strategy Tester, and in the Strategy Test panel you want to select the Simple Adaptive Moving Average.ex5 file. Select any currency pair you like and please make sure to enable the check mark for the visualisation option before you start your test. And here we go! if you move your mouse to the current value here, you'll see that we have a value of 1.544031, that’s exactly what we have calculated here. And in your Expert Advisor you would now compare the value of the adaptive moving average to the current price. And if the price is above the moving average you would buy, and if the price is below the moving average you would sell. Okay now you can create an Expert Advisor that uses the Adaptive Moving Average Indicator to find out if you want to buy or if you want to sell and you have created it in less than five minutes with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below How to create an Adaptive moving Average EA with MQL5 The Empowering MQL5 Moving Average MQL5 TUTORIAL - PLATIN SYSTEM - ADVANCED MOVING… MQL5 TUTORIAL - SIMPLE AMA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - HOW TO CREATE A SHIFTED MOVING AVERAGE The post MQL5 Tutorial – Simple Adaptive Moving Average Robot appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 Tutorial – Simple Force Index Trading Robot

MQL5 Tutorial

Play Episode Listen Later Feb 3, 2024 5:27


Okay this time we are talking about the Force Index Indicator. It is a very simple indicator. It's easy to read and also easy to code. If the indicator crosses the line in the middle from below and stays above the line, that could mean that we are bullish. And when it crosses the line from above and stays below the line like in this case, we have a bearish trend and we would like to sell. According to the website www.traderhq.com, this is also an indicator that was developed by Dr Alexander Elder, the author of the book: Trading for a Living. Okay now that we know how it works how can we create an Expert Advisor to use the indicator? The first step is to click the little button over here or hit the F4 key on your keyboard. That will start the Meter Editor and we want to click on File, New, Expert Advisor from template, Continue. We will call it Simple Force Index Robot. Now click on Continue, Continue, Finish, and delete everything above the Ontick function. These two comment lines are also no longer needed, because here we want to create an array, it shall holds several prices so it’s a double array and I will call it my price array. And now it’s time to define the Force Index definition by using the iForce function that is built-in into MQL 5. It takes some parameters, the first one is the current symbol on the chart, the second one is the period you have selected on your chart. The Force Index is calculated based on the last thirteen candles. You will also see it here in this little brackets. It is using the MODE_SMA that stands for Simple Moving Average and we want to use Tick volume. If you insert the indicator by clicking on Insert indicators, Oscillators, Force Index, you will see the exact same values here: thirteen candles, simple moving average based on the tick volume. Okay, let’s use the array set as series function that will sort the price array from the current candle downwards and now we use Copy Buffer for the Force Index definition we have created here. We need one line for the indicator that’s a zero here and we want to fill our array from the current candle that’s candle zero, for three candles that’s the three and store the result in our price array. And from our price array we are now going to extract the Force Index value for the current candle zero and we will use normalize double for six digits to get the six digits behind the point. And now we want to create a chart outputs depending on the value and if our Force Index value is above zero, we want to output the comment “trending upwards” directly on our chart and in the other case if the Force Index value is below zero, we want to have the text “trending downwards” on our chart. Okay, now please click on the little Compile button here or press the F7 key on your keyboard. That should compile your Expert Advisor without any errors or warnings here. And if that was going well please click on the button here or press F4 to go back to MetaTrader. Now in MetaTrader you want to click on View, Strategy Tester or press control and R. And in the Strategy Tester you want to select the Simple Force Index Robot.ex5 file. Let's pick a currency pair here, enable the visualisation mode and click on Start and here we go. Now the indicator is below the line so it says trending downwards and as soon as the little indicator crosses the line from below, that changes to trending upwards. Okay, now you know how to create an Expert Advisor for Meta Trader5 that is using the Force Index Indicator and you have created it yourself in five minutes with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below How to create a force Index EA with MQL5 How to create a Bulls Power EA with MQL5 How to create a Demarker Expert Advisor with MQL5 How to create a MacD EA with MQL5 MQL5 TUTORIAL - PLATIN SYSTEM - VARIABLE INDEX… The post MQL5 Tutorial – Simple Force Index Trading Robot appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – LIVE TRADING EXPERIMENT 2024 – LIVE UPDATES AND A LIVE PROFIT DOCUMENTED

MQL5 Tutorial

Play Episode Listen Later Jan 10, 2024 5:51


  20240101: DOWNLOAD 28 result videos for this system https://bit.ly/41OIpzK 20240101: README Documentation (updated often): https://bit.ly/41FPceY 20240102: System Download for Demo accounts: https://bit.ly/3H3diqt 20240103: Account Setup: https://youtu.be/qtCXQI3XL_4 20240104: Trading System Import: https://youtu.be/4AWpxGKVS4A 20240105: First Account Profit: https://youtu.be/BqXaoGyy3QU 20240106: Setup MX Linux server in 5 minutes: https://youtu.be/JVZoYn2w6Yw 20240107: Setup Metatrader on Linux in 3 minutes: https://youtu.be/DTkOQKW3HT4 20240109: Live Updates & Live Profit: https://youtu.be/BCnttK7d4HI In this video, I want to talk about how I got my advanced statistics to run. Actually, I had to change the account to Robo Forex and use a demo account there because what I didn’t know was that FXblue is not able to provide statistics for MetaQuotes demo accounts because they simply do not have the MetaQuotes company in their list. So when you pick a broker, you need to pick one that’s in their list, and MetaQuotes is not part of that. Yes, I could write to the support to add MetaQuotes, but I guess for this experiment, it’s more useful to use an account that actually is included. And for Robo Forex, they support demo accounts. I have to admit that advanced statistics for Robo Forex have been a pretty standard for me and my clients in the last few years. If you don’t know, I’m offering a premium course about MQL5 programming, and that is also where a lot of people use the same Robo Forex account settings that I use. So I actually didn’t know that MetaQuotes wasn’t in the brokers list. And I switched to this account, and that means that we had to start over with $100,000. So right now, we have made a profit of $71, and I guess in the next hour or so, we will make a few more trades. But the crazy thing is, I actually tried to use this account sync option. They say that it works for MetaTrader 4 and MetaTrader 5, but it wasn’t running on Linux and it wasn’t performing. So I thought, okay, I need to download this publisher app here, and I did. So the version I picked was this one for MetaTrader 5. You can download it for free and you will get a zip file. And when you open that zip file with Linux, you will find there is a publisher ex5 file inside. I had to extract that. Now, let’s go back to the trading terminal and click on File, Open Data folder, MQL5 experts. And here is that FX Blue publisher ex5 file. I then opened a new chart, and here is the ExpertAdvisor that you can drag onto the chart. I’m not going to replace it right now because it’s already working. You can see that the last synchronization was today at about 20 minutes past 5. Let’s open the FX Blue statement. This is the correct account number. It says that we have a history of eight days, which is true because the account is eight days old, but I started to use it yesterday. I can now refresh the state, and it says we have an open loss of $23 and a profit of $71. So let’s go back to MetaTrader and check. Yes, that’s about what is happening right now. And you can see that we have a profit here. So I expect my system to close both trades in the next few minutes because it’s configured in a way that when a new candle appears on the chart and the profit is higher than what I have defined, it should close both trades and lock in the account-based profit. This is the current candle. Currently, I’m using the hourly candles, so let’s switch to one minute. And I think that it will only take a few seconds until we see that this trade is closed, at least until the profit value drops. But with the lot size of 0.86 lots, it’s just a question of a few seconds before the profit value is reached again. Here is the new candle, but the profit is below $10, so let’s wait for the next one. And here we are. We have closed closed the trade. Now, let’s go back to the hourly chart. It already opened a new one. Now, the balance is $100,101. The history has changed. And when we go back to the stats here, we still see $71 of profit. But when we refresh the page, here is the new state, and this matches the account data. And as soon as this trade is going to be in the profit range, we will see another update. Currently, I’m experimenting with the take profit value here. I can change that in the source code as I do for my clients. Now you know how to activate the FX Blue publisher file, do automated status updates for FX Blue. So that’s it for today’s video. I say thank you for watching, and I will see you in the next one.. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 -… MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 - SETUP… MQL5 TUTORIAL - JOIN THE GREAT TRADING EXPERIMENT 2024 MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 -… MQL5 TUTORIAL ENGLISH - SETUP YOUR ADVANCED STATISTICS The post MQL5 TUTORIAL – LIVE TRADING EXPERIMENT 2024 – LIVE UPDATES AND A LIVE PROFIT DOCUMENTED appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – LIVE TRADING EXPERIMENT 2024 – SYSTEM DOWNLOAD AVAILABLE (below)

MQL5 Tutorial

Play Episode Listen Later Jan 3, 2024


  20240101: DOWNLOAD 28 result videos for this system https://bit.ly/41OIpzK 20240101: README Documentation (updated often): https://bit.ly/41FPceY 20240102: System Download for Demo accounts: https://bit.ly/3H3diqt   Okay, let’s start from the beginning. The trading experiment we’re conducting in 2024 is different from anything I’ve done before. A few weeks ago, I was pretty sick and was lying in bed, watching movies on Netflix all day. These included movies with commercials, and one ad I kept being shown was about a woman getting face cream for Christmas. She also demonstrated how to use the cream with pineapple to improve her skin. This didn’t interest me at all, and even if I was shown this ad a thousand times, I would never use face cream with pineapple.   Why am I telling you this? It’s about relevance! If I offer something that is irrelevant, nobody will want to buy it. It’s the same with pineapple face cream. It doesn’t matter how hard I try to convince someone if it’s just not relevant. I don’t think it matters what advertising technology is used. If something doesn’t interest me, there’s little anyone can do about it, no matter how appealing the advertising is. As a rule, I look for solutions that bring me more benefit than cost – popularly known as a bargain. In other words, you get something of value for less than you would be prepared to pay. That’s why we’re doing something different this year. I think a lot of companies are at an impasse right now because they’re trying to convince everyone on the planet to buy their products and everyone is trying to get louder and louder. I myself am not a fan of being ripped off and have never made a big show of how and what I do in trading.   I know that many people in this field wave big wads of cash from a skyscraper in Dubai or loll around on their Ferrari, but I believe that most potential clients quickly see through such dubious strategies. So I spent a long time looking for a way to offer something that I would buy myself, in an unobtrusive way that could convince people like me. I found Frank Kern, who teaches a strategy that I really like. It is described as the oldest trick in his books and is about really helping someone to convince them that you can help them. When it comes to automated trading, that’s pretty easy and that’s why we’re using a demo account now and will be trading with a demo system to get better results in 2024. I believe that you are interested in better results, and I know from the last ten years that 10 to 15 percent of the people who watch these videos are interested in buying the right solution. That doesn’t mean you have to buy it yourself, but I believe that probabilities are the key to success.   Knowing my numbers, it is very likely that 10 to 15 percent of viewers will spend money with me later because they are convinced that what I am offering is exactly the solution they were looking for. That’s why the Robot Trading System is now available as a free download for demo accounts. You can find the link below this video. In the next videos we will look at how to set up this system in Meta Trader to achieve good results in the long term. Anyway, I believe that you should trade the first weeks or months on a demo account, and after that you can use the system on a so-called cent account. So this strategy fits well. And I think it can help you and me to achieve better results in 2024. Okay, that’s it for this video. I’ll see you in the next one, and thank you for watching. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - JOIN THE GREAT TRADING EXPERIMENT 2024 MQL5TUTORIAL - HOW TO GET ADVANCED STATISTICS FOR 3… MQL5 TUTORIAL - FREE TRADING TRAINING FOR 2023 MQL5 TUTORIAL - 99 NEW LIVE CROWD ALGO TRADING SYSTEM LEARN MQL5 TUTORIAL BASICS - LEVEL 1A BUILD YOUR OWN… The post MQL5 TUTORIAL – LIVE TRADING EXPERIMENT 2024 – SYSTEM DOWNLOAD AVAILABLE (below) appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – JOIN THE GREAT TRADING EXPERIMENT 2024

MQL5 Tutorial

Play Episode Listen Later Jan 2, 2024


    20240101: DOWNLOAD 28 result videos for this system https://bit.ly/41OIpzK 20240101: README Documentation (updated often): https://bit.ly/41FPceY 20240102: System Download for Demo accounts: https://bit.ly/3H3diqt   This video is about a big trading experiment that I would like to do together with you. Today is January 1, 2024, it’s just before 4 pm and I’ve spent the day today running strategy tests for all the major currency pairs that I trade myself for this system here, trading through the entire year of 2023. And I will also make these videos available for you to watch for yourself. But the big experiment here is that I would like to use the year 2024 together with people like you to make this system better. That’s why I’m now offering a version of the Robot Trading System that runs indefinitely on a demo account from January 2024. This means that if you use a demo account, you can do everything that I do myself. I will also initially trade this system on a demo account, and it will be about how you can set up, adjust and improve such a system over the course of the year so that you get a decent result at the end of the year. We will also discuss and share some other things that might help you, even if you haven’t had anything to do with automated trading before or if you want to have a look at the whole thing first if you are interested in joining in. You don’t need any prior knowledge, you don’t need any capital. All you need is a computer that has been manufactured in the last ten years. You need a demo account. You can get that for free from Metaquotes or other companies and you need to do strategy tests like this here with Metatrader five, which you can also download for free. This time we would have made a net profit of €1,642 on an account with a deposit of €10,000. And why are we doing all this on a demo account? Well, there are few people who are actually willing and ready to invest time in real trading results on a demo account before trading real money with a real money account. And in almost every trading session there are always dips like this. And that leads people to close their account at exactly this point. Because that’s where the fear is greatest. But you don’t have to be afraid on a demo account. And as soon as you feel that the system works well enough for you, you can switch at any time. But we have already done experiments like this in the past and I would like to start 2024 in the same way. Because I believe that nothing can replace the knowledge you have gained yourself. And in this case, I think you have little to lose and a lot to gain. That’s it for this opening video. I wish you a happy new year and in the next few days you will receive more information, new videos and also the download link to the version of this system that you can then use for free on your own demo account. If you are already an existing customer, I have activated a few more parameters for the Robot Trading System here. This means that the system can now be controlled more precisely. And if you like the results here, I’ll see you in the next video. Thank you very much for watching. And we’ll continue in the next video. ​ Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - LIVE TRADING EXPERIMENT 2024 -… MQL5 TUTORIAL - FREE TRADING TRAINING FOR 2023 LEARN MQL5 TUTORIAL BASICS - LEVEL 1A BUILD YOUR OWN… MQL5 TUTORIAL - 101 WHAT HARDWARE FOR ALGORITHMIC TRADING MQL5 TUTORIAL - 99 NEW LIVE CROWD ALGO TRADING SYSTEM The post MQL5 TUTORIAL – JOIN THE GREAT TRADING EXPERIMENT 2024 appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 Tutorial – Simple MQL5 New Candle Robot

MQL5 Tutorial

Play Episode Listen Later Dec 29, 2023 4:52


  Introduction to Counting New Candles on the Chart (00:00 – 00:17) Discussing the usefulness of counting new candles on a chart and showing the output of four candles since the start of the expert advisor. Importance of Candle Counting in Automated Trading (00:17 – 00:36) Explaining why counting candles is important in automated trading, especially when trading multiple positions and currency pairs. Resource Management and Avoiding Computer Crashes (00:36 – 01:17) Highlighting the importance of resource management to avoid computer crashes, especially during fast market movements. Creating a Simple Expert Advisor for New Candle Detection (01:17 – 01:57) Demonstrating how to create a simple expert advisor in MetaTrader to detect new candles. Setting Up Price Array and Sorting for Candle Data (01:57 – 02:20) Instructions on setting up a price array and sorting it to hold price data for candle detection. Filling the Array with Price Data and Counting New Candles (02:20 – 02:59) Steps to fill the array with price data and use it to count the number of new candles since the last start of the expert advisor. Creating Timestamp Variables for Candle Time Tracking (02:59 – 03:42) Creating date/time variables to track the timestamp of the current and last checked candles. Updating Candle Counter and Displaying Output on Chart (03:42 – 04:36) Updating the candle counter when a new candle is detected and displaying the output on the chart.   Sometimes it is helpful to count the new candles on the chart. The output in the left upper corner on the chart says we had four candles since we started this Expert Advisor,. One, two, three, four, this is the fifth one. Now you might ask yourself why is this important? Well an Expert Advisor can trade several positions on a chart, and you also can trade several currency pairs and every single candle on the chart can have lots of different price moves. And every time a price changes the OnTick function will be triggered but a lot of trading strategies use close prices. So instead of maybe fifteen calculations within this candle, you would only need one calculation for the close price. Even a high tech computer may have a resource problem, if you try to calculate several dozen trades on several dozen charts because when the market starts to move really fast your computer might be overwhelmed and it may cause a crash. So if you want to avoid computer crashes, it’s a good idea to save resources. To do that you can simply check if a new candle is created and now we will create a simple little Expert Advisor to do that. So let’s click the little button over here or hit the F4 key to bring up the Meta Editor. Select File, new Expert Advisor from template, continue, and we will give it the name Simple New Candle. Now click on continue, continue, finish, and remove everything above the OnTick function. Let’s delete the two comment lines here. Okay now the first thing we need is the price array to hold our price data. So let’s create that, that can be done with MQLRates and we will call a price data. Now we want to sort our array from the current candle downwards with arraysetasseries and in the next step we need to fill it with data. That is done by using copyrates for the current currency pair on the chart and the current selected period. For example I prefer a one minute charts, we want to start with the current candle zero, and copy the price for three candles into our little array price data. To count the number of new candles since the last start of the Expert Advisor, we need a new candle counter. This candle counter will be an integer and it will be static, that means it will never lose its value even if we would like to leave the function. Okay let’s move on, now we are creating datetime variable that will hold a time stamp; this one will hold the time stamp for the last time we checked and it is also static so it will never lose its value. And for the current candle we need another datetime variable and that will be called time stamp current candle and we will fill it by getting the time value of the current candle from our price data array. And if the time stamp for the current candle is different from the timestamp the last time we checked, we want to remember the current timestamp for the next time by assigning it to the timestamp last check variable. Now we want to add the value one to our current candle counter and the last thing we need us the output on the chart. So let’s compile the little Expert Advisor here and we have zero errors and zero warnings. So let’s hit the F4 key or click this button to go back to MetaTrader, select View Strategy Test or hit the control and the R key. Look out for the simple new candle.ex5 file. Mark the visualization option and click on start. And now you should see your candles on the chart being counted and that can be done very fast and you did it in five minutes by creating this little Expert Advisor here. Not sure what to do? Click on the automated trading assistant below How to find new chart candles with MQL5 How to create a Simple Moving Average Expert Advisor… MQL5 TUTORIAL - HOW TO STILL BENEFIT WHEN THE PRICE… MQL5 TUTORIAL - BEWARE OF HISTORY QUALITY ISSUES MQL5 TUTORIAL - 131 STANDALONE EMA MACD EXPERT ADVISOR The post MQL5 Tutorial – Simple MQL5 New Candle Robot appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Envelopes Expert Advisor

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 29, 2023 8:02


  Einführung in den Envelope Indicator (00:00 – 00:17) Einführung in den Envelope Indicator, der den Kursverlauf innerhalb bestimmter Linien darstellt und bei Überschreitung dieser Linien Handelssignale generiert. Analyse des Envelope Indicators (00:17 – 01:04) Analyse des Envelope Indicators anhand von Chartbeispielen, die zeigen, wie der Indikator bei Überschreitung der Linien auf bevorstehende Kursänderungen hinweist. Erstellung eines Expert Advisors für den Envelope Indicator (01:04 – 03:06) Anleitung zur Erstellung eines Expert Advisors im MetaEditor, der den Envelope Indicator berechnet, inklusive der Einrichtung des MetaEditors und der Definition des Arrays und der Indikator-Eigenschaften. Berechnung und Ausgabe des Envelope Werts (03:06 – 03:46) Schritt-für-Schritt-Anleitung zur Berechnung des Envelope Werts und zur Ausgabe dieses Werts auf dem Chart. Kompilieren und Testen des Expert Advisors im MetaTrader (03:46 – 04:23) Anleitung zum Kompilieren des Expert Advisors und zum Testen im MetaTrader mit dem Strategie-Tester. Demonstration des Expert Advisors im MetaTrader (04:23 – 05:38) Demonstration des Expert Advisors im MetaTrader, Anzeige des Envelope Werts und Interpretation der Signale, inklusive der Verbesserung des Indikators durch Anpassung der Kerzenanzahl. Zusammenfassung und Anwendungsmöglichkeiten (05:38 – 05:49) Zusammenfassung des Gelernten über den Envelope Indicator und Anleitung zur Programmierung des Indikators in einem Expert Advisor in MQL5.   Mit MQL5 und Metatrader5 kann man den Envelopes Indikator in weniger als 5 Minuten für einen Trading Robot programmieren, mit dem man automatisch traden kann. Die MQL5 Funktion iEnvelopes kommt mit dem Metatrader5, damit programmieren wir in diesem Video einen Envelopes Expert Advisor für den Metatrader5… Diesmal sehen wir uns den sogenannten “Envelopes Indicator” an. Envelope bedeutet Umschlag und wenn man ein wenig hineinzoomt, dann kann man sehen, dass auf diesem Chart der Kurs zum überwiegenden Teil hier innerhalb dieser beiden Linien verläuft. Die Idee ist jetzt, bei einer Überschreitung einer dieser Linien in die entsprechende Richtung einen Trade zu eröffnen. Beispielsweise sehen wir hier, dass die Kerzen oberhalb des oberen Bandes geschlossen wurden. Wir würden also jetzt einen Short-Trade eröffnen und hätten auf dieser Strecke hier ganz ordentlich Profit gemacht. Außerdem ermöglicht uns der Envelope-Indicator uns in den langweiligen Seitwärtsphasen ohne richtige Trends herauszuhalten. Wir würden jetzt darauf warten, dass eines dieser Bänder hier überschritten wird und dann einen Trade in die entsprechende Richtung eröffnen. Der sogenannte Moving Average Envelope Indicator ist ein Instrument für die technische Analyse und ähnelt den Bollinger Bändern. Genau wie bei den Bollinger Bändern gibt es die eine Fraktion die sagt, dass ein Überschreiten des oberen Bandes ein Signal für einen starken Aufwärtstrend ist und die andere Fraktion hält das Überschreiten des oberen Bandes für ein Signal dafür, dass wir eine Situation des Überverkaufs haben und der Trend sich umkehren wird nach unten. Sie können das natürlich selbst entscheiden, aber wenn wir uns das hier ansehen, oder diesen Bereich hier, dann würde ich eher glauben, dass sich der Kurs häufiger vom einen Band zum anderen Band bewegt. Wie können wir jetzt einen Expert Advisor für diesen Indikator hier erstellen? Zunächst einmal klicken wir hier oben auf diesen kleinen Knopf oder drücken die F4 Taste. Das ruft hier den MetaEditor auf und dort klicken wir auf Datei – Neu – Expert Advisor aus Vorlage – weiter, vergeben den Namen SimplerEnvelopesEA,

MQL5 Tutorial
MQL5 Tutorial – Simple MQL5 Bollinger Bands Robot

MQL5 Tutorial

Play Episode Listen Later Dec 19, 2023 5:56


  Introduction to Bollinger Bands and Expert Advisor Calculation (00:00 – 01:03) Introduction to using Bollinger Bands in trading and how the expert advisor can calculate all three bands with higher accuracy. Trading Strategy with Bollinger Bands (01:03 – 01:34) Explaining the trading strategy: opening a short trade when the price breaks the upper Bollinger Band and a long trade when it breaks the lower band and returns. Creating an Expert Advisor for Bollinger Bands (01:34 – 02:05) Instructions on creating an expert advisor in MetaTrader to automate trading with Bollinger Bands. Setting Up Arrays and Defining Bollinger Bands in Code (02:05 – 03:21) Coding steps to set up arrays for each Bollinger Band and defining the bands based on the current chart and time period. Outputting Calculated Values on the Chart (03:21 – 03:38) Using the comment function to output the calculated values of the Bollinger Bands on the chart. Compiling the Code and Preparing MetaTrader (03:38 – 04:20) Compiling the expert advisor code and setting up MetaTrader to display the Bollinger Bands on the chart. Testing the Expert Advisor in Strategy Tester (04:20 – 05:39) Running the expert advisor in the strategy tester and comparing the calculated values with the chart’s Bollinger Bands.   If you like to use indicators, you might have heard of the Bollinger bands. This little Expert Advisor here can calculate all three bands. If you put your mouse cursor over the middle band here you see a value of 0.712078 and our calculated value for the middle band is 0.7120775, this calculation even is a little bit more accurate. The value for the upper Bollinger band is 0.712457 and here we have 0.712457. And for the lower Ballinger band it’s the same 0711698, 0.7116979. This value is even more accurate because this one is rounded. So what can we do with a Bollinger Bands? Well the idea is as the price breaks the upper Bollinger band we want to get in at the next entry and we would like to open a short trade here, because we expect the price to fall. In the other case if the price breaks the Bollinger band here and it gets back into the bands we would go for a long trade because the price might rise. So if you can create an automated Expert Advisor that is able to compare these values over here with the current price, you can fully automate this. Your computer can trade the Bollinger bands automatically and you don’t have to sit in front of your screen all the time. So let’s create a little Expert Advisor! To do that please hit the F4 key or click this little button over here and that will open the Meta Editor. Here we click on new Expert Advisor from template, continue, we will call it simple Bollinger bands, click on continue, continue, finish. Remove everything above the OnTick function, remove the comments and the first thing we need is an array for each of the Bollinger bands one, two, three times a double array. Now we need to sort our three arrays to hold prices from the current candle downwards and we do that with the function arraysetasseries. In the next step we need to define the Bollinger bands. We want our Expert Advisor to use the current chart for the current time period used on the chart. It should calculate the Bollinger bands for twenty candles without any shift and with a standard deviation of two, that all should be calculated for the closed price of the candle. Afterwards we need to copy the price information into three arrays and now it’s time to calculate the actual value for the current candle and to store it in a variable for each of the three bands. That’s it for the calculation. Now we want to output our calculated values on the chart, we do that with the comment function and it will output the name of the variable and the value we have calculated in this block. Okay let’s compile the code. We have no errors and no warnings. So let’s click the little button over here or hit the F4 key to bring up the Meta Trader, to make the Bollinger band visible on the screen we will use a little trick. Please click on insert, indicators, Bollinger bands, select the period of twenty candles with a shift value of zero and the deviation value of two, we want to apply all this to the closed price of the candles and now you can pick a color and style for the line. I prefer these thicker lines. Let’s click on okay and you will see the visual representation of the Bollinger bands on the chart. Now right click the chart select templates, save template and save it as Tester.tpl to make it the default chart for strategy tester. And if you save it as default.tpl it will also become the default template if you open a new chart in life trading. So let’s bring up the Strategy Tester by clicking on View Strategy Tester or hitting the control and the R key and select the simple Bollinger bands.ex5 file, make sure to and enable visualization here and start the test. And this is what you should see now, let’s stop it here and check the values. This is 0.706251, 0.7062505, thats okay. The upper Bollinger band is 0.706916, 0.706916, that’s also okay and the lower Bollinger band is 0.705585, and that’s exactly what’s calculated here, so it works. In this video you learned to calculate all the Bollinger bands by creating this little Expert Advisor here. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - HOW TO CREATE THE BOLLINGER BANDS… MQL5 TUTORIAL - PLATIN SYSTEM - BOLLINGER BANDS ENTRY SIGNAL How to create an advanced Bollinger Bands entry How to create a Bollinger Bands Expert Advisor with MQL5 MQL5 TUTORIAL BASICS - 129 SIMPLE BOLLINGER BANDS… The post MQL5 Tutorial – Simple MQL5 Bollinger Bands Robot appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler Bollinger Bands Trading Robot mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 19, 2023 6:34


  Einführung in Bollinger Bänder (00:00 – 00:12) Einführung in die Bollinger Bänder, einen beliebten Indikator im MetaTrader, der einfache Ein- und Ausstiegsregeln in beide Richtungen ermöglicht. Erklärung der Ein- und Ausstiegsregeln (00:12 – 00:22) Erklärung der Ein- und Ausstiegsregeln für Short und Long Trades mit Bollinger Bändern. Berechnung der Bollinger Bänder (00:22 – 00:50) Demonstration, wie die drei Werte für die Bollinger Bänder berechnet werden: Mittelband, oberes und unteres Band. Nutzung der Bollinger Bänder für Handelssignale (00:50 – 01:11) Erklärung, wie der Schlusskurs einer Kerze außerhalb und innerhalb der Bänder als Handelssignal genutzt werden kann. Erstellung eines Bollinger Band Expert Advisors (01:11 – 02:07) Anleitung zur Erstellung eines einfachen Bollinger Band Expert Advisors im MetaEditor. Berechnung der Bollinger Band-Werte im Expert Advisor (02:07 – 03:10) Schritt-für-Schritt-Anleitung zur Berechnung der Bollinger Band-Werte im Expert Advisor. Ausgabe der berechneten Werte auf dem Chart (03:10 – 03:55) Demonstration, wie die berechneten Werte der Bollinger Bänder auf dem Chart ausgegeben werden. Einrichtung der Bollinger Bänder im MetaTrader (03:55 – 04:43) Anleitung zur Einrichtung der Bollinger Bänder im MetaTrader und zur Erstellung eines Templates. Speichern und Anwenden des Templates (04:43 – 05:19) Anleitung zum Speichern und Anwenden des Templates mit den Bollinger Bändern im Strategie-Tester. Demonstration des Expert Advisors in Aktion (05:19 – 06:19) Demonstration des Expert Advisors im Strategie-Tester und Überprüfung der berechneten Werte der Bollinger Bänder. Zusammenfassung und Anwendungsmöglichkeiten (06:19 – 06:19) Zusammenfassung des Gelernten über die automatische Berechnung der Bollinger Bänder und deren Nutzung im Expert Advisor.   Mit MQL5 und dem Bollinger Bands Indikator lassen sich für den Metatrader5 sehr schöne Strategien programmieren, mit denen man auch aufgrund von dynamischen Bewegungen einfach automatisch traden kann… Falls Sie sich einmal mit Markttechnik befasst haben, oder im Metatrader gerne Indikatoren benutzen, dann kennen Sie vielleicht die sogenannten Bollinger Bänder. Es handelt sich hierbei um einen sehr beliebten Indikator, der es jedem Trader ermöglicht mit sehr einfachen Regeln Ein- und Ausstiege in beide Richtungen zu finden. Die Einstiegsregel für einen Short-Trade besagt, dass man, sobald der Kurs das obere Band überschreitet und wieder eintritt, in die absteigende Richtung einen Sell-Trade eröffnet. Andersherum würde man in diesem Fall hier beim Überschreiten der unteren Linie einen Buy-Trade eröffnen, weil zu erwarten ist, dass sich der Kurs hier nach oben bewegt. Halten wir die Simulation an dieser Stelle einmal kurz an, dann können wir erkennen, dass hier oben drei Werte berechnet werden. Der Wert MeinMittelbandwert zeigt gerade einen Wert von 0.71064 an. Wenn ich kurz die Maus hier unten hinhalte, dann sehe ich, dass ich 0,710643 habe, da dieser Wert etwas aufgerundet wird. Für das obere Band habe ich einen Wert von 0,711245 berechnet und auch das untere Band wird mit 0,710040 korrekt berechnet und hier oben dargestellt. Wofür ist das Ganze gut? Ganz einfach, wenn der Schlusskurs einer Kerze ausserhalb des unteren Bandes liegt und der Schlusskurs der nächsten Kerze wieder innerhalb der Bänder liegt, dann kann ich das als Einstiegssignal in die entsprechende Richtung nutzen. Wie berechnet man jetzt diese Bollinger Bänder? Um das zu tun, klicken Sie bitte im Metatrader hier oben auf den kleinen Button oder drücken die F4-Taste. Das wird den Metaeditor aufrufen. Hier wählen wir Datei, Neu,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL – SO FUNKTIONIERT der WILLIAMS PERCENT RANGE

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 11, 2023 6:02


  Analyse des Williams Prozent Range Indikators (00:17 – 01:04) Analyse des Indikators anhand von Chartbeispielen, die zeigen, wie Spitzen im Indikator vor Kursänderungen auftreten und wie diese Spitzen auf bevorstehende Richtungswechsel hinweisen. Erstellung eines Expert Advisors für den Williams Prozent Range Indikator (01:04 – 03:06) Anleitung zur Erstellung eines Expert Advisors im MetaEditor, der den Williams Prozent Range Indikator berechnet, inklusive der Einrichtung des MetaEditors und der Definition des Arrays und der Indikator-Eigenschaften. Berechnung und Ausgabe des Williams Prozent Range Werts (03:06 – 03:46) Schritt-für-Schritt-Anleitung zur Berechnung des Williams Prozent Range Werts und zur Ausgabe dieses Werts auf dem Chart. Kompilieren und Testen des Expert Advisors im MetaTrader (03:46 – 04:23) Anleitung zum Kompilieren des Expert Advisors und zum Testen im MetaTrader mit dem Strategie-Tester. Demonstration des Expert Advisors im MetaTrader (04:23 – 05:38) Demonstration des Expert Advisors im MetaTrader, Anzeige des Williams Prozent Range Werts und Interpretation der Signale, inklusive der Verbesserung des Indikators durch Anpassung der Kerzenanzahl. Zusammenfassung und Anwendungsmöglichkeiten (05:38 – 05:49) Zusammenfassung des Gelernten über den Williams Prozent Range Indikator und Anleitung zur Programmierung des Indikators in einem Expert Advisor in MQL5.   Heute möchten wir uns einmal den Williams PerCent Range Indikator ansehen. Dabei handelt es sich um ein Hilfsmittel, um festzustellen, ob ein Markt über- oder unterverkauft ist. Dieser Indikator besteht aus einer Linie. Und wenn diese Linie eine dieser beiden gestrichelten Werte überschreitet, dann wird es interessant. Der Williams ProzentRange Indikator oder auch Prozentr Indikator wurde 1966 von Larry Williams entwickelt, um überkaufte oder überverkaufte Situationen anzuzeigen. Wenn man sich unsere Situation hier anschaut, dann sieht man, dass die höchsten Spitzen hier immer auftreten, bevor der Kurs in den Keller geht und andersherum. Diese Spitzen hier unten deuten darauf hin, dass es wieder in die andere Richtung gehen wird. Hier kann man ganz gut erkennen, dass das etwas vor dem eigentlichen Kursabfall angezeigt wird. Und auch diese Spitze ist ein wenig vor dieser Kerze hier entstanden. Derzeit arbeiten wir hier mit 14 Kerzen. Wir werden das aber gleich im Verlauf dieses Videos noch auf 100 Kerzen verändern. Wie erstellt man also jetzt einen Expert Advisor, der den Wert für diesen Indikator messen kann? Dazu klicken wir im Metatrader zunächst hier oben auf dieses kleine Icon oder drücken die F4 Taste. Das ruft den Metaeditor auf und hier klicken wir auf Datei neu Expert Advisor von Vorlage erstellen. Weiter. Wir vergeben hier den Namen Simple Williams Prozentrange und klicken auf weiter. Weiter fertigstellen. Und jetzt löschen wir alles oberhalb dieser Ontick Funktion und entfernen diese beiden Kommentarzeilen. Im ersten Schritt benötigen wir ein Array. Es ist vom Typ Double, da es NachKommastellen für unsere Preisdaten aufnehmen soll und trägt den Namen WPR Array. Jetzt definieren wir noch die Einstellungen für den Williams ProzentRange Indikator. Laut unserer Definition möchten wir die Funktion iWPR nutzen, die in MQL5 eingebaut ist. Und wir möchten den Indikator gerne für das aktuelle Währungspaar auf dem Chart berechnen, und zwar für die auf dem Chart ausgewählte Zeiteinheit, wie beispielsweise das Minuten Chart. Und als Berechnungsgrundlage nutzen wir die letzten 14 Kerzen. Danach nutzen wir die Funktion ArraySetAsSeries für unser Array, um die Preisdaten abwärts von der aktuellen Kerze auszusor...

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Momentum Robot

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 4, 2023 5:58


  Einführung in den Momentum Indicator (00:00 – 00:17) Einführung in den Momentum Indicator, der oft mit anderen Indikatoren wie gleitenden Durchschnitten verwendet wird und Trendwenden voraussagen soll. Analyse des Momentum Indicators (00:17 – 00:50) Analyse des Momentum Indicators anhand von Chartbeispielen, die zeigen, wie Spitzen im Indicator vor Kursänderungen auftreten. Bedeutung des Momentum Indicators (00:50 – 01:07) Diskussion über die Bedeutung des Momentum Indicators und seine Fähigkeit, Fehlsignale zu produzieren. Erstellung eines Momentum Expert Advisors (01:07 – 02:03) Anleitung zur Erstellung eines einfachen Momentum Expert Advisors im MetaEditor. Definition der Eigenschaften des Momentum Expert Advisors (02:03 – 02:44) Schritt-für-Schritt-Anleitung zur Definition der Eigenschaften des Momentum Expert Advisors. Berechnung des Momentum-Werts (02:44 – 03:25) Anleitung zur Berechnung des Momentum-Werts und zur Ausgabe auf dem Chart. Ausgabe des Momentum-Werts auf dem Chart (03:25 – 04:13) Demonstration, wie der berechnete Momentum-Wert auf dem Chart ausgegeben wird. Kompilieren und Testen des Expert Advisors (04:13 – 04:23) Anleitung zum Kompilieren des Expert Advisors und Testen im MetaTrader mit dem Strategie-Tester. Demonstration des Expert Advisors im MetaTrader (04:23 – 05:16) Demonstration des Expert Advisors im MetaTrader, Anzeige des Momentum-Werts und Interpretation der Signale. Zusammenfassung und Anwendungsmöglichkeiten (05:16 – 05:42) Zusammenfassung des Gelernten über den Momentum Indicator und Anleitung zur Anwendung des Expert Advisors im eigenen Handelssystem.   Das hier ist der sogenannte Momentum IndiKator. Der wird relativ häufig zusammen mit anderen Indikatoren wie einem gleitenden Durchschnitt eingesetzt und man sagt diesem Indikator nach, dass er tatsächlich in der Lage sein soll, Trendwenden vorauszusagen. Schaut man sich zum Beispiel den Verlauf an dieser Stelle an, dann sieht man, dass hier eine Spitze ausgebildet wird, bevor der Kurs tatsächlich das Gleiche getan hat. Auch hier können wir das beobachten, kurz bevor das hier passiert. Hier gibt es ebenfalls eine Spitze und die wurde hier nach oben hin auch ausgebildet. Würde man eine senkrechte Linie von hier nach hier ziehen, dann würde man feststellen, dass es tatsächlich sinnvoll gewesen wäre, an dieser Stelle auszusteigen, bevor hier oben der Kurs tatsächlich gedreht hat. Wie andere Indikatoren auch, wird auch der Momentum-Indikator nicht immer fehlerfrei funktionieren und an der einen oder anderen Stelle auch Fehlsignale produzieren. Ob und in welcher Kombination Sie diesen Indikator einsetzen möchten, müssen Sie also selbst bestimmen. Hier oben in der linken Ecke des Charts können Sie jetzt sehen, dass das Momentum mit 100.03 als stark angesehen wird. Es hat noch ein bisschen gedauert, aber tatsächlich ist der Preis hier nach unten gegangen. Der Wikipedia-Eintrag für den Momentum-Indikator bei der Chart-Analyse sieht darin eine Möglichkeit zur Messung der Stärke einer Kurs-Bewegung. Hier werden auch die Formeln erklärt. Aber wenn man wie ich Mathematik nicht studiert hat, dann ist es deutlich leichter, so einen Indikator mit der entsprechenden eingebauten Funktion in MQL5 zu berechnen. Dazu klicken wir im MetaTrader hier oben auf diesen kleinen Button oder drücken die F4 Taste, den MetaEditor aufzurufen. Klicken auf Datei neu, Expert Advisor von Vorlage, weiter, vergeben den Namen simpler Momentum Roboter, klicken auf weiter, weiter fertigstellen und entfernen alles oberhalb der OnTick-Funktion und diese beiden Kommentar Zeilen. Wie so oft brauchen wir hier als allererstes ein Array, also eine Sammlung gleichartiger Variablen.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL DEUTSCH – SIMPLER DOUBLE EXPONENTIAL MOVING AVERAGE

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Dec 3, 2023 7:04


  Das, was hier auf dem Bildschirm läuft und kaufen und verkaufen anzeigt, das ist ein in MQL5 enthaltener Indikator mit dem Namen Double Exponential Moving Average. Der erzeugt hier bestimmte Werte. Und immer wenn der exponentielle gleitende Durchschnitt oberhalb des aktuellen Kursverlaufs ist, konkret wenn er sich oberhalb der Schluss-Kurse der letzten Kerzen befindet, dann bekommen wir ein Signal zu verkaufen. Im anderen Fall, der gleitende Durchschnitt bewegt sich unterhalb der Schluss-Kurse, dann ist das ein Kauf-Signal. Wie können wir jetzt einen Expert Advisor erstellen, der in der Lage ist, diesen doppelten exponentiellen gleitenden Durchschnitt zu handeln? Um das zu tun, klicken Sie bitte im MetaTrader auf diesen kleinen Button hier oder drücken die F4 Taste. Das ruft dann hier das Fenster für den MetaEditor auf und hier klicken wir auf Datei neu Expert-Advisor aus Vorlage, weiter. Ich vergebe hier mal den Namen Simpler Double Exponential Average, klicke auf weiter, weiter fertigstellen und jetzt kann man alles löschen, was sich oberhalb der OnTick Funktion befindet und auch die zwei Kommentar Zeilen können weg. Und zunächst einmal brauchen wir ein sogenanntes Array. Mit MQL Rates können wir uns eines erstellen. Das bekommt hier den Namen Preis-Information und es wird zunächst einmal mit Array set as series von der aktuellen Kerze an abwärts sortiert. Und danach nutzen wir die MQL5 Funktion Copy Rates, um die Preis Daten in das Array zu kopieren. Copy Rates benötigt einige Parameter. Darum übergeben wir hier das aktuelle Währungspaar, die auf dem Chart eingestellte Periode. Ich handle in der Regel mit einer Minute, aber viele Leute nutzen auch das 30 Minuten oder das Stunden Chart. Wir fangen bei der aktuellen Kerze null an. Das ist immer die letzte Kerze, die gerade entsteht. Das hier wäre dann Kerze eins, Kerze zwei, Kerze drei und so weiter. Wir benötigen die Daten für drei Kerzen und speichern sie in unserem Array Preis Informationen, das wir hier oben erstellt haben. Und damit hätten wir schon mal die Informationen über die Preise. Jetzt brauchen wir noch ein Array. Das wird benötigt, um den gleitenden Durchschnitt Expert Advisor mit Daten zu füllen. Deswegen geben wir ihm auch den Namen Mein gleitender Durchschnitt Array und definieren im nächsten Schritt mit Hilfe der eingebauten MQL5 Funktion IDEMA, dass wir gerne einen doppelten exponentiellen gleitenden Durchschnitt nutzen möchten. Den nutzen wir für das aktuelle Währungspaar auf dem Chart und die auf dem Chart eingestellte Zeiteinheit. Als Berechnungsgrundlage nutzen wir 14 Kerzen. Denn wenn Sie im MetaTrader auf Einfügen, Indikatoren, Tendenz, Double Exponential Moving Average klicken, dann sehen Sie hier in den Eigenschaften, dass auch hier 14 Kerzen als Standardwert zugrunde gelegt werden.   Die Verschiebung ist null und berechnet wird auf den Schluss-Kurs, also den closed-Preis einer Kerze. Und genau aus diesem Grund nutzen wir auch hier eine Null für den Wert der Verschiebung und price_close, den Schluss-Kurs zugrunde zu legen. Auch dieses Array müssen wir von der aktuellen Kerze an abwärts sortieren. Dazu nutzen wir erneut Array set as series und das Ganze mit Daten zu füllen, nutzen wir wieder Copy Buffer für unseren definierten EA, mit dem Namen Definition gleitender Durchschnitt, den wir hier oben berechnet haben. Diese Null hier steht für die erste und einzige Linie in unserem Indikator, die zweite Null für die aktuelle Kerze. Wir benötigen Preis-Daten für drei Kerzen, deswegen diese drei. Und der letzte Parameter ist unser Ziel. Und das ist mein gleitender Durchschnitt Array. Nachdem wir das getan haben, sind wir in der Lage,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Gleitender Durchschnitt Crossover

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Nov 28, 2023 6:52


Einführung in Exponentielle Gleitende Durchschnitte (00:00 – 00:24) Einführung in die Programmierung eines Expert Advisors, der zwei exponentielle gleitende Durchschnitte verwendet, um Handelssignale zu generieren, basierend auf deren Überschneidungen. Berechnung der Gleitenden Durchschnitte (00:24 – 00:37) Erklärung, wie die gleitenden Durchschnitte berechnet werden: Ein Durchschnitt basiert auf 50 Kerzen, der andere auf 20 Kerzen. Erkennung von Kauf- und Verkaufssignalen (00:37 – 01:00) Demonstration, wie eine Überschneidung der gleitenden Durchschnitte als Kauf- oder Verkaufssignal interpretiert wird. Erstellung eines Expert Advisors im MetaEditor (01:00 – 01:46) Anleitung zur Erstellung eines neuen Expert Advisors im MetaEditor, benannt „Simple Gleitender Durchschnitt Crossover“. Einrichten der Arrays für die Gleitenden Durchschnitte (01:46 – 02:12) Erklärung, wie Arrays für die beiden gleitenden Durchschnitte erstellt werden. Definition der Eigenschaften für die Gleitenden Durchschnitte (02:12 – 03:10) Schritt-für-Schritt-Anleitung zur Definition der Eigenschaften für beide gleitenden Durchschnitte. Berechnung der Gleitenden Durchschnitte (03:10 – 04:01) Anleitung zur Berechnung der Werte für die gleitenden Durchschnitte und Speicherung in den definierten Variablen. Logik zur Erkennung von Überschneidungen (04:01 – 05:18) Implementierung der Logik zur Erkennung von Überschneidungen der gleitenden Durchschnitte und Ausgabe der entsprechenden Handelssignale. Kompilieren und Testen des Expert Advisors (05:18 – 06:00) Anleitung zum Kompilieren des Expert Advisors und Testen im MetaTrader mit dem Strategie-Tester. Demonstration des Expert Advisors im MetaTrader (06:00 – 06:28) Demonstration des Expert Advisors im MetaTrader, Anzeige der Kauf- und Verkaufssignale bei Überschneidungen der gleitenden Durchschnitte. Zusammenfassung und Anwendung der Strategie (06:28 – 06:41) Zusammenfassung des Gelernten und Anleitung zur Programmierung der Crossover-Strategie mit zwei sich überschneidenden gleitenden Durchschnitten in MQL5. In diesem Video lernen Sie, wie Sie einen Expert Advisor programmieren, der Handelssignale basierend auf der Überschneidung von zwei exponentiellen gleitenden Durchschnitten generiert. In diesem Video lernen Sie, wie Sie einen Expert Advisor programmieren, der Handelssignale basierend auf der Überschneidung von zwei exponentiellen gleitenden Durchschnitten generiert. Sie haben es sich gewünscht, also machen wir es auch. Einer unserer englischsprachigen YouTube-Subscriber hat geschrieben, er möchte gerne einen Expert-Advisor, wo sich zwei exponentielle gleitende Durchschnitte überschreiten, programmieren, aber er steckt fest. Und er wollte wissen, ob ich ein Video dazu machen kann. Klar, das, was Sie hier sehen, sind zwei sich überkreuzende gleitende Durchschnitte. Dieser hier wird auf 50 Kerzen und dieser hier auf 20 Kerzen zurückgerechnet. Wenn es zu einer solchen Überschneidung hier kommt und der 20er den 50er Moving Average schneidet, dann wird das als Kauf-Signal angesehen. Und wie man sieht, ist in diesem Fall der Kurs auch gestiegen. Lassen wir das mal einige Kerzen weiterlaufen. Hier haben wir den anderen Fall. Es kommt zur Überkreuzung. Und jetzt liegt der 50 Kerzen Durchschnitt über dem 20 Kerzen Durchschnitt. Dann bekommen wir hier oben Verkaufen angezeigt, weil der Kurs jetzt nach unten geht. Immer wenn sich die beiden Linien hier überschneiden, wechselt hier oben der Text. Wie kann man das jetzt als Expert Advisor programmieren? Dazu rufen wir hier oben über diesen kleinen Button oder mit der F4 Taste den MetaEditor auf.

MQL5 Tutorial
MQL5 Tutorial – Simple Chart Objects

MQL5 Tutorial

Play Episode Listen Later Nov 23, 2023 6:37


  Introduction to Creating Simple Chart Objects in MQL5 (00:00 – 00:34) Introduction to the tutorial on creating simple objects like arrows on the chart each time a tick comes in, using MQL5. Opening MetaEditor and Creating a New File (00:34 – 01:05) Instructions on opening MetaEditor, creating a new Expert Advisor file named “Simple Chart Objects”. Setting Up the Code Structure and Creating Price Array (01:05 – 01:39) Deleting unnecessary code and creating an array for price information using MQL rates. Sorting the Array and Filling with Price Data (01:39 – 01:52) Sorting the array downwards and filling it with price information for the current chart and period. Creating a Static Counter and Drawing Arrows (01:52 – 02:25) Creating a static counter and using it to draw arrows on the chart with ‘ObjectCreate’. Configuring the Arrow’s Appearance and Position (02:25 – 03:08) Setting the arrow’s type, color, and width, and positioning it at the highest point of the current candle. Changing Arrow Appearance with Counter Value (03:08 – 03:42) Changing the arrow’s appearance based on the value of the static counter. Setting Arrow Color and Size (03:42 – 04:23) Configuring the arrow’s color to green and increasing its size. Moving the Arrow and Displaying Counter Value (04:23 – 04:57) Moving the arrow to the highest price of the current candle and displaying the counter value on the chart. Incrementing the Counter for New Symbols (04:57 – 05:17) Increasing the counter by one for each new tick, resulting in different symbols on the chart. Compiling the Code and Testing in MetaTrader (05:17 – 05:51) Compiling the code and testing the Expert Advisor in MetaTrader using the Strategy Tester. Observing Dynamic Symbols on the Chart (05:51 – 06:11) Watching the changing symbols on the chart during the test and understanding how to print dynamic symbols using MQL5.   This time we are going to create simple objects. Each time a tick comes in, one of these objects will be painted here. Usually you will see things like arrows up and down, but actually there are a lot of more possibilities for such an arrow symbol. Everything you see here is called an arrow even if it doesn’t look like one. Now how can we create an Expert Advisor in MQL5 that is going to draw objects like these? To do that, please click on the little button here or press the F4 key on your keyboard. And that will bring up your MetaEditor window and here you want to select File, New, Expert Advisor from Template, Continue. I will call it SimpleChartObjects here, Continue, Continue and finish. And now you can delete everything above the OnTick function and the two comment lines here. And first we need an array for prices, we can create one by using MQLrates and it will have the name Price Information, now we are going to sort the array downwards from the current candle by using arraysetasseries and by using copyrates we are going to fill the price information array for the current chart and the period selected on the chart from the current candle zero for all the bars on the chart and store the values in our array. And now we are going to create a static counter, it will be an integer with the name i, and we will use that value to actually create an arrow with the name MyArrow. Please remember in MQL 5 an arrow can look like a circle or a square or anything else. So we use ObjectCreate for the current chart and our object will have the name MyArrow and we use OBJ_Arrow to create it. The next parameter would be a sub window; we will use a zero here because we are going to create the arrow here in the main window. You might have seen indicators that use a sub window below. We will use the current time and the arrow should be placed on the highest point of the current candle in our price information array we have created here. And with object set integer for the current chart, and the object, my arrow, we use OB J Prop_Arrow Code, and the value of the static counter to change how our object looks. Currently we have the value 179 and as soon as that changes to 180 the arrow code changes and so does the way our arrow looks. And for 181 our arrow would look like this; let’s select a color here, that is done by using objects set integer for the current chart for the object with the name My Arrow and we use OBJ_Prop_Color and we would like to have the color green. If you press F1 on your keyboard you will see a lot of other colors that you can use. To make our object a little bit bigger we’re using object set integer for the current chart for the object with the name MyArrow and we use the OBJProp_Width to set the size to 20. And now we move the object by using ObjectMove for the current symbol and for the object with the name MyArrow on the main window we used, for the current time and we move it to the highest prize of the current candle. I would actually like to have a chart output for the current counter value so we use comment to output the text “i has the value” followed by the current value of the static integer variable i. And in the last step we are going to increase our counter by one, that is done with I++ and now the next time a tick comes in we should see another symbol on the chart. Okay that’s it; let's compile the code here and that worked without any errors. So please click on the little button here or press F4 on your keyboard to go back to MetaTrader. And in MetaTrader click on View, Strategy Tester or press control and R to bring Not sure what to do? Click on the automated trading assistant below How to create a chart object with MQL5 How to create a label object with MQL5 MQL5 TUTORIAL - SIMPLE ON BALANCE VOLUME How to create a line object in MQL5 MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR The post MQL5 Tutorial – Simple Chart Objects appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler Standard Deviation Robot mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Nov 18, 2023 4:11


Mit MQL5 und Metatrader 5 wird der Standard Deviation Indikator geliefert, der dazu genutzt werden kann, mögliche Kursänderungen im Forex Trading auf dem Chart vorauszusagen, denn er berechnet die durchschnittliche Kursbewegung der letzten X Kerzen und schlägt aus, sobald sich der Kurs überdurchschnittlich stark bewegt… Das was hier im Hintergrund läuft, ist der so genannte Standard Deviation Indikator. Der vergleicht aktuelle mit historischen Kursbewegungen und soll helfen, eine Wahrscheinlichkeit zu berechnen, die Auskunft darüber gibt, ob der Kurs jetzt steigen oder fallen wird. Die grundsätzliche Idee dabei ist, über einen Zeitraum in diesem Fall von 20 Kerzen zu messen wie stark sich der Kurs entwickelt und je höher der Indikatorwert ist, desto höher ist die Wahrscheinlichkeit einer Kursumkehr. In diesem Fall hat das gepasst. Wie können wir jetzt einen solchen Indikator als Expert Advisor in MQL programmieren? Dazu klicken wir zunächst hier oben auf diesen Button oder drücken die F4-Taste. Das ruft den Metaeditor auf und hier klicken wir auf Datei, Neu, Expert Advisor von Vorlage, Weiter und vergeben hier den Namen SimplerStandardDeviationEA, klicken auf Weiter, Weiter, Fertigstellen und löschen jetzt alles oberhalb der Ontick-Funktion und diese beiden Kommentarzeilen hier. Gut, das erste was wir jetzt benötigen ist ein Array f+r unsere Preisdaten. Das ist vom Wert double, damit es Nachkommastellen verarbeiten kann und trägt den Namen STDDEVArray. Im nächsten Schritt definieren wir jetzt die Eigenschaften für unseren Indikator. Die wird uns für das aktuelle Währungspaar auf dem Chart und die aktuell eingestellte Zeitperiode also beispielsweise für das Minutenchart, auf einer Basis von 20 Kerzen ohne eine Verschiebung nach rechts oder links zu benutzen für den SMA die Werte für die Schlusskurse berechnen. Danach benutzen wir die Funktion ArraySetAsSeries um unser STDDEV-Array abwärts von der aktuellen Kerze zu sortieren. Und dann füllen wir mit CopyBuffer, laut unserer Definition die wir hier oben getroffen haben, unser Array für die einzige benötigte Linie die wir brauchen von der aktuellen Kerze abwärts für drei Kerzen. Und nachdem wir die Preisdaten mit CopyBuffer in unser Array kopiert haben, berechnen wir für die aktuelle Kerze, das ist hier diese Kerze 0, aus unserem Array den entsprechenden Wert. Und im letzten Schritt fehlt natürlich noch die Chartausgabe, die wird den Text STDDEVWert und den von uns berechneten Wert direkt links oben auf dem Chart ausgeben. Okay, kompilieren wir unseren Expert Advisor. Das hat ohne Fehler und Warnungen funktioniert, also können wir mit diesem kleinen Button hier oben oder mit der F4 Taste in den Metatrader wechseln. Im Metatrader selbst klicken wir auf Ansicht, Strategietester oder drücken die STRG und die R-Taste. Danach wächlen wir hier die Datei SimplerStandardDeviationEA.ex5 aus und starten unseren Test. Und so sieht das ganze aus. Wie man sieht stimmt der Wert hier unten mit dem von uns berechneten Wert hier oben überein. Okay, Sie haben gelernt, wie man in weniger als 5 Minuten einen Expert Advisor für die Standard Deviation berechnet, den man mit anderen Indikatoren für die Ermittlung eines Einstiegssignals nutzen kann. Und Sie haben das mit wenigen Programmzeilen in MQL5 selber programmiert! Nicht sicher was Sie tun sollen? Klicken Sie auf den automatischen Trading Assistenten unten

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial Deutsch – Simpler Label Objekt Trading Robot

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Nov 11, 2023 6:50


Mql5 ist ja eine objektorientierte Sprache und in diesem Beispiel möchten wir einmal ein solches Objekt erstellen. Das hier oben ist ein Label oder in unserem Fall haben wir es Textobjekt genannt und es zeigt uns in einer bestimmten Schriftgröße und einer bestimmten Schriftart den aktuellen Ask Preis an. Solche Objekte zu erstellen ist gar nicht schwer. Neben den Textobjekten gibt es auch Linien, Pfeile oder sonstige Dinge, die man direkt auf dem Chart ausgeben kann. Wie aber lässt sich ein solches Objekt erstellen damit wir es in unseren Expert Advisor einsetzen können? Dazu klicken wir hier oben auf diesem kleinen Button oder drücken die F4 Taste. Das ruft dann hier den MetaEditor auf und im MetaEditor klicken wir auf Datei –Neu – Expert Advisor aus Vorlage – weiter. Hier vergeben wir den Namen SimplesObjektLabel, klicken auf weiter – weiter – fertig stellen und jetzt kann alles oberhalb der Ontick Funktion hier gelöscht werden. Auch die Kommentarzeilen werden entfernt und da wir ja etwas brauchen, dass unser Label anzeigen kann, holen wir uns im ersten Schritt den Ask Preis. Der Ask Preis ist der Preis, der gefordert wird wenn wir eine Position kaufen wollen. Wir holen uns den aktuellen Ask Preis über SymbolInfoDouble. Das liest für das aktuelle Währungspaar mit dieser Konstante SYMBOL ASK den aktuellen Preis aus und mit dieser Konstante hier – digits – bekommen wir die passende Anzahl von Nachkommastellen, denn wie man hier sieht, gibt es Währungspaare mit drei Nachkommastellen und hier gibt es welche mit 5 Nachkommastellen. Und jetzt setzen wir die Objekteigenschaften für unser Textobjekt ein. Wir erstellen also ein Objekt mit ObjectCreate für das aktuelle Währungspaar, es soll den Namen TextObjekt bekommen. Und mit OBJ_LABEL sagen wir Mql5, dass wir gerne einen Text bearbeiten möchten. Wenn wir an dieser Stelle F1 drücken dann sieht man, dass es auch massenweise andere Objekttypen gibt. Das hier beispielsweise wäre ein Pfeil nach oben, das hier ist unser Label und das hier wäre beispielsweise ein Button und die Arrow Funktion hier kann einen Pfeil nach oben oder unten erzeugen. Wir benötigen kein separates Fenster, also nehmen wir für diesen Parameter eine 0, wir sind auch nicht zeitbezogen und unser Objekt muss auch nicht an einer bestimmten Stelle für einen Preis angezeigt werden. Also stellen wir auch das auf Null und danach wählen wir uns eine entsprechende Schriftart aus. Das geht mit der Funktion ObjectSetString, für das aktuelle Währungspaar und unser TextObjekt und mit OBJPROP_FONT setzen wir die Schriftart auf Arial. Danach setzen wir die Schriftgröße ein mit der Funktion ObjectSetInteger für das aktuelle Währungspaar und für unser TextObjekt nutzen wir die konstante OBJPROP_FONTSIZE und entscheiden uns für eine Schriftgröße von 24. Damit unser Label was anzeigen kann, setzen wir jetzt noch den Text ein. Das geht wieder mit ObjectSetString für das aktuelle Währungspaar und für unser TextObjekt nutzen wir die konstante OBJPROP_TEXT und geben hier den Text Ask Preis und den Ask Wert aus den wir hier oben in der Variable berechnet haben. Jetzt bestimmen wir noch die Position, die Distanz vom linken Rand soll 5 sein, das setzen wir mit ObjectSetInteger für das aktuelle Währungspaar und unser TextObjekt mit OBJPROP_XDISTANCE auf den Wert 5. Und die Distanz von oben setzen wir genauso, nur in diesem Fall nutzen wir OBJPROP_YDISTANCE für die y-Achse und hier verwenden wir mal den Wert 10. So, das war‘s auch schon. Jetzt kompilieren wir unseren Expert Advisor indem wir hier oben auf den kleinen Button oder auf die F7 Taste drücken und der Compiler warnt uns,

MQL5 Tutorial
MQL5 TUTORIAL – HOW TO CREATE A SHIFTED MOVING AVERAGE

MQL5 Tutorial

Play Episode Listen Later Nov 10, 2023 2:45


  Introduction to Shifted Moving Average Indicator (00:00 – 00:11) Introduction to the concept of a shifted moving average, which projects one moving average into the future. Setting Up the MQL5 Code (00:11 – 00:18) Overview of the MQL5 code setup, including the creation of a string variable named ‘signal’ for storing trading signals. Declaring Moving Average Arrays (00:18 – 00:27) Declaring two arrays, ‘my moving average array’ and ‘my shifted average array,’ to store values of moving averages. Defining Two Moving Averages (00:27 – 00:46) Using the ‘IMA’ function to define two moving averages: a 50-period simple moving average and another 50-period SMA with a 20-period shift. Sorting Arrays and Copying Values (00:46 – 01:08) Sorting the arrays in descending order and using ‘CopyBuffer’ to copy the last three values of both moving averages into their respective arrays. Calculating Moving Average Values (01:08 – 01:15) Calculating and storing the values of the current candle for both moving averages. Generating Trading Signals (01:15 – 01:32) Generating buy or sell signals based on the comparison of the moving average values. Displaying Trading Signal on Chart (01:32 – 01:43) Using the ‘Comment’ function to display the current trading signal on the chart. Conclusion and Further Learning Resources (01:43 – 02:18) Concluding remarks on the functionality of the code and suggestions for further learning through other videos or a premium course.   In this video, we are going to take a look at this indicator here. It’s a shifted moving average, which means that we use one moving average and project the results into the future. Let’s see how we can do something like this with MQL5. In this MQL5 code, a string variable named signal is created to store the trading signal.   This signal will be either buy or sell. Two arrays, my moving average array and my shifted average array are declared. These arrays will store values of moving averages. Two moving averages are defined using the IMA function. Moving average definition calculates a 50-period simple moving average using the closing prices of the current symbol and period. Shifted average definition calculates another 50-period SMA, but with a 20-period shift applied. The array set as series function is used to sort the my moving average array and my shifted average array in descending order. The copy buffer function is used to copy the last three values of both moving averages into their respective arrays. The values of the current candle for both moving averages are calculated and stored in my moving average value and my shifted average value.   Trading signals are generated based on the comparison of these moving average values. If my moving average value is greater than my shifted average value, it sets signal to buy. If my moving average value is less than my shifted average value, it sets signal to sell. The current trading signal, buy or sell, is displayed on the chart using the comment function. This code calculates two moving averages, compares their values, and generates a buy or sell signal based on the comparison. It then displays the current trading signal on the trading chart for reference.   Okay, by now you should have a working version of this indicator on your chart. I hope everything went well. If it was too fast for you or if you have no idea what all the code does, you maybe want to watch one of the other videos or maybe even the premium course on our website might be interesting for you. For now, I say thank you for watching and I will see you in the next video. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR MQL5 Tutorial Classics - Simple Moving Average Robot… MQL5 TUTORIAL BASICS - 114 SIMPLE SHIFTED PRICE EA MQL5 TUTORIAL - SIMPLE SIGNAL STACKING How to create an Adaptive moving Average EA with MQL5 The post MQL5 TUTORIAL – HOW TO CREATE A SHIFTED MOVING AVERAGE appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler RSI Robot mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Oct 31, 2023 4:44


  Okay, Sie haben danach gefragt, also mache ich es auch. Ein YouTube Abonnent mit dem Namen Kasteren hat sich gewünscht. Ich möchte doch einmal ein Video über den RSI Indicator machen. Und hier sind wir auch schon. Der RSI oder relative Strength Index wird sehr häufig genutzt, um zu prüfen, ob der Markt überverkauft oder überkauft ist. Wenn beispielsweise der Preis oberhalb dieser 70% Marke liegt, dann ist das ein Zeichen dafür, einen Short Trade zu eröffnen. Falls aber der Preis von unten die 30% Marke des RSI überschreitet, dann würde man einen Buy Trade eröffnen. Zeigt man mit der Maus hier auf das Ende der Linie, dann sieht man hier einen Wert von 39,49 und dieser Wert wird auch hier oben angezeigt. Jetzt sind wir bei 36, 22 und auch das passt. Wenn man den Wert hat, kann man also darüber entscheiden, ob man einen Einstieg in die eine oder in die andere Richtung starten möchte. Wir möchten für die Berechnung dieses Wertes jetzt einen einfachen Expert-Advisor schreiben. Dazu klicken wir hier oben auf dieses Symbol oder drücken die F4 Taste, um den MetaEditor aufzurufen. Im MetaEditor selbst klicken wir auf Datei, neu, Expert Advisor aus Vorlage, weiter. Hier vergeben wir den Namen Simpler RSI, klicken auf weiter, weiter fertigstellen und löschen alles oberhalb der OnTick Funktion. Auch diese beiden Kommentar Zeilen hier benötigen wir nicht. Das erste, was wir benötigen, ist ein Array, der unsere Preis Daten aufnehmen kann. Also erstellen wir ein Array mit dem Namen MyRSI Array. Im zweiten Schritt definieren wir die Eigenschaften unseres RSI Indicators. Er bekommt den Namen myRSI Definition. Wir verwenden die Funktion iRSI für das aktuell ausgewählte Währungspaar und den auf dem Chart aktuell ausgewählten Zeitrahmen. Unsere Berechnung soll für 14 Kerzen gelten und als Grundlage für die Berechnung möchten wir gerne die Schluss-Kurse nutzen. Im nächsten Schritt sortieren wir unseren Array von Kerze null, also der aktuellen Kerze an abwärts. Und mit der Funktion Copy Buffer füllen wir unser Array für drei Kerzen von der aktuellen Kerze an mit den von uns definierten Daten für den RSI. Diese Null hier bedeutet, wir haben einen einzigen Buffer, also nur eine Linie, die es zu berechnen gilt, da der RSI nur diese eine Linie hat. So, jetzt möchten wir natürlich auch noch unseren RSI Array abfragen, und zwar für die aktuelle Kerze und weisen den errechneten Wert unserer Variable myRSI Wert zu. Und im letzten Schritt möchten wir noch auf unserem Chart mit dem Comment Befehl den Text myRSI Wert und den errechneten Wert aus dieser Zeile ausgeben. Kompilieren wir unseren kleinen Expert-Advisor doch einmal. Das funktioniert ohne Fehler und ohne Warnungen. Also wechseln wir zurück in den MetaTrader, indem wir diesen Button hier oben oder die F4 Taste drücken. Im MetaTrader selbst klicken wir auf Ansicht, Strategie Tester oder nutzen STRG und R, um diesen Strategie Tester hier unten aufzurufen. Hier wählen wir das Programm Simpler RSI. Ex5 aus. Bitte setzen Sie auch den Haken hier für die Visualisierung und starten Sie Ihren Test. So, und wie man sehen kann, ist der Wert hier übereinstimmt mit dem, was errechnet wurde. Wir sind jetzt bei 83,3. Ich pausiere hier mal. 84.30, 84.3. Das stimmt auch mit der Anzeige hier unten überein. Und wie man sieht, stimmt der Wert hier auch noch. So, das war es schon. Sie haben in diesem Video gelernt, wie Sie aufgrund des RSI Indicators berechnen können, ob Sie einen BUY oder einen SELL Trade eröffnen möchten. Und das alles funktioniert mit diesen paar Zeilen.  

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler Gleitender Durchschnitt mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Oct 28, 2023 7:37


Wenn Sie sich einmal mit Markt-Technik, dem sogenannten Charting beschäftigt haben, dann haben Sie mit Sicherheit auch schon einmal so einen gleitenden Durchschnitt wie hier auf dem Bildschirm entweder gesehen oder vielleicht sogar selbst genutzt. Ein gleitender Durchschnitt ist eine Linie, die nichts anderes tut, als den durchschnittlichen Wert über eine bestimmte Kerzen-Anzahl bildlich darzustellen. Wenn wir den gleitenden Durchschnitt und unsere Simulation hier einmal stoppen, dann sehen wir, dass hier oben in der Ecke ein Wert ausgegeben wird. Es handelt sich die Zahl 0.9950625. Und wenn wir die Maus kurz hier über den aktuellen Wert des gleitenden Durchschnitts halten, dann sehen wir eine Zahl von 0.99503. Lassen wir das kurz weiterlaufen. Jetzt sehen wir 0.995023. Das deckt sich mit dem Wert, der hier oben berechnet wird. Man kann jetzt in einem Expert-Advisor für den eigenen Trading Roboter die Werte des gleitenden Durchschnitts mit der aktuellen Kerze vergleichen. Das ist ganz nützlich, um die Einstiegs-Richtung zu bestimmen. Wenn der Kurs den gleitenden Durchschnitt von unten kreuzt, dann ist das ein Einstiegs-Signal, long zu gehen und zu kaufen. Und andersherum, wenn der Kurs von oben nach unten unseren gleitenden Durchschnitt überschreitet, dann wäre das ein Signal, zu verkaufen. Dieser gleitende Durchschnitt gilt für 20 Kerzen, wie man in den runden Klammern sehen kann. Man könnte aber hier über die Eigenschaften auch eine Kerze einstellen. In diesem Fall verbindet unser gleitender Durchschnitt die Schluss-Kurse einer Kerze immer mit den Schluss-Kursen der nächsten Kerze. Stellen wir die Eigenschaften einmal auf 100 Kerzen dann sieht das schon ganz anders aus. Und hier kann man in etwa erkennen, dass sich der Kurs einmal oberhalb und einmal unterhalb des Durchschnittes bewegt. Das bedeutet zum überwiegenden Teil, dass wenn der Kurs den Moving Average schneidet, es auch erst mal in die entsprechende Richtung weitergeht. Wie kann man jetzt einen solchen gleitenden Durchschnitt in MQL5 berechnen? Dazu klicken wir hier oben links auf diesen kleinen Button oder drücken die F4 Taste, den MetaEditor anzuzeigen. Im MetaEditor wählen wir Datei neu, Expert-Advisor aus Vorlage, klicken auf weiter, vergeben hier den Namen simpler, gleitender Durchschnitt, klicken auf weiter, weiter fertigstellen, entfernen alles oberhalb der OnTick Funktion und diese beiden Kommentar Zeilen. Und das erste, was wir benötigen, ist ein Array, also eine Sammlung von gleichartigen Variablen, die unsere Preis Daten aufnehmen werden. Wir vergeben hier den Namen MeinPreis Daten Array und es handelt sich eine Variable vom Typ Double. Diese beiden eckigen Klammern deuten darauf hin, dass wir eine Vielzahl solcher Variablen mit dem gleichen Namen und einer unterschiedlichen Zahl benötigen. So ein Array kann man sich vorstellen wie eine ganze Menge gleichgebauter Schubladen, die unterschiedliche Inhalte aufnehmen. Im nächsten Schritt wird unser gleitender Durchschnitt definiert. Wir hätten gerne einen SMA, einen simple moving Average und der wird mit der Funktion IMA für das aktuelle Währungspaar auf dem Chart in der aktuell auf dem Chart gewählten Zeiteinheit für die letzten 20 Kerzen mit Hilfe der Konstante Mode SMA für den Schluss-Kurs der jeweiligen Kerzen erstellt. Unsere nächste Zeile kopiert die Preis-Daten in die Definition von unserem gleitenden Durchschnitt. Da wir nur eine einzige Linie benötigen, kommt hier eine Null hin und wir möchten gerne von der aktuellen Kerze aus drei Kerzen rückwirkend die Preise in unser Preis-Daten-Array kopieren. Jetzt möchten wir noch die Berechnung für die aktuelle Kerze vornehmen,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler Parabolic SAR Robot mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Oct 26, 2023 6:21


Diesmal geht es einen Indikator, den die meisten Trader lieben. Man bezeichnet ihn als Parabolischen SAR Indikator, und er zeichnet solche Punkte. Erfunden wurde er von jemandem mit dem Namen J. W. Wilder Junior. Und potentiell soll er Umkehrpunkte in der Preisentwicklung des Marktes darstellen können. Tatsächlich sieht das ganz beeindruckend aus. Man sieht hier, dass es aufwärts ging bis zu dieser Stelle. Dann hat sich die Richtung plötzlich geändert. Die Punkte erscheinen oberhalb des Kurses und es geht die ganze Zeit abwärts mit der Preisentwicklung, bis sich plötzlich hier die Preisrichtung dreht. Und jetzt befinden wir uns in einem Aufwärtstrend. Wenn man mit der Maus über diesen letzten Punkt geht, dann sieht man, dass dort ein Wert von 1.505 1994 angezeigt wird. Das ist auch der berechnete Wert hier oben links in der Ecke. Und jetzt geht es um die Frage, wie kann man sich mit MQL5 einen Expert Advisor erstellen, der genau diesen Wert hier ausrechnet? Und man könnte dann im eigenen System schauen, ob dieser Wert unterhalb des Kurses liegt, das würde für einen Aufwärtstrend sprechen. Und wenn die Punkte oberhalb des aktuellen Preises liegen, dann ist es ein Abwärtstrend. Um einen solchen Indikator beziehungsweise Expert Advisor zu erstellen, klicken wir erst einmal hier oben auf diesen kleinen Button oder drücken die F4 Taste. Das ruft den MetaEditor auf, mit dem wir ein MQL5 Programm erstellen können. Hier klicken wir jetzt auf Datei, neu, wählen Expert Advisor aus Vorlage aus, klicken auf weiter und nennen unser Programm an der Stelle Simpler SAR. Jetzt klicken wir auf weiter, weiter fertigstellen und löschen alle Inhalte oberhalb der OnTick Funktion und diese beiden Kommentar Zeilen hier. Und wie so oft brauchen wir zuerst ein Array für unsere Preis Daten. Also erstellen wir ein Array vom Typ Double mit dem Namen MySAR Array. Danach nutzen wir die Funktion ISAR, die in MQL5 eingebaut ist, für das aktuelle Symbol, also das Währungspaar, was wir gerade auf dem Chart haben und die aktuell eingestellte Periode, also die Zeiteinheit, wie zum Beispiel das Minuten-Chart, unseren SAR-Indikator zu definieren. Diese beiden Werte erkläre ich auch noch kurz. Wenn wir mit F4 zurück wechseln in den MetaTrader, können wir über Einfügen, Indikatoren, Tendenz den Parabolic SAR Indicator auswählen und der hat hier einen Schritt und einen Maximumwert. Und wir möchten die Standardwerte für den Schritt 0.02 und für das Maximum 0.2 benutzen. Und das sieht dann in unserem Quelltext so aus. Jetzt sortieren wir unser Array absteigend von der aktuellen Kerze 0 abwärts. Dazu nutzen wir die Funktion Array set as series und im nächsten Schritt füllen wir mit der Funktion Copy Buffer unser erstelltes MySAR Array für die erste Linie des Indikators, da er nur eine Linie hat, von der aktuellen Kerze abwärts für drei Kerzen nach der von uns hier oben erstellten Definition mit Daten. Im nächsten Schritt möchten wir den SR-Wert für die aktuelle Kerze berechnen. Das machen wir, indem wir uns aus dem My SAR Array von der Kerze null den benötigten Wert holen. Wir möchten hier aber fünf Nachkommastellen haben. Diese Funktion normalize Double ermöglicht uns für den vor dem Komma stehenden Wert die nach dem Komma stehende Anzahl von Kommastellen für die Ausgabe zu wählen. Würde ich hier eine zwei nehmen, dann hätten wir nur zwei Nachkommastellen. Wir benötigen in diesem Fall fünf. Gut, im letzten Schritt geht es noch darum, unsere berechneten Werte mit dem Text MySAR-Wert und einem Doppelpunkt mit der Funktion Commen direkt auf dem Chart anzuzeigen. Kompilieren wir also unseren Expert Advisor einmal. Da ist ein Fehler.

MQL5 Tutorial
MQL5 TUTORIAL – HOW TO TRAIN AND SCALE A WORKING REAL WORLD TRADING SYSTEM

MQL5 Tutorial

Play Episode Listen Later Oct 21, 2023 9:49


  Introduction to Real World Trading System (00:00 – 00:14) Introduction to the robot trading system used by the presenter. Overview of the system’s performance and purpose. Analyzing Trading System Performance (00:14 – 00:29) Detailed look at the trading system’s results and trades. Discussion on the balance and equity of the system. Understanding Trade Impact and Emotions (00:29 – 01:06) Exploring the emotional impact of trade results. Difference between small and large losses. Trade History Analysis (01:06 – 01:20) Examination of the system’s trade history, including profits and losses. System Strategy and Position Series (01:20 – 01:39) Description of the trading strategy using position series. Explanation of closing positions at once. Decision Making in Trading (01:39 – 02:14) Criteria for deciding between single or multiple positions. Rules-based approach to trading decisions. Trend Analysis with Moving Averages (02:14 – 02:31) Using simple moving averages to identify market trends. Explanation of downtrend indicators. Trading With and Against Trends (02:31 – 02:58) Strategies for trading with the trend and handling corrections. Examples of trades that didn’t work out and why. Analyzing Correction Phases and Trends (02:58 – 03:29) Understanding correction phases in stable trends. Strategies for closing positions profitably. Future Decision Making in Trading (03:29 – 03:47) Challenges in predicting future market movements. Importance of decision making in trading. Using FXBlue for Detailed Statistics (03:47 – 04:17) Utilizing FXBlue for better trading statistics. Accessing detailed system performance data. System Performance and Statistics Overview (04:17 – 04:53) Comprehensive review of the trading system’s performance. Analysis of winners, losers, and total trades. Trade Analysis and Currency Focus (04:53 – 05:10) Breakdown of trade types and currency pairs used. Emphasis on trading in a downtrend. Scaling Up the Trading System (05:10 – 05:28) Considering increasing the trading volume. Evaluating the system’s readiness for scaling. Average Trade Duration and Profitability (05:28 – 06:05) Analysis of average trade duration and profitability. Importance of balancing profitable trades with losses. Understanding Trading Costs and Spreads (06:05 – 06:36) Discussion on swap fees and spread costs in trading. Impact of broker charges on trading profitability. Market Trend Analysis and Moving Averages (06:36 – 07:04) Using moving averages to analyze market trends. Indicators of trend changes and their implications. Automating Trading Logic with MQL5 (07:04 – 07:33) Simplifying trading decisions through automation. Using MQL5 for implementing trading strategies. Backtesting and Real-Time Testing (07:33 – 08:04) Importance of backtesting and real-time demo account testing. Evaluating system performance in different market phases. Scaling Up and Risk Management (08:04 – 08:21) Strategies for scaling up the trading system. Adjusting risk percentage and position size. Training and Analyzing Trading Systems (08:21 – 08:51) Training a system for real-world conditions. Using external tools for performance analysis. Conclusion and Future Plans (08:51 – 09:22) Summary of the video and insights on scaling up the system. Invitation to analyze detailed stats on the website.   In this video we are going to talk about one of my real world examples. This is the robot trading system which actually use myself and one of my premium course members wanted to know how something like this works. So let’s have a look at the details. Well, if you have a look at the robot trading system, you can see this is Version 2023 from June. Right now we have the 20 first of October and here we have results and trades all in all we made a profit of 159 dollars and if we look at the overall view here we see that the balance currently is almost equal to the equity which means we only one open trade that is currently and open loss of 99 cents. So what is actually the difference between this trade and one that would be an open loss of 99 dollars? The difference is emotional because it’s not actually the number here that counts if a system is working or not, it’s what the difference means for us. So let’s have a look at the history and here we see that we have losses and we have profits, so not every trade was a success, but all in all the system result is stable, at least right now. If we zoom into the system, we can see these lines here which look like a fan and each of those is a series of positions that we have opened. And at this point here all positions have been closed at once. Let’s zoom in a little more and you will also see parts where we don’t see a fan, for example like here. And these are simple positions that made a profit without the need to start a series. So how do we decide if we just take one position or if we want to open multiple positions? Well in my case I have rules. And currently we are in a down trend, and we can see that because we have two simple moving averages here is for 1100 candles and the other one is for a thousand candles. And a long as the green one is below the red one, we have a downtrend and that looks pretty stable right now. And you can see that the last trades that we made have been sell trades, so we have been trading with the trend. But still we have some positions that didn’t work out. How was that possible? Well that’s because even in a stable trend we have some corrections. That’s when we open a position like here and then suddenly in a correction the price goes up. And if you take a closer look, this is the case for all these fans here. The price went down, than we made a trade here. Suddenly a correction happened and it went against us. But actually we have been able to still close all the positions from here to there in a profit at this point here. Because finally the short time trend again started to go with the main trend and the price went Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - PLATIN SYSTEM - SIMPLY GOOD PLATIN… MQL5 TUTORIAL - HOW TO STILL BENEFIT WHEN THE PRICE… MQL5 TUTORIAL - 99 NEW LIVE CROWD ALGO TRADING SYSTEM MQL5 TUTORIAL - REAL RESULTS YOU COULD HAVE ACHIEVED IN 2022 Robot Trading System - Free Expert Advisor Download… The post MQL5 TUTORIAL – HOW TO TRAIN AND SCALE A WORKING REAL WORLD TRADING SYSTEM appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE BOLLINGER BANDS EXPERT ADVISOR

MQL4 TUTORIAL

Play Episode Listen Later Oct 15, 2023 7:36


In this video, we are going to talk about an Expert Advisor that can tell you if you should buy or sell based on the Bollinger Bands indicator. The Bollinger Bands indicator has three bands. This is the lower band. This is the middle band, and this is the upper band. Whenever a candle closes above the upper band and reenters into the bands this is a signal for a sell trade. In the other case when the candle closes below the lower band and you see a reentry from below this is a buy signal. Usually you won't see the Bollinger Bands in your back-testing and to change this you can insert the Bollinger Bands indicator, we are going to use the period of 20 candles and deviation value of 2 because that is the standard when you click reset. Now click on ok. I will change the properties here because I like the bands to have the red color. No I right click on the chart, click on Template/Save Template. I will call this one: Bollinger Bands.tpl. Tpl stands for Template. Now let's save this and when you start a new back-test you simply need to right click the chart, select template, Bollinger Bands and here we are. Now we are going to create an Expert Advisor that can calculate Bollinger Bands entry signals. To do that please click on the little button here or press F4 in your Metatrader and now you should see Metaeditor and here you want to click on File/New/Expert Advisor (template) from template. Continue (Next). I'll call this one Simple Bollinger Bands. Continue (Next), Continue (Next), and Finish, and now you can delete everything above the OnTick() function and the two comment lines here. Now let's create an empty string for the signal. I'll call it signal and it has no value here, and to calculate the lower Bollinger Band we use the function iBands. iBands is a built-in function of MQL4 and it takes a few parameters. The first one is _Symbol; that's the symbol on the chart, the second parameter is _Period; that's the currently selected period on the chart, like the minute or the hour chart. We will use 20 candles and the deviation of 2 because that is what you see when you click on the Bollinger Bands properties. Period 20 candles, deviation 2, we have no shift and we apply it on the close price so the parameter for the shift is 0, and we use: PRICE_CLOSE for the close price and because this is the lower Bollinger Band we use MODE_LOWER and it will be calculated for candle 1. To calculate the upper Bollinger Band, you basically do the same but this time we use MODE_UPPER, everything else is like in this line. Candle 1 is the candle before the current candle, now when this candle isn't finished this would be candle 1, and this would be candle 2. To calculate the value for candle 2 we repeat those two lines here and now the only thing we need to change in the two new lines is the last parameter for candle 2. Let's calculate a buy signal. Now if the Ask price is above the close price of the last candle; that's candle[1] and if the close price for candle[2] was below the lower band. That's close 2 is below the value of the previous lower Bollinger Band and if the close price for candle[1] is above the lower band so that's close 1 is greater than lower Bollinger Band that would be a signal to buy. In the other case if the price is below the last close so if Bid is below close 1 and if close 2 was above the upper band so close 2 is above previous upper Bollinger Band and close 1 is below the upper band so the close price for candle[1] is now below the upper Bollinger Band that would be a crossing like here and that would be a sell signal so we assign the word: sell to our signal.

MQL5 Tutorial
MQL5 TUTORIAL – HOW TO CALCULATE THE HISTORY PROFIT

MQL5 Tutorial

Play Episode Listen Later Oct 3, 2023 2:56


  Introduction to Calculating Historical Profit (00:00 – 00:09) Introduction to creating an expert advisor for calculating historical profit for a specific currency pair. Overview of displaying the calculated profit on the chart. Starting with MetaEditor (00:09 – 00:16) Instructions on how to start the MetaEditor for coding the expert advisor. Brief mention of using the icon or pressing F4 on the keyboard. Including Trade Library and Creating CTrade Instance (00:16 – 00:31) Explanation of including the Trade.mqh library for trade operations. Creation of an instance of the CTrade class named ‘trade’ for executing buy and sell operations. Calculating Current Ask and Bid Prices (00:31 – 00:38) Description of calculating the current Ask and Bid prices within the OnTick function. Importance of these prices for executing buy and sell orders. Executing Buy and Sell Orders (00:38 – 00:46) Checking for less than two open positions before executing orders. Execution of both buy and sell orders for demonstration purposes. Calculating and Displaying Historical Profit (00:46 – 01:01) Use of the GetCurrencyPairHistoryProfit function to calculate historical profit. Displaying the calculated profit on the chart. Functioning of GetCurrencyPairHistoryProfit Function (01:01 – 01:09) Detailed explanation of how the function calculates total historical profit for a specific currency pair. Initializing Variables and Fetching Historical Data (01:09 – 01:17) Initialization of variables for storing deal information. Use of the HistorySelect function to fetch historical deal data. Iterating Through Historical Deals (01:17 – 01:25) Iteration through historical deals using a for loop. Obtaining profit, swap, and order type for each deal. Ensuring Matching Currency Pair for Deals (01:25 – 01:34) Checking the currency pair for each deal to match the current symbol. Compiling the Code and Further Learning Resources (01:34 – 01:49) Instructions on compiling the code in MetaEditor. Recommendation for the premium course or basic videos for further learning. Testing the Expert Advisor in MetaTrader (01:49 – 02:04) Returning to MetaTrader and starting the strategy tester. Selection of the created expert advisor and enabling visual mode for testing. Invitation for Premium Course Members (02:04 – 02:09) Invitation for premium course members to suggest ideas for new videos. Conclusion and Summary (02:09 – 02:24) Conclusion on how to calculate and display historical profit for a currency pair using MQL5. Emphasis on the functionality of the created expert advisor with minimal MQL code.   In this video, we are going to create an expert advisor that calculates the historical profit for a specific currency pair and displays it on the chart. Let’s see how we can do that. To begin, start the MetaEditor by clicking on the little icon or pressing F4 on your keyboard. The code starts by including the Trade.mqh library, which provides functions and methods for performing trade operations.   We then create an instance of the CTrade class called trade to execute trade operations like buying and selling. Inside the OnTick function, we calculate the current Ask and Bid prices for the symbol. These prices are essential for executing buy and sell orders. The code checks if there are less than two open positions. If true, it executes both a buy and a sell order.   This is just for demonstration purposes. The historical profit for the currency pair is calculated using the GetCurrencyPairHistoryProfit function and then displayed on the chart. The GetCurrencyPairHistoryProfit function calculates the total historical profit for the specific currency pair. Several variables are initialized to store information like the total number of deals, ticket numbers, order types, and profits. The HistorySelect function is used to fetch historical deal data. A for loop iterates through all the historical deals.   For each deal, the profit and swap for the deal are obtained, the type of order (buy or sell) is determined, and the currency pair for the deal is checked to ensure it matches the current symbol. Once you’ve written the code, press F7 to compile it. If this was too fast for you or if you don’t understand what all the code is doing, you may want to check out the premium course on our website or watch one of the basic videos first. After compiling, go back to MetaTrader by pressing F4 or clicking on the icon. In MetaTrader, press control and R to start the strategy tester.   Pick the expert advisor that we have just created, enable the visual mode, and start a strategy test. You should then see the expert advisor on the chart. If you’re already a premium course member and have an idea for a video like this one, please send us an email. In conclusion, you’ve now learned how to calculate and display the historical profit for a specific currency pair using MQL5. With just a few lines of MQL code, you’ve created a functional expert advisor. Thanks for watching, and I’ll see you in the next video! Not sure what to do? Click on the automated trading assistant below MQL5 Tutorial - Advanced Library Expert Advisor MQL5 TUTORIAL - 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE IVIDYA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – HOW TO CALCULATE THE HISTORY PROFIT appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE SAR EXPERT ADVISOR

MQL4 TUTORIAL

Play Episode Listen Later Sep 2, 2023 6:42


In this video we are going to create an Expert Advisor that uses the parabolic SAR indicator you see to create buy or sell signals here. Whenever these little dots here are below the current price, that would be a buy signal like right now, and when the direction changes like here and the dots appear above the price, that's a sell signal. Now how can we create an Expert Advisor that is able to produce buy and sell signals based on this indicator here? To do that please click on the little button over here or press F4 in your Metatrader. Now you should see the Metaeditor window here. Here you want to click on “File/ New/ Expert Advisor (template)” from template. Continue. I will call this one: Simple Parabolic SAR (SimpleParabolicSAR). Continue and finish. Now you can delete everything above the “OnTick” function and the two comment lines here. The first step is to create a string variable, we need it for the signal, so it's also called: “signal” and we do not assign any value here because we are going to calculate the value later on. Now let's actually calculate the SAR indicator, that is done by using the built in iSAR function. The first parameter will be the current symbol on the chart, the second parameter is the period, and you might ask yourself what these two values here mean? Well if you click on to: “Insert /Indicators /Trend /Parabolic SAR” you will see that the parabolic SAR indicator has a stat value of 0.02 and a max value of 0.2. This is actually what we use here 0.02 equals the step value and 0.2 equals the max value. The last parameter here is for a shift, but we don't want to shift the indicator value to the right or to the left so we use zero. Now let's find out if the SAR indicator is below the bid price because we know when it's below, that's an indicator for an uptrend and in MQL4 we simply use an “if” statement to find out if the SAR value we have calculated here is below the bid price. If that is the case that would be a buy signal, so let's assign the word “buy” to the variable signal we have created here. In the other case if the SAR indicator is above the ask price – that would be the case here – and it would be a little sell trend and to find out if that is the case we would use the “if” statement and find out if “MySARValue” is above the current ask price. In that case we would have a sell signal, so let's assign the word sell to the signal variable we have created. And last but not least we want to create a chart output, so we use the built-in command function to output the text: “MySARValue”, followed by the calculated value. This backslash “n” (“/n”) statement creates a new line for the output, and in the second line we want to output the word: “signal” followed by the calculated signal. Okay that's it! Don't forget the closing bracket here and when you are finished you can click on the compile button here or press F7 on your keyboard – Oh! I've accidentally out commented the “OnTick” function so let's recompile the code here, and now it says we don't have any errors and we have no warnings, and if that is the case for you, you can click on a little button here to go back to Metatrader. In Metatrader we use a little trick please click on “Insert /Indicators /Trend /Parabolic SAR”. Okay. Now right click into the template, select template, and save the template as: “tester.tpl” because the tester template is what Metatrader 4 is going to use for your back test. Let's click on save and select “View/ Strategy Tester” or press CTRL and R and in the Strategy Tester you want to select the “SimpleParabolicSAR.ex4” file. Don't forget to enable the visual mode here and now click on start.

MQL5 Tutorial
MQL5 Tutorial – Simple Order Cancel Order EA

MQL5 Tutorial

Play Episode Listen Later Sep 2, 2023 6:41


  Introduction to Order Cancels Order (OCO) System (00:00 – 00:09) Introduction to the concept of OCO, where one order’s execution cancels the other. Visualization of sell stop and buy stop orders on the chart. Understanding Orders and Positions (00:09 – 00:30) Explanation of the difference between an order and a position. How orders become positions when triggered by price movements. Creating an Expert Advisor in MetaEditor (00:30 – 01:01) Instructions on opening MetaEditor and starting a new Expert Advisor project. Naming the project ‘Simple Cancel Order.’ Setting Up the Expert Advisor (01:01 – 01:30) Removing unnecessary lines and importing the ‘trade.mqh’ file. Creating an instance of the CTrade class. Initializing Trading Parameters (01:30 – 02:05) Getting account balance, equity, ask, and bid prices. Normalizing prices for different currency pairs. Creating Buy Stop and Sell Stop Orders (02:05 – 03:28) Conditions for opening pending orders when no positions or orders exist. Setting up buy stop and sell stop orders with defined take profit points. Implementing Order Cancellation Logic (03:28 – 04:49) Checking for active trading and differing balance and equity values. Creating a function to cancel open orders. Compiling and Testing the Expert Advisor (04:49 – 05:32) Compiling the code in MetaEditor. Instructions for testing the Expert Advisor in MetaTrader. Visualizing the Expert Advisor’s Functionality (05:32 – 06:06) Observing the behavior of the Expert Advisor with pending orders in MetaTrader. Explanation of how the Expert Advisor cancels one order when the other is triggered. Conclusion and Summary (06:06 – 06:06) Recap of how to create a simple OCO Expert Advisor in MQL5. Emphasis on the ease of coding this functionality with a few lines of MQL5 code.   Today we want to talk about a system that is called OCO that is the short term for Order Cancels Order. If you look on our chart we have a sell stop here and we have a buy stop there and here is where the price is and if the price moves to the sell stop that would trigger a short position. And if the price rises and hits the buy stop we would have a long position. Now what’s the difference between an order and a position? You use an order if you want to open a position so you can place your orders in the market and if the price moves and hits your pending order it will become a position. You see that we have cancelled the other order now. It’s no longer here, so let’s find out how to create an Expert Advisor that can cancel pending orders. To do that please click on the little button here or press the F4 key and once you have done that piece click on File, New, Expert Advisor from Template, Continue. I will call it Simple Cancel Order, Continue, continue and finish and now you want to remove everything above the OnTick function and the two comment lines here. And to have anything to close we first need to import the file trade mqh by using the include function. We want to create an instance of the Class Ctrade and that will have the name trade. In the first step we need to get the account balance that is done by using account info double, Account_Balance. Now we need to get the equity by using account info double, Account_Equity and we also need the ask prize here we use symbol info Double_Symbol for the current chart and the constant Symbol_Ask. We also use normalized Double_Digits because we have currency pairs with five digits and other currency pairs with three digits and now we do exactly the same to get the bid price, but this time we use Symbol_Bid. Now if we have no open position and no order, so if positions total equals zero and if orders total also equals zero, we need to open a pending order for a buy stop and another one for the sell stop, the position size is ten micro lot. In both cases the buy stop order will be placed one hundred points above the ask price and the sell stop order will be placed one hundred points below the bid price. For the current symbol we have not defined a stop loss, the take profit is three hundred points above the ask price and two hundred, no let’s also use three hundred points below the bid price. We use other time GTC that means the order will stay until we cancel it, so we have no expiration time here. If we would use an expiration time we would use this parameter to define it and the last parameter here is for a comment but we don’t need that. If we are trading right now – that would mean that the balance has different value than our equity. We want to cancel the open orders so let’s create a function called cancel order. It's a void type because it doesn’t need to return any kind of value and here we use For Loop. It starts by using orders total minus one and until the value for the counter is zero that means as long as we have open orders it will go through all the open orders. We use order get ticket for the current order to find out the ticket number and it now will delete the pending orders by using Trade.OrderDelete for the order ticket that we have calculated here. And the last thing we need to do is to close the For Loop and the cancel order function. Now let's compile the code by clicking the little button here or pressing the F7 and that did actually work without any errors. So now please click here or press F4 to go back into Meta Trader. And in MetaTrader you want to click on View, Strategy Tester or press control and R, and here you want to select the Simple Cancel Order.ex5 file, select any currency pair and enable the visualisation mode. Not sure what to do? Click on the automated trading assistant below MQL5 Tutorial - Simple Sell Stop Expert Advisor Embrace the Power of an MQL5 Buy Order MQL5 TUTORIAL - HOW TO CALCULATE THE HISTORY PROFIT MQL5 Tutorial: How to get the Order History Profit MQL5 Tutorial - Advanced Library Expert Advisor The post MQL5 Tutorial – Simple Order Cancel Order EA appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 Tutorial – Advanced Library Expert Advisor

MQL5 Tutorial

Play Episode Listen Later Aug 27, 2023 6:41


    Introduction to Expert Advisor with Self-Defined Functions (00:00 – 00:14) Introduction to an expert advisor that opens buy stops and calculates profit on a chart. Explanation of using self-defined functions compiled in a library. Understanding Libraries in MQL5 (00:14 – 00:27) Explanation of what a library is in MQL5 and its purpose. How to create a library for reusable functions. Opening MetaEditor and Creating a Library (00:27 – 00:41) Instructions on opening MetaEditor from MetaTrader. Steps to create a new library in MQL5. Setting Up the Library File (00:41 – 01:01) Explanation of import statements and the structure of the library file. Introduction to the functions ‘getProfitCurrencyPair’ and ‘openBuyStop.’ Defining Functions in the Library (01:01 – 01:30) How to define custom functions in the library. Example of creating functions for opening buy stops and calculating profit. Initializing Variables and Importing Trade Functions (01:30 – 02:05) Setting up initial variables and importing necessary trade functions. Explanation of the ‘property library’ directive. Creating Self-Defined Functions (02:05 – 03:28) Detailed steps to create self-defined functions in the library. Example of a function to calculate profit for a currency pair. Implementing the Buy Stop Function (03:28 – 04:49) Creating a function to open buy stop orders. Explanation of parameters and conditions for the buy stop. Compiling and Testing the Library (04:49 – 05:32) Instructions on compiling the library in MetaEditor. How to test the library’s functionality in MetaTrader. Using the Library in an Expert Advisor (05:32 – 06:06) Demonstrating how to use the created library in an expert advisor. Visualizing the expert advisor’s behavior in MetaTrader. Conclusion and Summary (06:06 – 06:25) Recap of how to create and use a custom library in MQL5. Emphasis on the efficiency of using libraries for reusable code.     What you see here is an Expert Advisor that is opening buy stops and we have a calculated profit on the chart and it uses two self defined functions that we have compiled in a so called library. You can think of a library as a file that contains self defined functions that you can use again and again. Now how can we create such a library in MQL5? To do that please click on the little button here in your Meta Trader and now you should see the MetaEditor and this is our main module and we use these import statements here to import the file MyLibrary.ex5 and in that file we have a function called GetProfitCurrencyPair and another function called OpenBuyStop. And in the OnTick function we check if we have no open orders and if that is the case we want to OpenBuyStop so we call the self defined function OpeBuyStop from our library. And to calculate the profit we use the function GetProfitCurrencyPair and that’s also self defined in our library. And to create your own library please click on File, New, Library, Continue, this one is called myLibrary and now you can click on Finish. And the first thing we need is property library, without that you cannot compile the file and to be able to open the buy stops we need to import the trade functions from the built in trade.mqh file. And to get the profit of the current currency pair we need to create our self defined function and this extension 2export” is used because only a function with such a modifier is accessible for our MQL 5 programs. And in the function we declare a variable called ProfitThisCurrencyPair; it contains no value here and now we go through all the positions using this For Loop and we use PositionGetSymbol for the current counter and if the symbol on the chart equals the symbol of the currency pair from our position, we use PositionGetDouble, position_profit to calculate the position profit and position get double, position_swap to calculate the swap. Just add the two values up to get the profit of the currency pair. Let's end the For Loop and we use normalize double and two digits to calculate the profit for the currency pair and format it for two digits behind the dot, and afterwards we use return to return the profit for the currency pair back to the main module. Let’s add another function for the buy stop, it’s called OpenBuyStop and it also has the export extension and to open the buy stop we want to know the ask price, the balance and the equity. You can get the ask price by using SymbolInfoDouble for the current symbol and you use symbol_ask and with NormalizeDouble and _Digits we make sure that we have three digits for this currency pair or five digits for other currency pairs and to get the balance of the equity we use AccountInfoDouble, Account_Balance or AccountInfoDouble, Account_Equity. And if equity and balance are equal, we want to open a buy stop by using trade.buystop for 10 micro lots. The buy stop will be one hundred points above the ask price of the current symbol. We haven’t defined a stop loss, the take profit will be three hundred points above the ask price and we use Order_Time GTC because that is good until the order is cancelled so it will not expire and because of that we use a zero for the date/time and the last parameter would be for the comment, we don’t need that so we also use zero here. Let’s add the last bracket to close the function and press this little button or F7 on your keyboard to compile your library. I made a mistake here, of course I need to create an instance of Ctrade now that’s done and I recompile and this time it worked without any errors. So let’s click on the button here our press F4 to go back to MetaTrader. And in MetaTrader you want to click on View, Strategy Tester or press control and R, and in the Strategy Tester please select the file simpleLibraryMainModule.ex5 and please remember that you also have to Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - HOW TO CALCULATE THE HISTORY PROFIT MQL5 TUTORIAL - SIMPLE SAR STOCHASTIC STANDALONE… Create an MQL5 Expert Advisor with MQL5Tutorial.com MQL5 TUTORIAL - SIMPLE TRIPLE CANDLE STRATEGY How to combine the Parabolic SAR and the Stochastic… The post MQL5 Tutorial – Advanced Library Expert Advisor appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE EMA STOCHASTIC STANDALONE EXPERT ADVISOR

MQL4 TUTORIAL

Play Episode Listen Later Aug 11, 2023 3:51


  In this video, we are going to create an Expert Advisor that uses the Parabolic SAR and Stochastic Oscillator indicators to generate buy and sell signals in MetaTrader. Let's see how we can do that. First, start the MetaEditor. You can do this by clicking on its icon or simply pressing the F4 key. We begin with the #include directive to import the Trade.mqh library. This library provides us with essential trading functions. Following this, we create an instance of the CTrade class named trade. This instance will be our primary tool for executing buy and sell orders. Next, we calculate the current asking price using the Symbol Info Double function with the parameters Symbol and SYMBOL ASK. This gives us the price at which we can buy. To ensure precision, we use the Normalize Double function, inputting the price and Digits to adjust the number of decimal places. Similarly, we determine the bid price using the Symbol Info Double function with the parameters Symbol and SYMBOL BID. This is the price at which we can sell. This price is also normalized using the Normalize Double function. We then set up an array named Price Info of type Mql Rates. This array will store our price data for specific time periods on the chart. Within the On Tick function, we sort our Price Info array using the Array Set As Series function to prioritize the latest data. We then fill this array with price data for the current symbol and time frame using the Copy Rates function. Here, we're copying data for three candles, giving us a snapshot of recent price movements. The closing price of the most recent candle is then determined using the Price Info[0].close reference. We then call the Check Entry function. Inside this function, we use the Parabolic SAR indicator to check the current and previous values to determine if there's a buy or sell signal. If the current SAR value is below the current price and the previous SAR value was above the previous price, it suggests a buy signal. Conversely, if the current SAR value is above the current price and the previous SAR value was below the previous price, it suggests a sell signal. Additionally, the Check Entry Stochastic function is used to refine our signals. This function checks the Stochastic Oscillator values. If the K line crosses the D line from below in an oversold area, it suggests a buy signal. If the K line crosses the D line from above in an overbought area, it suggests a sell signal. With these signals in hand, the code decides whether to execute a buy or sell trade. If both the trading signal and the filter signal return a buy and there are no open positions, the trade.Buy function is used to buy 0.10, equivalent to 10 Micro Lot. If both signals return a sell, the trade.Sell function is used to sell 0.10 Microlot. Once you've input all the code, press F7 to compile it. If this was too fast for you or if you don't understand what all the code is doing, you might want to check out the Premium course on our website or watch one of the basic videos first. After a successful compilation, return to MetaTrader by pressing the F4 key or clicking on its icon. Once in MetaTrader, press Control and R to start the strategy tester. Select the Expert Advisor you've just created, enable the visual mode, and start a strategy test. You should then see the Expert Advisor in action on the chart. If you're already a Premium course member and have an idea for a video like this one, please send us an email. By the end, you'll have a deeper understanding of what you've learned and the Expert Advisor you've coded yourself with jus...

MQL5 Tutorial
MQL5 TUTORIAL – SIMPLE SAR STOCHASTIC STANDALONE EXPERT ADVISOR

MQL5 Tutorial

Play Episode Listen Later Aug 11, 2023 4:21


  Introduction to SAR Stochastic Standalone Expert Advisor (00:00 – 00:10) Introduction to creating an Expert Advisor in MQL5 that uses the Parabolic SAR and Stochastic Oscillator indicators for buy and sell signals. Starting with MetaEditor (00:10 – 00:25) Instructions on opening the MetaEditor from MetaTrader and the initial setup, including importing the ‘Trade.mqh’ library. Setting Up Price Calculation (00:25 – 01:12) Explanation of calculating the asking and bid prices using the ‘SymbolInfoDouble’ function and normalizing these prices. Preparing Price Data Array (01:12 – 01:29) Setting up an array named ‘PriceInfo’ to store price data and sorting it to prioritize the latest data. Implementing Parabolic SAR Indicator (01:29 – 02:17) Using the Parabolic SAR indicator within the ‘CheckEntry’ function to identify potential buy or sell signals. Refining Signals with Stochastic Oscillator (02:17 – 02:45) Utilizing the ‘CheckEntryStochastic’ function to refine trading signals based on the Stochastic Oscillator values. Executing Trades Based on Signals (02:45 – 03:09) Decision-making process for executing buy or sell trades based on the combined signals from SAR and Stochastic indicators. Compilation and Testing in MetaTrader (03:09 – 03:38) Instructions for compiling the code and testing the Expert Advisor in MetaTrader using the strategy tester. Conclusion and Additional Resources (03:38 – 03:53) Recap of the tutorial and an invitation to explore more advanced courses or send ideas for new videos.   In this video, we are going to create an Expert Advisor that uses the Parabolic SAR and Stochastic Oscillator indicators to generate buy and sell signals in MetaTrader. Let’s see how we can do that. First, start the MetaEditor. You can do this by clicking on its icon or simply pressing the F4 key. We begin with the #include directive to import the Trade.mqh library. This library provides us with essential trading functions.   Following this, we create an instance of the CTrade class named trade. This instance will be our primary tool for executing buy and sell orders. Next, we calculate the current asking price using the Symbol Info Double function with the parameters Symbol and SYMBOL ASK. This gives us the price at which we can buy. To ensure precision, we use the Normalize Double function, inputting the price and Digits to adjust the number of decimal places. Similarly, we determine the bid price using the Symbol Info Double function with the parameters Symbol and SYMBOL BID. This is the price at which we can sell. This price is also normalized using the Normalize Double function. We then set up an array named Price Info of type Mql Rates.   This array will store our price data for specific time periods on the chart. Within the On Tick function, we sort our Price Info array using the Array Set As Series function to prioritize the latest data. We then fill this array with price data for the current symbol and time frame using the Copy Rates function. Here, we’re copying data for three candles, giving us a snapshot of recent price movements. The closing price of the most recent candle is then determined using the Price Info[0].close reference. We then call the Check Entry function.   Inside this function, we use the Parabolic SAR indicator to check the current and previous values to determine if there’s a buy or sell signal. If the current SAR value is below the current price and the previous SAR value was above the previous price, it suggests a buy signal. Conversely, if the current SAR value is above the current price and the previous SAR value was below the previous price, it suggests a sell signal. Additionally, the Check Entry Stochastic function is used to refine our signals. This function checks the Stochastic Oscillator values. If the K line crosses the D line from below in an oversold area, it suggests a buy signal. If the K line crosses the D line from above in an overbought area, it suggests a sell signal. With these signals in hand, the code decides whether to execute a buy or sell trade. If both the trading signal and the filter signal return a buy and there are no open positions, the trade.Buy function is used to buy 0.10, equivalent to 10 Micro Lot. If both signals return a sell, the trade.Sell function is used to sell 0.10 Microlot. Once you’ve input all the code, press F7 to compile it.   If this was too fast for you or if you don’t understand what all the code is doing, you might want to check out the Premium course on our website or watch one of the basic videos first. After a successful compilation, return to MetaTrader by pressing the F4 key or clicking on its icon. Once in MetaTrader, press Control and R to start the strategy tester. Select the Expert Advisor you’ve just created, enable the visual mode, and start a strategy test. You should then see the Expert Advisor in action on the chart. If you’re already a Premium course member and have an idea for a video like this one, please send us an email. By the end, you’ll have a deeper understanding of what you’ve learned and the Expert Advisor you’ve coded yourself with just a few lines of MQL code. Thanks for watching, and I’ll see you in the next video! Not sure what to do? Click on the automated trading assistant below How to combine the Parabolic SAR and the Stochastic… How to create a Bollinger Bands Expert Advisor MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE BEARS POWER STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR The post MQL5 TUTORIAL – SIMPLE SAR STOCHASTIC STANDALONE EXPERT ADVISOR appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – SIMPLE IVIDYA STANDALONE EXPERT ADVISOR

MQL5 Tutorial

Play Episode Listen Later Aug 7, 2023 7:15


  Introduction to IVIDYA Standalone Expert Advisor (00:00 – 00:26) Introduction to creating an Expert Advisor in MQL5 for the Variable Index Dynamic Average (IVIDYA) indicator. Explanation of buy and sell signals based on the indicator’s position relative to price candles. Setting Up in MetaEditor (00:26 – 01:01) Instructions on opening MetaEditor from MetaTrader and creating a new Expert Advisor file named ‘SimpleIVIDYAStandaloneEA’. Initial code setup including removing unnecessary lines. Including Trade.mqh and Initializing CTrade (01:01 – 01:30) Explanation of including the ‘Trade.mqh’ file and creating an instance of the ‘CTrade’ class for opening positions later in the code. Calculating Ask and Bid Prices (01:30 – 01:49) Details on calculating the Ask and Bid prices using ‘SymbolInfoDouble’ and normalizing these prices with ‘NormalizeDouble’ and ‘_Digits’. Setting Up Price and EA Data Arrays (01:49 – 02:47) Creating and sorting a price array (PriceArray) using ‘MqlRates’ and ‘ArraySetAsSeries’. Also, setting up an array for the Expert Advisor data (EAArray) and sorting it. Implementing IVIDYA Indicator (02:47 – 04:10) Using the ‘iVIDyA’ function to define the Expert Advisor based on the Variable Index Dynamic Average Indicator. Filling the EAArray with data using ‘CopyBuffer’. Calculating and Assigning Signals (04:10 – 05:02) Determining the current IVIDYA value and assigning ‘sell’ or ‘buy’ signals based on its comparison with the close price of the last candle. Executing Trades Based on Signals (05:02 – 05:29) Executing sell or buy trades using ‘trade.Sell’ or ‘trade.Buy’ based on the calculated signal and the absence of open positions. Displaying Signal on Chart and Testing (05:29 – 06:01) Using the ‘Comment’ function to display the current signal on the chart. Instructions for compiling the code and testing the Expert Advisor in MetaTrader. Conclusion and Demonstration (06:01 – 06:41) Conclusion of the tutorial with a demonstration of the Expert Advisor in action, showing a buy signal and the opening of a position.   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). So let's use “CopyBuffer” to fill our array (EAArray) with data according to the IVIDYA definition (iVIDyADefinition) we have created here, it's for only one buffer – the first buffer is buffer 0 (zero) – the current candle is also candle 0 (zero), we need data for 3 candles so we use a 3 here and save it in our “EAArray”. So far so good; to get the current value we just look into our “EAArray” and we need the value for the current candle – that's candle 0 (zero) – now we can actually calculate the signal. Whenever the current iVIDyA value (iVIDyAVALUE) is bigger than the close price of the last candle in our price array (PriceArray) that would be a sell signal and that's when we want to assign the word: “sell” to our signal. In the other case if the iVIDyA value (iVIDyAVALUE) is smaller than the price array 1 close price for candle 1 (PriceArray[1].close) that would be a buy signal and now we assign the word: ”buy” to our signal. Whenever our signal equals sell and Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE TENKANSEN STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE IDEMA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE BEARS POWER STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE STANDALONE RANDOM ENTRY EA The post MQL5 TUTORIAL – SIMPLE IVIDYA STANDALONE EXPERT ADVISOR appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – HOW TO OPTIMIZE YOUR RESULTS

MQL5 Tutorial

Play Episode Listen Later Jul 23, 2023 4:42


  https://elopage.com/s/crowdcompany/platinum-demo-system   CLICK AND USE COUPON CODE “PLATINSYSTEMDEMO” FOR A DEMO COURSE & DEMO VERSION   This video is about system testing. This is the new and improved system for the Platinum Group. We now have two signals here and also some other things have been changed. And in this video we’re going to take a look at how to test a system like this. To do that, first of all, we need to select the right expert advisor in MetaTrader. I have now selected here in the strategy tester the version from July the 14th. And that is already the first criterion. You should, when you create a new system, always create a new version for every change, even if it means a little more work. But then you always have the possibility to go back to the last working version if you ever made a mistake. This is today’s date, July the 20th, 2023. So I want to test for a full year. And here on the Inputs tab, I first set everything to the default values. If I now start the test here, then I see the strategy tester with the information on the chart. But we want to save some time. That’s why I’ll pause this here and we’ll do the test without the visual mode. This should be relatively quick in the optimized version. Here, you can already see how the progress is developing. The total test time is given here with about two minutes. And I will fast forward the video to the end of the test in a moment to show what the result is. So as you can see, the system survived. But of course we didn’t make a profit here. The reason is: The default settings are meant to make a system profitable in the long run over a long period of ten or more years. But that can be wrong for some years. And of course you can optimize such values, now. We start here by changing the values for the curve and for the position size and start the test again. Okay, the second strategy test is done. This already looks quite good. However, this could be much more profitable here. So in the next step, I go a little higher with these two values and start the test again. This also worked, but it is not yet profitable. Let’s set the position size to four times because the drawdowns here were not really high. And let’s see if we can optimize this. So this test is also done and this time we are at about 11.3% profit with a moderate risk. That’s about what I see as a realistic profit expectation. Of course, you can go much, much higher here now with these values, but that wouldn’t work for every year. In 2003, I started my testing. I could change this accordingly and that would then work with the default settings for 20 years. But I’m pretty sure these settings here would be too aggressive at some point in this long term test. So we can just test by doubling the values here again and see what happens. Okay, this strategy test is also over. And this time we would have made 45,000 profit. That would be 45% for a $100,000 account. And of course, on this chart here, it all looks totally easy and smooth. But the people who really take profit in trading are the people who can take drawdowns like this here without manipulating their own system. And that always works best when you don’t need the money. And I believe that the percentage of Platinum members who have the nerve to endure such drawdowns, and who also have the money to go through such developments here is above average. And if you are already a Platinum member, then you can use the new version from the Platinum system as an optional update in the next few weeks. I myself don’t like forced updates. That’s why there is always the possibility to continue using the previously approved version. I will use the next few days to do some more extensive testing to make sure that the system does not ship with serious bugs. Nevertheless, it’s safe to say that this is still a version in beta status. If you click on the chart above, you can see how many tests I do every day. And the basic idea is to make such a system more and more stable. And there’s really nothing better for that than a large number of realistic tests. I think that’s it for this video. This test should also be finished in a few seconds. I’m quite happy with the result, because this time we would have made $55,000 profit with a $100,000 account. That was it so far. I say thanks for watching – and see you in the next video.     Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - FREE TRADING TRAINING FOR 2023 MQL5TUTORIAL - HOW TO GET ADVANCED STATISTICS FOR 3 LIVE… MQL5 TUTORIAL - HOW TO GET THE 1000 PLATIN SYSTEM FOR FREE Robot Trading System - Free Expert Advisor Download (below… MQL5 TUTORIAL - PLATIN SYSTEM - WILLIAMS PERCENT RANGE ENTRY… The post MQL5 TUTORIAL – HOW TO OPTIMIZE YOUR RESULTS appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – SIMPLE ITEMA EXPERT ADVISOR

MQL5 Tutorial

Play Episode Listen Later Jul 8, 2023 7:19


This time we are talking about the ITEMA Indicator. This is for the Triple Exponential Moving Average Indicator. You see this red line here. If we pass the strategy test and hover over the red line you will see that it is called the Triple Exponential Moving Average and its calculated based on 14 candles. In this video we are going to find out how to create an Expert Advisor to calculate a Triple Exponential Moving Average Indicator and how to improve the frequency of the signals that are created. To do that please click the little button here in your Metatrader 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” from template (template), Continue (Next). I will call this one: “Simple ITEMA” (SimpleITEMA). Click on continue, continue and finish. Now everything above the “OnTick” function can be removed, let's also delete the two comment lines. First we need to create an array for the prices, that’s done by using “MqlRates” and the array will be called: “PriceArray”. We use the MQL5 built-in function “ArraySetAsSeries” to sort the price array from the current candle downwards and with “CopyRates” we fill the array for 3 candles. That’s enough to calculate the current candle and calculate crossovers. “CopyRates” takes a few parameters, first one is the symbol parameter – that’s for the current currency pair on the chart – the second one is for the currently selected period on the chart. We start with candle zero; that’s the current candle, copy the data for 3 candles and store it in the price array. In the next step we to create another array for the Expert Advisor data, that will be called “EAArray” and the Expert Advisor array also need to be sorted by using “ArraySetAsSeries”. Now it’s time to actually define the ITEMA Expert Advisor. That is done by using the built-in function: “iTEMA”, it takes a few parameters: the first one once again is the currency pair on the chart, the second one is once again the selected period on the chart, these are 14 candles because if you click on “Insert -Indicators -Trend -Triple Exponential Moving Average” you will see that the default value for the built-in indicator also is 14 candles. We use a shift value of 0 here and it applies to the close price, so that’s what we are using here: shift value 0 and “PRICE_CLOSE “. Now that we have created the definition we use “CopyBuffer” for the ITEMA definition (iTEMADefinition) we have created here. The 0 is for the first buffer, this 0 stands for the current candle, the 3 is to copy 3 candles and we want to save it in the array called: “EAArray”. Now that we have done that we calculate the ITEMA value (ITEMAVALUE) for the current candle 0 in our array. I use float, usually it’s a double and if you press F1 you will see that a double variable is 8 bytes in size, a float variable only takes half of the size and it’s better to read for us humans. So, let’s create a chart output depending on the direction. If the ITEMA value is bigger than the close price of the first candle in the price array – remember the first candle is always this one, this is candle zero, candle one, candle two and so on – so, if this expression is true we use the “Comment” function to output the text: “iTEMA IS SHORT”, followed by the calculated ITEMA value. In the other case if the close price for candle one in our price array is above the ITEMA value we will output: “iTEMA IS LONG”, also followed by the value. Okay, that’s it. When you are done you can click on the compile button here, we get a warning that says that we have a possible loss of data due to type conversion, that’s because I used a float variable here but for this little Expert Advisor that is okay. So, if the compilation works without any errors you can click the little button here or press F4 to go back to Metatrader. In Metatrader please click on “View -Strategy Tester” or press CTRL and R and now you should select the file: SimpleITEMA.ex5, mark the visualization option here and start a test. This is how our Expert Advisor looks like, you see it saying: “iTEMA IS SHORT “or “iTEMA IS LONG”. The frequency of the signals is much too high, so let’s fix that! We go back into the Metaeditor and change the shift value for the candles to 100 candles. Let’s recompile the code, press F4, stop the current test and start a new one! This is how it looks like, just press the minus key a few times and now you see that the indicator is calculated 100 candles before the price and whenever the price is crossing here we will get another signal. Let’s speed that up a little bit, now we are getting much fewer signals but the signal quality is better! Okay. That's it! Now you know how to create an Expert Advisor for a Simple Triple Exponential Moving Average Indicator and you have coded it yourself with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 72 SIMPLE TRIPPLE EMA MQL5 Tutorial Classics - Simple Moving Average Robot with… MQL5 TUTORIAL - SIMPLE IDEMA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE SIGNAL STACKING The post MQL5 TUTORIAL – SIMPLE ITEMA EXPERT ADVISOR appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE IADX EXPERT ADVISOR

MQL4 TUTORIAL

Play Episode Listen Later Jul 2, 2023 6:41


In this video, we are going to talk about this Indicator here; it is the Average Directional Movement Index. Basically it's a trend confirmation oscillator. Whenever the line here is rising that's a trend confirmation; in our case for a short trend that is developing on the chart here and as soon as the IADX Indicator is falling, you see, the trend is interrupted here, now its rising again and we see an uptrend and when the IADX Indicator starts to decline – like in this case – the uptrend is interrupted. Now how can we create an Expert Advisor that is able can calculate the Average Directional Index in MQL4? To do that please click on the little button here or press F4 on your keyboard. Now you should see the Metaeditor window and here you want to click on “File/ New/ Expert Advisor (template)” from template. “Continue” (Next). I'll call this one Simple IADX (SimpleIADX), click on “Continue” (Next) “Continue” (Next), and “Finish”, and now you can delete everything above the “OnTick” function and the two comment lines here. In the first step we want to create a signal, especially a string variable for the signal that will also be called signal and we don't assign any value because we are going to calculate that later. Let's calculate the IADX value (IADXValue) by using the function: “iADX” that comes with Metatrader 4. If you mark it and press F1 the reference will tell you that it needs some parameters; the first one is for the symbol on the chart, the second one for the time frame you use on the chart, the third one is for the period for the calculation. If you right-click on the Indicator and select “ADX properties” you will see that the period is 14 and we calculate the values based on the close price so that's what we use here; 14 and PRICE_CLOSE for the close price. This parameter is for the buffer, so what is a buffer? You see the Indicator produces 3 lines here, let's hit the pause button and the value for the blue line is 29.93555 – that's exactly what you see here. The 2 dotted lines have a different value and you could calculate the 2 other values if you exchange buffer 0 with buffer 1 or buffer 2. The last parameter here is the shift value – that's also 0. We want to calculate the current IADX Indicator for the current value (IADXValue) here and to get the last IADX value (LastIADXValue) we use exactly the same parameters accept we use a 1 to get the last value. If we use a 10 instead we would get the value for 10 candles before. If the IADX value (IADXValue) is higher now so IADX value (IADXValue) is greater than last IADX value (LastIADXValue) we want to output: “IADX is rising” so that's what we assign to our signal variable. In the other case if the IADX value (IADXValue) is lower now so the current IADX value (IADXValue) is below the last IADX value (LastIADXValue) we assign the text: “IADX is falling” to our signal. Let's create a screen output by using the “Comment” function. It would output the text; “IADXValue:”, the calculated value and in a new line a text: “Signal:” and the calculated signal we have created here or here. So, that's basically it, let's click on “Compile” or press F7 on your keyboard. That worked without any errors so now we can click here or press F4 to go back to Metatrader. In Metatrader we are going to use a little trick; please click on “Insert/ Indicators/ Trend/ Average Directional Movement Index”, click on “OK”, leave the parameters as they are, click on “OK” and now you should see the Average Directional Movement Index in a separate window below the candles and because Wikipedia says: “The ADX does not indicate a trend direction or momentum and is only used to calculate the ...

MQL5 Tutorial
MQL5 Tutorial – Simple External Signals In A File

MQL5 Tutorial

Play Episode Listen Later Jun 29, 2023 7:09


This week I’ve gotten a few requests: how we can use external signals to create buy or sell signals in Metatrader. Right now, our buy signal is “Don’t Buy It Now”, and we have no open positions. And this is a simple text file. It is located in the user’s path in Windows. So that path here might be a little bit different, depending on your name and your operating system, but it should be below MetaQuotes, terminal, common files. Right now, it contains the sentence, “Don’t buy it now”. So let’s see what happens if I remove the Don’t and save the file. Immediately, a new Buy trade appears. So now we have opened a new position by using an external text file. And in this little video, we are going to find out how to do that. In your MetaTrader, please click on the little button here or press the F4 key. And in Metatrader, you want to click on File, New, Expert Advisor from Template, Continue. I will call it simple external signal and finish. And now you can remove everything above the on tick function and the two comment lines here. And to open a trade, the first thing we need is to import the trade.MQH file by using the include function.   And now we want to create an instance that will have the name trade. And inside the ontick function, the first thing we do is to get the ask price by using symbol info double for the current symbol. We use the constant symbol underline ask because we need the ask price. And with normalize double and underline digits, we make sure that we have the right number of digits behind the dot, because there are some currency pairs that have only three digits and others have five. Let’s tell MQL5 actually which file we are going to use. Remember, this is the path where my files are located. In your case, it might be a little bit different, depending on your operating system and your name. This is the File handle, it’s an integer value and we use FileOpen for the file with the name signal.txt. We use File_Read, because we only want to read what’s in the file. File_ANSI means it’s a file that is containing strings of ANSI type. Ansi is only using one byte. You could, for example, also use File_Unicode. That would be used for two byte symbols. So if you see any weird characters on your screen, the reason might be the wrong encoding here.   And File_Common is used for the file path in the common folder of all client terminals. It ends with terminal, common files, like in this case. This pipe character here is used as a delimiter that is used to separate the different items in a txt file or in a comma separated file. And CP_ACP means we are currently using the current Windows ANSI code page. Now that our file is defined, we use File, Read String for the external file we have created here to read out a buy signal. It will be a text string. And afterwards, we close the file. That is done by using the command File Close for our external file. And if no open positions exist and a buy signal occurs, that would mean positions total equals zero and the text in our file is “Buy it Now”. Well, in that case, we want to open a buy position by using trade.buy for 10 micro lots on the current chart for the current Ask Price. We have no stop loss defined. Our take profit is 100 points above the current Ask Price and we don’t need a comment here, so we use null for the last parameter.   The last step is to create a chart output by using the comment function. It will show us the current buy signal that is the text that is contained in our file, followed by the text positions total and the value we have calculated for positions total. And if everything is okay, please click on the compile button. And if you don’t have any errors or any warnings, click on a little button here or press F4 to go back to Metatrader. Now in Metatrader, please click on View, Strategy Tester, or press CTRL and R. And here you need to select the file simple external signals.ex5, enable the visualization and start the test. Now our little expert advisor is running and you see the buy signal right now is: don’t buy it now. The number of open positions is zero. So let’s change the text file here. click on File, Save. And immediately a new trade is opened here. And if you speed up the process, you will see that new trades are opened and closed. But if the external condition is no longer true, or if I change the file content manually and save it, the buy signal will change to stop buying or whatever is in the text file.   Let’s save that again. Now it says, Buy signal is stop buying or whatever is in the text file. Okay, Now you know how you can create an Expert Advisor that can read external Txt files. Actually, you could also use Excel files or whatever to use external signals. And you have coded it yourself with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below LEARN MQL5 TUTORIAL BASICS - LEVEL 1C BUILD YOUR OWN ALGO… MQL5 TUTORIAL - PLATIN SYSTEM - WILLIAMS PERCENT RANGE ENTRY… MQL5 TUTORIAL - SIMPLE ITRIX STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - SIMPLE AWESOME STANDALONE EXPERT ADVISOR MQL5-TUTORIAL-PLATIN-SYSTEM-THE-AWESOME-OSCILLATOR The post MQL5 Tutorial – Simple External Signals In A File appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – HOW TO STILL BENEFIT WHEN THE PRICE RUNS AGAINST YOU

MQL5 Tutorial

Play Episode Listen Later Jun 24, 2023


  Trading can often feel like a high stakes game where the challenge lies not only in making profits, but also in managing the inherent risks and inevitable lows. That is also true for the robot trading system, a trading tool that is reshaping traditional approaches by emphasizing resilience as much as reward. About a week ago, I set out on a new journey with this live trading system. As with all things new, the onset wasn’t particularly smooth. I found myself in what traders often dread, a drawdown situation. This scenario occurred despite the fact that I had chosen what is a proven strategy, opening a sell position during a downtrend. The unpredictability of the market, however, took its course and I ended up facing the opposite direction of the intended profit.   As a result, for an entire week, my trading account saw no influx of profits. For many, a week without profits might signal an ineffective system. But I beg to differ. While it’s true that the first week didn’t bring any financial gain, the noteworthy detail lies in the absence of losses. It’s crucial to mention here that the robot trading system I was using is designed specifically to handle such draw downs. The system deploys an intelligent algorithm that efficiently hedges positions, thereby maintaining a balance even when the market doesn’t move in the predicted direction. This might seem like a small win, but when you’re trading, especially in a volatile market, avoiding losses can be just as important, if not more, than making significant profits. On the closing date of June 23rd, my account, despite the week’s market turbulence, stood at a net gain of a single dollar.   This may not seem like a significant achievement on the surface, but when considering the context, it’s evidence of the system’s effectiveness in safeguarding against potential losses. For those intrigued by the system’s ability to mitigate losses during unpredictable market conditions, the robot trading system offers a demo account for you to test. This thing provides a risk free opportunity to understand the system’s operations and explore its unique features. The system’s emphasis on resilience and risk mitigation might be a refreshing change from traditional systems that primarily focus on profit generation.   In the world of trading, where the tides can turn swiftly and unexpectedly, it’s a comfort to have a tool that can withstand the push and pull of the market trends. The robot trading system does precisely this by striking a balance between risk and reward. It may not always provide an instant profit, but it offers a buffer against potential losses during turbulent market phases, thus providing a safer trading experience. With its unique emphasis on resilience and a strategic approach to risk management, it stands apart from other trading systems. For anyone seeking a reliable stress tested system that can withstand the unpredictability of the markets, the robot trading system is definitely worth considering. The link is below and as always, thank you for watching and I will see you in the next video.     Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL ENGLISH - 3 COMMON ERRORS CAN LEAD TO… Robot Trading System - Free Expert Advisor Download (below… MQL5 TUTORIAL - IS 3 PERCENT MONTHLY TRADING PROFIT POSSIBLE Metatrader5 vs Metatrader4 LEARN MQL5 TUTORIAL BASICS - LEVEL 1A BUILD YOUR OWN ALGO… The post MQL5 TUTORIAL – HOW TO STILL BENEFIT WHEN THE PRICE RUNS AGAINST YOU appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL – BEWARE OF HISTORY QUALITY ISSUES

MQL5 Tutorial

Play Episode Listen Later Jun 11, 2023 4:02


This video, I would like to show you something that you might not know, but you should be aware that all the historical data we see is calculated data, more or less. And I will show you something that is a little bit weird. So if you see the scale here below, we have several months that are listed one behind the other. And suddenly here, we have January the third, January the fourth, and so on. So why is the same scale here much less complex? And that’s because when you zoom into the chart, you will notice that each of those candles here has a value that can be shown when you hover with the mouse over the chart. This is the price for the open, the high, the low, and the close price for November the 15th. And the next candle here will show us the same data for the next day. But actually, we have said that we want to trade on a one hour chart. So what you see with your own eyes here is that for January, we have a price for Midnight. Let’s go a little bit further into the data. This is the next year. And here suddenly we have a price for 10 o’clock. The next candle is for 11 o’clock, and the next one is for 12 o’clock. That is the way it should be. But actually, when you look at the chart like this one, you might probably not notice that up to the date where we started the strategy test, all the data is just one candle per day. Even we have chosen to trade the hourly chart. So basically, this is a quality issue for visual data. And if we start the test here and zoom into the chart, you will see now we have separate candles for each hour. So data quality might be an issue, especially if you’re trading the early years. Let’s do another test. This time I’m using the Euro US Dollar. Here we are. And if we go back in time, you can see we have hourly charts and data that is available for December 2002. Just remember, we have picked to trade from February 2003. So in this case, the data quality is okay. Now let’s pick the whole year. Let’s set that back to the default and start. Now, we should get a result in a few seconds. There we are. And it says that the history quality was 99 %. So if you don’t understand why you have bad results, one of the things that you need to check is the history quality. Let’s repeat the whole thing for the Australian dollar against the Canadian dollar. And here it says the history quality is zero. So make sure to check out the back test tab and the value for the history quality every time you do a strategy test. Okay, so far so good. Thank you for watching and I will see you in the next video. Bye.. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - FREE TRADING TRAINING FOR 2023 MQL5 TUTORIAL - PLATIN SYSTEM - DEMARKER OSCILLATOR MQL5 TUTORIAL - 99 NEW LIVE CROWD ALGO TRADING SYSTEM MQL5 TUTORIAL BASICS - 79 SIMPLE COLOR CHANGER MQL5 TUTORIAL BASICS - 89 SIMPLE HIGH PRICE TREND LINE The post MQL5 TUTORIAL – BEWARE OF HISTORY QUALITY ISSUES appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL – 135 SIMPLE LOT SIZE ROUNDING

MQL4 TUTORIAL

Play Episode Listen Later May 29, 2023 3:31


Let's look at how to determine a lot size using the account balance in this video, as well as how to round the result up or down to fit. So let's look at how to use MQL4 to accomplish that. Please use the F4 key or click this button in MetaTrader to do that. The MetaEditor should then appear. In this case, we choose File, New Expert Advisor from template, and then provide a name. I've previously completed this. Simple Lot Size Rounding is the name of my file, which is already pre-programmed. Ontick will be our first function to deal with. We want to first determine the account balance there. The position size is calculated depending on the account balance using the Account Info Double, Account Balance function. In this instance, we divide the gross balance value by 100,000. Additionally, we construct two variables—one rounded up and one rounded down—for the rounded numbers. With the aid of the corresponding function, which we ourselves program, we can calculate that. The determined lot size and the value for the decimal rounding are passed as parameters to the first function, which is called Round up, and the second, Round down. This should be rounded to the nearest whole number. We can output the final results in a more structured manner by using Normalize Double. Despite the fact that we have given two decimal places here, we can see that the first digit of our results is truncated. We then display the entire thing onto the chart using the Comment function. On to the actual functions now. We pass our input value to round up. That is both our rounding value and the position size that we previously passed. For the decimal places, let's add the second parameter. We multiply the rounded value by the function's output in order to obtain the result. Once you press F1, you may access the help and notice that an integer value has been returned. We also pass the input value and the rounded value to the MathCeil function for further calculation. Then we return our outcome to the function using Return. Similar principles apply to the second function for rounding the value. But in this case, MathFloor is used rather than MathCeil. And in this case, we also return the result to our main function. And so, for a 0.25 lot determined lot size, this yields the rounded up value of 0.3 and the rounded down value of 0.2. You can alter this in accordance with the type of account you have and so pass the proper values so that a position can also be opened correctly. Not all account types can deal with microlot sizes that are staggered to the second decimal place. By the way, another premium customer had suggested this video topic. Additionally, if you're a premium customer and have an idea for a video like this, please email me. If not, the premium course is available on our website. Additionally, you learned how to round lot sizes up or down with ease in this video so that they meet your account type. And you wrote these few MQL4 lines here to program that yourself. Not sure what to do? Click on the automated trading assistant below var aiBot = new AiBot({embedId: 'Qq4PT6s3KaCG', remoteBaseUrl: 'https://humanchat.net/', version: '1.4.18'}); MQL4 TUTORIAL - SIMPLE SELL LIMIT EA In this video,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL DEUTSCH – 135 SIMPLE LOT GROESSEN RUNDUNG

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later May 29, 2023 4:25


  In diesem Video wollen wir uns einmal anschauen, wie man eine Lotgröße basierend auf dem Kontostand berechnen kann und wie man das Ergebnis so auf oder abrundet, dass das auch passt. Also lassen Sie uns mal schauen, wie man das mit MQL5 realisieren kann. Um das zu tun, klicken Sie im MetaTrader bitte hier oben auf das Icon oder drücken Sie die F4 Taste. Dann sollten Sie im MetaEditor landen. Und hier klicken wir auf Datei, Neu Expert Advisor aus Vorlage, weiter, vergeben hier einen Namen. Ich habe das schon getan.   Meine Datei heißt Simple Lotgrößenrundung und wir haben das hier schon mal vorprogrammiert. Wir starten mit der On Tick Funktion. Dort wollen wir zunächst einmal das Konto Guthaben, also die Balance errechnen. Das geht mithilfe der Funktion Account Info Double, Account Balance und basierend auf dem Kontostand möchten wir die Positionsgröße berechnen. In unserem Fall nutzen wir dafür den Brutto Guthaben Wert und teilen diesen durch 100.000. Außerdem erstellen wir zwei Variablen für die gerundeten Werte einmal aufgerundet und einmal abgerundet. Diese ermitteln wir mithilfe der jeweiligen Funktion, die wir selbst programmieren. Die erste Funktion heißt Round up, die zweite Round down und wir übergeben jeweils als Parameter die berechnete Lotgröße und den Wert für die Kommastellen Rundung. Wir möchten das hier auf eine Kommastelle runden. Mit Normalize Double kann man die Endergebnisse noch etwas formatierter ausgeben. Obwohl wir hier jeweils zwei NachKommastellen angegeben haben, sehen wir, dass unsere Ergebnisse nach der ersten Stelle abgeschnitten werden. Und mithilfe der Comment Funktion geben wir das Ganze auf dem Chart aus. Kommen wir zu den eigentlichen Funktionen.   Um aufzurunden, übergeben wir unseren Eingabewert. Das ist die Positionsgröße, die wir oben übergeben haben und unseren Rundungswert. Das ist der zweite Parameter hier für die NachKommastellen. Und um das Resultat zu ermitteln, multiplizieren wir den Rundungswert mit dem Ergebnis dieser Funktion. Wenn Sie einmal F1 drücken und sich das in der Hilfe aufrufen, dann sehen Sie, dass da ein ganzzahliger Wert zurückgeliefert wird. Und als Parameter übergeben wir der Funktion MathCeil den Eingabewert und den Rundungswert. Anschließend nutzen wir Return, um unser Resultat wieder an die Funktion zurückzugeben. Die zweite Funktion zum Abrunden des Wertes funktioniert ähnlich. Hier nutzen wir allerdings nicht MathCeil, sondern MathFloor. Und auch hier geben wir das Resultat zurück an unsere Hauptfunktion.   Und das führt dann dazu, dass bei einer ermittelten Lotgröße von 0,25 Loth der aufgerundete Wert 0,3 und der abgerundete Wert 0,2 erscheint. Je nachdem, welchen Konten-Typ Sie haben, können Sie das entsprechend anpassen und so die richtigen Werte übergeben, damit eine Position auch korrekt eröffnet werden kann. Denn nicht alle Content Typen unterstützen die Staffelung in Mikrolotgrößen bis auf die zweite NachKommastelle. Das hier war übrigens wieder eine Anfrage von einem Premiumkunden. Und wenn Sie Premiumkunde sind und eine Idee für ein solches Video haben, dann schicken Sie mir einfach ein Email. Andernfalls finden Sie den Premiumkurs auf unserer Website. Und in diesem Video haben Sie gelernt, wie Sie Lotgrößen einfach auf- oder abrunden können, damit das zu Ihrem Kontotyp passt. Und Sie haben das selbst programmiert mit diesen paar Zeilen hier in MQL5. Nicht sicher was Sie tun sollen? Klicken Sie auf den automatischen Trading Assis...

MQL5 Tutorial
MQL5 TUTORIAL – 135 SIMPLE LOT SIZE ROUNDING

MQL5 Tutorial

Play Episode Listen Later May 28, 2023 3:32


    In this video, let’s take a look at how to calculate a lot size based on the account balance and how to round up or down the result to make it fit. So let’s take a look at how to do that with MQL Five. To do that, in MetaTrader please click on the icon up here or press the F Four key. Then you should end up in the MetaEditor. And here we click on File, New Expert Advisor from template, next, assign a name here. I have already done this. My file is called Simple Lot Size Rounding and we’ve already pre-programmed this. We’ll start with the on tick function. There we first want to calculate the account balance. This is done using the Account Info Double, Account Balance function and based on the account balance we want to calculate the position size. In our case, we use the gross balance value and divide it by 100,000. We also create two variables for the rounded values, one rounded up and one rounded down. We determine these with the help of the respective function, which we program ourselves.   The first function is called Round up, the second Round down and we pass the calculated lot size and the value for the decimal rounding as parameters. We want to round this to one decimal place. With Normalize Double, we can output the final results in a more formatted way. Although we have specified two decimal places here, we see that our results are truncated after the first digit. And using the Comment function, we output the whole thing on the chart. Let’s move on to the actual functions. To round up, we pass our input value. That’s the position size that we passed above and our rounding value. Let's add the second parameter here for the decimal places. And to get the result, we multiply the rounding value by the result of this function. If you press F1 once and call that up in the help, you’ll see that there’s an integer value returned. And as parameters, we pass the input value and the rounding value to the MathCeil function. Then we use Return to return our result back to the function. The second function for rounding the value works similarly.   Here, however, we do not use MathCeil, but MathFloor. And here we also return the result to our main function. And this then results in the rounded up value 0.3 and the rounded down value 0.2 for a determined lot size of 0.25 lot. Depending on which account type you have, you can adjust this accordingly and thus pass the correct values so that a position can also be opened correctly. Because not all content types support the staggering in microlot sizes down to the second decimal place. By the way, this was again a request from a premium customer. And if you are a premium customer and have an idea for such a video, just send me an email. Otherwise, you can find the premium course on our website. And in this video, you learned how to easily round up or round down lot sizes so that that fits your account type. And you programmed that yourself with these few lines here in MQL5.   Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 112 SIMPLE BUY PERCENTAGE RISK MQL5 TUTORIAL BASICS - 107 SIMPLE ARRAY REFERENCE MQL5 TUTORIAL BASICS - 108 SIMPLE IOBVEA OSCILLATOR MQL5 TUTORIAL BASICS - 118 SIMPLE LAST ORDER TYPE MQL5 TUTORIAL BASICS - 110 SIMPLE MULTIPLE INPUT The post MQL5 TUTORIAL – 135 SIMPLE LOT SIZE ROUNDING appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL DEUTSCH – SIMPLER IFRAMA STANDALONE EXPERT ADVISOR

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later May 20, 2023 6:50


In diesem Video möchten wir uns einmal anschauen, wie man diesen Indikator hier automatisch handeln kann. Es handelt sich um den Fractal Adaptive Moving Average Indikator. Das ist diese blaue Linie hier. Wir haben hier bereits eine erste Position vollautomatisch eröffnet. Und wir möchten jetzt einmal schauen, wie man einen Expert Advisor programmieren kann, der in der Lage ist, auf dem Chart diese Kaufen und Verkaufen Signale auszugeben und Positionen automatisch zu eröffnen. Um das zu tun, klicken wir im Metatrader auf diesen kleinen Button hier oder drücken die F4 Taste. Das öffnet dann hier den Metaeditor. Und hier klicken wir auf Datei, Neu, Expert Advisor aus Vorlage, Weiter. Ich vergebe hier einmal den Namen SimplerIFRAMAStandaloneEA, klicke auf Weiter, Weiter und Fertigstellen. Jetzt kann aller oberhalb der OnTick Funktion gelöscht werden. Auch die zwei Kommentarzeilen werden entfernt. Und wir beginnen damit, dass wir mittels include die Datei Trade.mqh importieren. Die bringt einige Handelsfunktionen mit sich und wir erstellen von der Klasse CTrade, die in dieser Datei enthalten ist, eine Instanz mit dem Namen Trade. In der On Tick Funktion berechnen wir zunächst den Ask-Preis. Das geht mittels SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Und wir nutzen SYMBOL_ASK um den Ask-Preis zu berechnen. Die Funktion NormalizeDouble_Digits sorgen dafür, dass die Anzahl von Ziffern nach dem Dezimalpunkt richtig berechnet werden. Denn das ist, je nach Währungspaar unterschiedlich. Da wir in beide Richtungen handeln möchten, brauchen wir auch noch den Bid-Preis. Den ermitteln wir genauso. Allerdings nutzen wir dieses Mal SYMBOL_BID. Für unser Signal erstellen wir eine gleichnamige Variable. Die ist vom Typ string, damit sie Textketten aufnehmen kann. Aber im Moment weisen wir noch keinen Wert zu. Mit MqlRates erstellen wir uns ein Preis Array. MylRates ist eine Funktion, die die Informationen über die Preise, das Volumen und den Spread der Kerzen aufbewahrt. Unser Preis Array sortieren wir jetzt mit ArraySetAsSeries von der aktuellen Kerze an abwärts. Danach nutzen wir CopyRates für das aktuelle Währungspaar und die aktuell auf dem Chart ausgewählte Zeiteinheit um unser Preis Array von der aktuellen Kerze null für drei Kerzen mit Preisdaten zu füllen. Jetzt brauchen wir noch ein Array. Das ist für unseren Expert Advisor und bekommt den Namen FramaArray. Für die Definition nutzen wir die, in MQL5 eingebaute Funktion, iFrAMA für das aktuelle Währungspaar auf den Chart und die auf dem Chart ausgewählte Zeiteinheit. Wir berechnen unseren Expert Advisor anhand von 14 Kerzen, benutzen keine Verschiebung. Und ermittelt wird das Ganze anhand der Schlusskurse. Wenn Sie sich hier einmal mit der rechten Maustaste die Eigenschaften anzeigen lassen, dann sehen Sie auch hier: 14 Kerzen, Verschiebung ist null und Anwenden auf Close Preis. Das ist genau das, was wir auch hier verwenden. Auch dieses Array sortieren wir wieder von der aktuellen Kerze an abwärts mit ArraySetAsSeries. Und mit CopyBuffer füllen wir jetzt unseren FRAMA EA anhand der Definition, die wir hier oben getroffen haben. Für Buffer null, das ist diese blaue Linie hier, von der aktuellen Kerze null für drei Kerzen mit Daten, die wir in unserem Array abspeichern. Nun berechnen wir den letzten Wert. Das tun wir, indem wir auf Kerze eins in unserem Array zugreifen. Und wir möchten verkaufen, wenn der Frama Wert über dem letzten Kerzenhoch liegt. Wenn also der Frama Wert größer ist als der Höchstpreis von Kerze eins in unserem Preis Array. Dann möchten wir gerne verkaufen und weisen den Wert verkaufen unserer Signal Var...

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL DEUTSCH – 134 SIMPLER STANDALONE BOLLINGER MACD EXPERT ADVISOR

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later May 15, 2023 4:19


In diesem Video werden wir einen Expert Advisor erstellen, der in der Lage ist, automatisch ein Bollinger Bands Einstiegssignal und einen Filter für den MacD Oszillator in Metatrader5 zu handeln. Beide Indikatoren sind sehr beliebt und können kombiniert werden, um Kauf- und Verkaufssignale zu erzeugen, die mit diesem eigenständigen Expert Advisor automatisch gehandelt werden können. Schauen wir uns also an, wie man das in MQL5 macht. Bitte öffnen Sie den MetaEditor. Wir beginnen mit der Erstellung eines neuen Expert Advisors, indem wir auf Datei, Neu, Expert Advisor aus Vorlage klicken. Fahren wir fort mit der Include-Funktion, um die Datei Trade.mqh einzubinden, die mit MQL5 geliefert wird. Sie bietet vereinfachte Handelsfunktionen und wir erstellen eine Instanz der Klasse CTrade, um sie nutzen zu können. Anschließend binden wir zwei Dateien für das Einstiegs- und das Filtersignal ein. Die erste ist für die Bollinger Bands und wird uns ein Handelssignal liefern. Die zweite ist für den MacD und wird uns ein Filtersignal liefern. Beide Dateien wurden bereits als separate Module programmiert, so dass sie auch für andere Expert Advisors verwendet werden können. Wenn Sie Zeit und Mühe sparen möchten, können Sie zu MQL5Tutorial.com gehen, wo Sie den Premium-Kurs und eine Menge vorprogrammierte Quellcode-Dateien im Store finden. Im nächsten Schritt müssen wir den Ask Preis und den Bid-Preis berechnen. Dies können Sie mit der Funktion SymbolInfoDouble für das aktuelle Symbol im Chart tun. Wir verwenden Symbol_Ask zur Berechnung des Ask Kurses und Symbol_Bid zur Berechnung des Bid-Kurses. Mit NormalizeDouble und UnderscoreDigits können wir die Anzahl der Ziffern hinter dem Punkt berechnen. Je nach Währungspaar können das 3 oder 5 Ziffern sein. Mit MqlRates erstellen wir ein Array für Preise, genannt PriceInfo. Innerhalb der Funktion Ontick verwenden wir Array Set As Series, um unser Preis-Array von der aktuellen Kerze abwärts zu sortieren. Dann können wir copy rates verwenden, um unser Preis-Array mit Daten zu füllen. Wir tun dies für das aktuelle Symbol und den aktuell ausgewählten Zeitraum auf unserem Chart, beginnend bei Kerze 0, für 3 Kerzen und speichern das Ergebnis in unserem Preisinfo-Array. Lassen Sie uns nun den aktuellen Preis berechnen, indem wir den Schlusskurs der Kerze 0 in unserem Preisinfo-Array betrachten. Wir erstellen eine Text Variable für das Handelssignal und rufen die Funktion CheckEntryBollinger auf, um zu prüfen, ob ein Kauf- oder Verkaufssignal vorliegt. Dasselbe tun wir für eine weitere Text Variable namens Filter und rufen die Funktion CheckEntryMacD auf, um das Filtersignal zu erhalten. Wenn das Handelssignal und der Filter beide ein Kaufsignal liefern und wir keine offenen Positionen haben, möchten wir trade.buy verwenden, um 10 Mikrolot zu kaufen. Im anderen Fall, wenn sowohl das Handelssignal als auch der Filter ein Verkaufssignal liefern, verwenden wir trade.sell, um 10 Mikrolot zu verkaufen. Schließlich verwenden wir die Anweisung Comment, um das Handelssignal und den Filter auf unserem Chart auszugeben. Drücken Sie F7, um den Code zu kompilieren. Wenn das ohne Fehler funktioniert, können Sie mit der Taste F4 zum Metatrader zurückkehren. Okay, wenn alles gut gelaufen ist, sollten Sie jetzt einen funktionierenden Standalone Expert Advisor für das Bollinger Bands Signal und den MacD Filter haben. Sie können einen Strategietest wie diesen durchführen, indem Sie in Metatrader5 die Tasten Strg und R drücken. Wenn Sie Ihre Handelsergebnisse verbessern möchten,

MQL5 Tutorial
MQL5 TUTORIAL – 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR

MQL5 Tutorial

Play Episode Listen Later May 14, 2023 3:35


In this video we are going to create an Expert Advisor that is able to automatically trade a Bollinger Bands entry signal and a filter for the MacD Oscillator in Metatrader5. Both indicators are very popular and can be combined to create buy and sell signals that can automatically traded with this standalone Expert Advisor. So let's see how to do that in MQL5. Please open the MetaEditor. We start by creating a new Expert Advisor by clicking on File, New, Expert Advisor from template. Let's continue, with the include function to include the file Trade.mqh which comes with MQL5. It provides simplified trading functions and we create an instance of the class CTrade so we can use them.   Afterwards we include two files for the entry and the filter signal. The first one is for the Bollinger Bands and it will give us a trading signal. The second one is for the MacD and it will give us a filter signal. Both files have been coded before as separate modules, so they can also be used for other Expert Advisors. If you want to save time and effort, you can go to MQL5Tutorial.com where you can find the premium course and a lot of precoded source code files in the store. In the next step we need to calculate the Ask price and the Bid price. That can be done by using the function SymbolInfoDouble for the current Symbol on the chart. We use Symbol_Ask to calculate the Ask price and Symbol_Bid to calculate the Bid price. With NormalizeDouble and UnderscoreDigits we can calculate the number of digits behind the dot. Depending on the currency pair, that might be 3 or 5 digits.   With MqlRates we create an Array for prices, called PriceInfo. Inside of the Ontick function we use ArraySetAsSeries to sort our price array from the current candle downwards. Then we can use CopyRates to fill our price array with data. We do that for the current symbol and the currently selected period on our chart, starting from candle 0, for 3 candles and store the result in our price info array. Now let's calculate the current price by looking at the close price of candle 0 in our price info array. We create a string variable for the Trading Signal and call the function CheckEntryBollinger to check for a buy or sell signal. And we do the same thing for a string variable called Filter and call the function CheckEntryMacD to get the filter signal. If the trading signal and the filter both return a buy signal and we have no open positions, we want to use trade.buy to buy 10 Micro Lot. In the other case, if the trading signal and the filter both return a sell signal, we use trade.sell to sell 10 Micro Lot. Finally, we use the Comment statement to output the trading signal and the filter on our chart. Press F7 to compile the code, if that works without any errors, you can return to Metatrader by pressing the F4 key.   Okay, if everything went well, you should now have a working standalone Expert Advisor for the Bollinger Bands signal and the MacD filter. You can run a strategy test like this one by pressing Control and R in Metatrader5. If you want to improve your trading results, you can find the premium course and more source codes on MQL5TUTORIAL.com and in our shop. Thank you for watching and I will see you in the next video. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL - 131 STANDALONE EMA MACD EXPERT ADVISOR MQL5 TUTORIAL BASICS - 132 STANDALONE BOLLINGER BANDS RSI… MQL5 TUTORIAL BASICS - 129 SIMPLE BOLLINGER BANDS EXPERT… MQL5 TUTORIAL - SIMPLE VOLUMES FILTER MQL5 TUTORIAL - SIMPLE MACD STANDALONE EXPERT ADVISOR The post MQL5 TUTORIAL – 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 134 STANDALONE BOLLINGER MACD EXPERT ADVISOR

MQL4 TUTORIAL

Play Episode Listen Later May 14, 2023 3:21


In this video we are going to create an expert advisor that is able to use the Bollinger Bands to create a Buy or a Sell signal. And we are going to use the MACD as a filter. So let's find out how to do that with MQL4. To get started, please click on the little icon here or Press F4 on your keyboard. Now you should see the Metaeditor window and here we have the precoded solution. In my case, I'm doing an include function for the Bollinger Bands module and for the MACD module. Both are separate files and the include function can import the content of those files. And they will be compiled when you compile the main module, which is the one with the Ontick function. And here we create a string variable for the trading signal and another string variable for the filter. And to get the trading signal we are opening a function that is called CheckEntry Bollinger. And to create a filter signal we open a function that is called Check Entry MACD. And when we have a Buy signal and the filter for the MACD also says that we should buy and if the return value for Orders total equals zero, that would mean all conditions are good for a Buy signal. And that's when we use Order Send to open a Buy Trade for ten microlot. Otherwise, when the trading signal equals Sell and when the filter also equals Sell and we have no open positions, that's when we use Order Send to open a Sell Trade for ten microlot. Finally, we use the comment statement to output the trading signal and the filter signal on our chart. That's it for the main module. For the entry signal and the filter signal we use precoded entry modules that we have created before. If you don't know what all that code here means, you maybe want to watch one of the other videos in our basic video series, or maybe even the premium course might be interesting for you. You can find that one on our website and there are also more precoded source codes available in our store. So this is it. Once you have all three modules in place you can click on the compile button. Here we are. And if you don't have any errors you can click on the little button here or press the F4 button to go back to MetaTrader. And in MetaTrader you want to click on view, strategy tester, or press CTRL and R. Please mark the option for the visual mode here and start your test. Now our little expert advisor is running. So the expert advisor seems to work. Now let's go to full speed for a few seconds. You see that we have several positions that are opened. Now let's pause the whole thing and click on the graph tab. We have a few positions here. So it looks like our expert advisor works as expected. And in this little video you have learned how to create an expert advisor that is able to calculate buy and sell signals by using an external module for the Bollinger Bands. You also used a filter for the MACD signal and you have coded it all yourself with a few lines of MQL4 code. Not sure what to do? Click on the automated trading assistant below var aiBot = new AiBot({embedId: 'Qq4PT6s3KaCG', remoteBaseUrl: 'https://humanchat.net/', version: '1.4.18'}); MQL4 TUTORIAL - SIMPLE MODULAR EXPERT ADVISOR In this video we are going to creat...

MQL4 TUTORIAL
MQL4 TUTORIAL – SIMPLE POSITION MULTIPLIER

MQL4 TUTORIAL

Play Episode Listen Later May 7, 2023 4:28


In this video we are going to create an Expert Advisor that contains a position multiplier (SimplePositionMultiplayer). In our case we are trading 5 positions at once, let's stop the Expert Advisor, click on “Expert properties/ Inputs/ NumberOfPositionsToTrade” and increase the value to 10, confirm it with okay. I start another test and this time our Expert Advisor is trading 10 positions and now we are going to find out how to code an Expert Advisor in MQL4 that is able to offer a user adjustable value that can be changed without changing the source code. 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, “Continue”, I will call this one: “SimplePositionMultiplier”, click on “Continue”, “Continue” and “Finish” and now you can remove everything above the “OnTick” function and the two comment lines here. So now let's create an external variable for the number of positions to trade that will be called: “NumberOfPositionsToTrade”; most coders like to use short names and a few weeks afterwards they ask themselves: “What the hell is this variable doing?” but I think if you invest a few seconds to type in a good name for the variable is always time that is good Invested. Okay. In the “OnTick” function we want to create a double variable that is called: “Candle1Close” and it contains the value for the close price of candle 1. Let's do that same thing again but this time we call it: “Candle2Close” because it contains the close price for candle 2 and now we want to stack a few conditions to open a new trade. If “OrdersTotal” delivers a value that is below the “NumberOfPositionsToTrade” we have defined here and if that is the case we come to our second condition; the second condition is we want to test if the last close price was higher than the close price before and that would be the case if the “Candle1Close” price is bigger than the “Candle2Close” price. The current candle is always candle 0, this is candle 1 the candle before is candle 2 and so on, so if this expression is true our price is higher now and now we want to send a buy order that is done by using the “OrderSend” statement. To find out about all the different parameters here just watch the Simple Buy Order video; basically we buy 10 micro lots and our take profit will be 150 points above the “Ask” price and when you are done you can click on the little “Compile” button here or press F7 on your keyboard. That worked without any errors, so now we can click here or press F4 to go back to Metatrader. In Metatrader please click on “View/ Strategy Tester” or press “CTRL and R”, now select the “SimplePositionMultiplayer.ex4” file we just have created and enable the visual mode here, set the “Expert properties”, let's say we want to have 3 trades, click on “OK” and start your test and this time we see 3 open trades on the chart and now you know how to create an Expert Advisor that is able to deliver a user-defined variable that can be adjusted by the user when he clicks on “Expert properties” and you have coded it yourself with a few lines of MQL4 code. Not sure what to do? Click on the automated trading assistant below var aiBot = new AiBot({embedId: 'Qq4PT6s3KaCG', remoteBaseUrl: 'https://humanchat.net/', version: '1.4.18'});

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 Tutorial – Simpler Neue Kerze Expert Advisor mit MQL5

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later May 7, 2023 6:30


MQL5 kann erkennen, wann der Metatrader5 eine neue Kerze auf dem Chart ausbildet und mit dieser Berechnung lassen sich Trading Strategien entwickeln, die beispielsweise aufgrund der Schlusskurse der letzten Kerze handeln. Wenn Sie sich einmal mit Charting oder der so gennanten Markttechnik beschäftigt haben, dann wissen Sie, dass es manchmal nützlich und sinnvoll ist, die höchste Kerze in einem bestimmten Kontext zu ermitteln. In diesem Fall ermitteln wir den Höchstwert der letzten 10 Kerzen. Derzeit zeigt uns der Metatrader hier die Kerze 1 an, das liegt daran, dass die aktuelle Kerze noch nicht fertig ist. Die Kerze, die gerade gebildet wird hat immer die Nummer 0. Das hier ist die Kerze 1 und das hier ist der mit Abstand höchste Punkt, zumindest innerhalb der letzten 10 Kerzen. Lassen wir den Expert Advisor etwas weiter laufen, dann sehen wir jetzt, dass es Kerze 5 ist. Das hier ist jetzt Kerze 0, 1, 2, 3, 4, 5. Tatsächlich, unser Expert Advisor funktioniert. Wie kann man das jetzt auf einfache Art und Weise in MQL5 umsetzen? Um das zu tun, drücken wir im Metatrader hier auf diesen Button oder wir drücken auf die F4-Taste. Das wird den Metaeditor laden. Dort klicken wir hier auf New oder Datei, Neu, wählen den Expert Advisor aus Vorlage, klicken auf Weiter, vergeben hier den Namen SimpleHoechsteKerze, klicken auf Weiter, Weiter, Fertigstellen und entfernen alles oberhalb der Ontick-Funktion. Auch diese zwei Kommentarzeilen hier brauchen wir nicht. Das erste, was wir wirklich brauchen ist eine double Variable. Die soll HoechsteKerzeM1 heissen. Als nächstes erstellen wir ein double Array, also eine ganze Anzahl von Variablen. Dieses Preisarray soll später die Höchstwerte aufnehmen. Jetzt möchten wir gerne unser Array absteigend für die Preise sortieren. Das geht mit der Funktion ArraySetAsSeries. Im nächsten Schritt möchten wir unser Array auch mit Werten befüllen. Das geht mit der Funktion CopyHigh, die holt sich in diesem Fall das aktuelle Währungspaar auf dem Chart und zwar vom Minutenchart, startet bei der aktuellen Kerze und geht 11 Kerzen zurück und kopiert das Ergebnis in unsere Arrayhöchstwerte. Und darin wollen wir jetzt die höchste Kerze ermitteln. Das kann die Funktion ArrayMaximum machen, die unser Array von der aktuellen bis zur elften Kerze davor durchsucht und das Ergebnis hier in die Variable HoechsteKerzeM1 packt. In einem letzten Schritt möchten wir jetzt unser ermitteltes Ergebnis noch mit dem Comment-Befehl auf unserem Chart ausgeben. Dazu zeigen wir den Text Hoechstwert der letzten 10 Kerzen und den Inhalt der Variable HoechsteKerzeM1 an, den wir hier oben berechnet haben. So, jetzt klicken wir auf Kompilieren. Unser Expert Advisor wurde ohne Fehler und mit einer Warnung kompiliert. Diese Warnung hier weist uns darauf hin, dass wir diesen Wert hier eigentlich auch in eine Textkette (wie diese hier) um wandeln sollten. Das wäre etwas eleganter, aber der Einfachheit halber geht es auch so. Über diesen kleinen Knopf hier wechseln wir wieder in den Metatrader und starten über Ansicht, Strategietester oder mit der Tastenkombination STRG und R den Strategietester. Hier wählen wir die Datei SimpleHoechsteKerze.ex5 aus und starten unseren Test. Hier bekommen wir die Anzeige Hoechstwert der letzten 10 Kerzen ist die Kerze Nummer 4. Das hier ist Kerze 0, die wird gerade gebildet und ist noch nicht fertig. 1,2,3,4. Innerhalb der letzten 10 Kerzen ist das hier tatsächlich die höchste Kerze. Lassen wir das etwas weiter laufen, bekommen wir in diesem Fall die Aussage Kerze 1 ist die höchste. Und es handelt sich hier tatsächlich um den höchsten Punkt. In diesem einfachen Expert Advisor haben Sie gelernt,