Podcasts about trailing stop

  • 28PODCASTS
  • 65EPISODES
  • 13mAVG DURATION
  • ?INFREQUENT EPISODES
  • Feb 14, 2023LATEST

POPULARITY

20172018201920202021202220232024


Best podcasts about trailing stop

Latest podcast episodes about trailing stop

herMoney 1x1: Finanzen einfach erklärt
#29 Mit Limit-Orders gegen Verluste im Depot absichern

herMoney 1x1: Finanzen einfach erklärt

Play Episode Listen Later Feb 14, 2023 14:43


Wer gerne mit Wertpapieren zockt oder aber einmal kaufen und sich dann für längere Zeit nicht mehr um das eigene Depot kümmern möchte, für den werden die sogenannten Limit-Orders interessant. Sie sind eine intelligente und komfortable Möglichkeit zur Absicherung gegen Verluste beim Handel mit Wertpapieren wie Aktien, ETFs oder aktiven Fonds. Simin und Saskia erklären dir anhand einfacher Beispiele die wichtigsten Ordertypen: Limit-Order, Stop-Loss-Order, Trailing-Stop sowie die One-Cancels-Other-Order (OCO). Wer diese Folge gehört und verstanden hat, gehört unserer Meinung offiziell zum Börsen-Expertinnen-Kreis! :) Viel Spaß beim Hören! Wenn du die Informationen lieber in einem anschaulichen Artikel nachlesen möchtest, empfehlen wir dir den Artikel von herMoney-Autorin Anke Dembowski: https://www.hermoney.de/boerse-geldanlage/etf/stopp-loss-limits/ P.S.: Machst du schon bei unserer 52-Wochen-Spar-Challenge mit? Auch in diesem Jahr wollen wir gemeinsam sparen. Simins und Saskias Ziel sind 1.378 Euro. Mach' mit und richte dir direkt einen Dauerauftrag auf dein Tagesgeldkonto ein. Falls du Simin und Saskia schreiben möchtest, dann schicke ihnen gerne eine Mail an podcast@hermoney.de Außerdem erreichst du sie über den herMoney-Instagram-Account, Facebook und LinkedIn. Tritt auch gerne der herMoney-Facebook-Gruppe bei und diskutiere hier mit vielen anderen Frauen die Themen, die dich umtreiben. Disclaimer: Dieser Podcast ersetzt keine Beratung und dient ausschließlich Informationszwecken. Aktien, Fonds und ETFs unterliegen Kursschwankungen; damit sind Kursverluste möglich. Bei Wertpapieren, die nicht in Euro notieren, sind zudem Währungsverluste möglich. Die frühere Wertentwicklung ist kein verlässlicher Indikator für die Zukunft. Die Auswahl der Wertpapiere und sonstigen Finanzinstrumente dient ausschließlich Informationszwecken und stellt keine Kaufempfehlung dar.

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 125 SIMPLE ATR SELL TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Feb 27, 2022 7:46


  In this video we are going to create an Expert Advisor that is able to use the Average True Range indicator for a sell trailing stop. So let's find out how to do that with MQL4. To get started please click on a little button here or Press F4 on your keyboard. Now you should see the Meta Editor window and here you want to click on File, new File, Expert Advisor from Template, continue. I will call this file Simple Average True Range Sell Stop. Click on continue, continue and finish.   Now you can delete everything above the on tick function. And let's also remove the two comment lines here. We want to have a basic stop point value for 100 points. So let's define that first. And for the trailing stop we need a calculated stop point value. These are global variables so they will be available in all the functions. Inside of the Ontick function, we first want to create a string variable for the signal, but we don't assign a value here because we are going to calculate that now.   Let's start with the included IATR function that comes with MQL4   . To calculate the average true range value it uses a few parameters. The first one is for the current symbol on the chart, the second one is for the currently selected period on the chart. We want to calculate the result based on 14 candles.   This last parameter here would be a shift value. We don't need that, so we set it to zero. Let's create a static double variable for the old value. Because we want to be able to find out if the current average true range value is below the old value or if the old value is zero. That would be the case the very first time we run this expert advisor. And if one of the conditions is true, we want to set our signal to sell. And if we have a sell signal and the return value for orders total is zero, that would mean we have no open orders and that's when we use order send to open a sell order for ten microlot.   We would do this on a demo account, because we need to have an open position to check if the trailing stop is working. Because now we can calculate the stop point value by calling a user defined function with the name Check ATR Sell trailing stop. We will pass the average true range value. And this function doesn't exist so far, so we need to create it in a few seconds. But before we do that, we want to use the comment function to create an output on the chart for the current signal, the average true range value, and the calculated stop point value. Afterwards we want to assign the current average true range value to the old value. And that's it for the main function. Now we need to create this one. Our user defined function is called Check ATR Sell Trailing Stop. We pass the average true range value here.   Our calculated stop point value will be the basic stop point value and we will add the result of this little calculation here. Now we can calculate the stop loss price and that will be the bid price. And we will add the calculated stop point value times the point value. Now we use a for loop to go through all the open orders. We use Order select for the current counter value and select the position for the trade. Afterwards we want to check if the current order symbol and the symbol on the chart are the same.   And of course we want to know if the current order type is a sell order. That would be the case when it is equal to Op_Sell. And if the order stop loss for the current order is higher than the calculated stop loss price, that's when we want to use Order modify for the current order ticket and the current order open price to set the stop loss to the calculated stop loss price.

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 125 SIMPLE ATR SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Feb 27, 2022 8:05


  In this video we are going to create a sell trailing stop that is triggered by the Average True Range indicator. So let’s find out how to do that with MQL 5. To get started please click on the little button here or Press F4 on your keyboard. Now you should see the Meta Editor window until you want to click on File, new File, Expert Advisor from Template, continue. I will call this file Simple Average True Range Sell Stop.   Click on Continue, continue and finish. Now you can delete everything above the on tick function and let’s remove the two comment lines here. We start with an Include statement to include the file trade mqh. This one contains the class Ctrade and we are going to use an instance called Trade. Let’s set a basic variable for the stop loss points.   We also need to calculate the stop point value and we use a global declaration for the bid price. And inside of the Ontick function we want to have a string variable for our signal. Now we are going to calculate the bid price. That is done by using symbol info double. For the current symbol on the chart we use symbol underscore bid. And with normalize double and underscore digits we can automatically calculate the right number of digits behind the dot depending on the currency pair. Now let’s create a price array.   This is a double array and let’s define the Average True range here. That is done by using the IATR function that is included in MQL5. It uses a few parameters. The first one is for the current symbol on the chart, the second is for the selected period on that chart and we will calculate the result based on 14 candles. Now we use array set as series to sort our price array from the current candle downwards. And with copy buffer we fill our price array according to the definition that we have created here for buffer zero starting from the current candle zero and we want to copy the data for three candles and store them in the array.   Now we can get the Average True Range value for the current candle by looking at candle zero in our price array. I use Normalize Double and Five to cut off five digits. Because that is how we see the Average True range indicator is shown on the chart. I also want to declare a static variable for the old value because I want to know if the current value is below the old value and if that is the case, we want to set our signal to sell and now we use trade sell. And if the signal equals Sell and positions total is below one, we have no open positions but a sell signal and that’s when we use Trade sell to sell it 10 microlot. This is a test position.   We do it on a demo account because to trigger a sell trailing stop we need to have a position. And now we want to get the calculated stop point value by calling a user defined function called Check ATR Sell trailing stop. We pass the average true range value that we have calculated as a parameter. Now let’s add a chart output by using the comment statement. This will output the current signal, the average true range value, and the calculated stop point value. Afterwards we assign the average true range value to the old value for the next time. And that’s it for the main function. But this function doesn’t exist, so we need to create it right now.   Our user defined function will have the name Check ATR Sell trailing stop. It gets the average true range value as a parameter here. We use this little formula to calculate the stop point value by using the defined basic stop point value and we will add this multiplication here. Now we are able to calculate the stop loss price. That is the current bid price plus the calculated stop point value times the point value. With the for loop we go through all the open positions to get the symbol of the current position we use Position get symbol for the current counter value. And if the current symbol on the chart equals the position symbol we want to continue. So let’s get the position ticket by using position get integer and the parameters we use is position underscore ticket. To get the current stop loss we use Position get double and we use the parameter position underscore SL.   And if the current stop loss is greater than the calculated stop loss price or the current stop loss equals zero, that would be the case the very first time we run the Expert Advisor. That’s when we use Trade dot position modify for the current position ticket. To modify the calculated stoploss price. The last parameter would be the take profit value, but we want to leave that unchanged. All we need to do now is to close the loops, return the calculated stop point value to the main function, and close our function. That’s about it.   If this was too fast for you, or if you have no idea what all the code here does, you maybe want to watch one of the former basic videos, or maybe even the premium course might be interesting for you. If that is the case, you can find it on our website where we also have a link to the shop where you can download source codes. If you don’t want to type everything yourself, let’s remove the additional bracket here and click on the compile button or Press F 7. You shouldn’t get any errors here, and if that is the case, you can click on a little button here or Press F4 to go back to MetaTrader. Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 122 SIMPLE AVERAGE TRUE RANGE BUY… MQL5 TUTORIAL BASICS - 82 SIMPLE SMA SELL TRAILING STOP MQL5 TUTORIAL BASICS - 24 HOW TO CODE THE AVERAGE TRUE RANGE… MQL5 TUTORIAL BASICS - 116 SIMPLE ENVELOPES SELL TRAILING… MQL5 TUTORIAL BASICS - 45 SIMPLE SAR SELL TRAILINGSTOP The post MQL5 TUTORIAL BASICS – 125 SIMPLE ATR SELL TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 125 SIMPLER ATR SELL TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Feb 27, 2022 9:22


  In diesem Video wollen wir uns einmal anschauen, wie man für den Average True Range Indikator einen Sell Trailing Stop programmieren kann, der nachgezogen wird, wenn der der Wert für diesen Indikator hier sinkt. Also lassen Sie uns einmal schauen, wie man so etwas mit MQL5 programmieren kann. Um das zu tun, klicken Sie im MetaTrader bitte hier oben auf dieses kleine Symbol 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 SimplerAverageTrueRangeSellStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb dieser OnTick-Funktion hier entfernt werden und auch die zwei Kommentarzeilen werden gelöscht. Wir starten mit einer include-Funktion für die Datei Trade.mqh.   Diese Datei ist im Umfang von MQL5 enthalten und sie enthält die Klasse CTrade von der wir uns hier eine Instanz mit dem Namen trade erstellen. Außerdem benötigen wir einige Variablen. Die Erste ist für den Basis Stop Point Wert, die Zweite ist für den berechneten Stop Point Wert und die dritte Variable ist der Bid Preis. Den nutzen wir diesmal als globale Variable. Alle Variablen, die außerhalb einer Funktion deklariert werden stehen für alle Funktionen zur Verfügung. Innerhalb der OnTick-Funktion erstellen wir uns jetzt eine Signal-Variable. Die ist vom Typ string, aber wir weisen hier noch keinen Wert zu. Danach berechnen wir den Bid Preis. Das übernimmt die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart.   Wir nutzen SYMBOL_BID und mit NormalizeDouble und _Digits stellen wir sicher, dass die richtige Anzahl von Nachkommastellen für das jeweilige Währungspaar ermittelt werden. Als nächstes erstellen wir ein PriceArray für unsere Preisdaten und für die Definition unseres Average True Range Indikators nutzen wir die eingebaute Funktion iATR. Die benötigt einige Parameter. Der erste Parameter ist das aktuelle Währungspaar. Der zweite Parameter die auf diesem Währungspaar ausgewählte Zeiteinheit und wir möchten das Ergebnis anhand von 14 Kerzen berechnen. Mit der Funktion ArraySetAsSeries sortieren wir unser PriceArray jetzt von der aktuellen Kerze an abwärts. Und mit der Funktion CopyBuffer füllen wir unser PriceArray mit Daten. Anhand der Definition, die wir hier oben getroffen haben, möchten wir für Buffer 0, das ist die Signallinie, von der aktuellen Kerze 0 für drei Kerzen die Daten in unserem PriceArray speichern.   Jetzt können wir den aktuellen Average True Range Wert berechnen, in dem wir auf Kerze 0 in unserem PriceArray zugreifen und mit NormalizeDouble und fünf Nachkommastellen stellen wir sicher, dass die Darstellung so ist wie auch auf dem Chart zu sehen. Denn hier wird für den Indikator auch das Ergebnis mit fünf Nachkommastellen angezeigt. Wir benötigen auch eine statische Variable vom Typ double für den alten Wert. Und wenn der aktuelle Average True Range Wert kleiner ist als der alte Wert, dann haben wir ein Verkaufssignal und dann setzen wir unser Signal auf sell und wenn wir ein Verkaufssignal haben und die Anzahl der Positionen kleiner ist als 1, dann bedeutet das, wir haben keine offenen Positionen, aber ein Verkaufssignal und dann nutzen wir trade.Sell, um eine Testposition von 10 Microlot zu eröffnen. Das hier machen wir auf einem Demokonto, und zwar deshalb damit wir sehen können, ob unser Trailing Stop funktioniert, denn dazu benötigen wir eine geöffnete Position. Wir ermitteln den Wert für den Trailing Stop in dem wir hier eine benutzerdefinierte Funktion mit dem Namen CheckATRSellTrailingStop aufrufen und ihr den Parameter...

Libe Podcast - Finances Personnelles, Bourse, Entreprenariat, Immobilier et Profiter de la vie
41. La résilience, l'expérience et le trailing stop en bourse. Investir sur les marchés avec sécurité.

Libe Podcast - Finances Personnelles, Bourse, Entreprenariat, Immobilier et Profiter de la vie

Play Episode Listen Later Feb 26, 2022 40:05


Pour en savoir plus sur le bootcamp et prendre un appel découverte:https://liberte45.com/bootcamp

Doppelgänger Tech Talk
#121 Wann World-ETF kaufen?⌛ Crash Angst

Doppelgänger Tech Talk

Play Episode Listen Later Feb 23, 2022 76:04


Crash after Crash - verlieren wir jetzt Aktionäre und Hörer? Scheitern und Angst beim Gründen? Wann DAX Werte in einen World-ETF umschichten? Macht es Sinn seine Positionen mit einem Trailing Stopp Loss abzusichern? Welchen Einfluss hat die aktuelle politische Weltlage (z.B. Ukraine Konflikt) auf Tech Werte? Earnings von Coursera, SimilarWeb und live von MercadoLibre. NFT Stress bei Opensea und Salesforce. Private-Equity hat Interesse an FlatexDegiro. Philipp Glöckler (https://twitter.com/gloeckler) und Philipp Klöckner (https://twitter.com/pip_net) sprechen heute über: (00:05:20) Angst vorm Scheitern als Selbstständig er (00:13:15) Wann ist der beste Zeitpunkt in den MSCI World einzusteigen (00:18:00) Wann Trailing Stop Loss Limits Sinn machen (00:30:50) Politische Börsen, donnernde Kanonen, Time In The Market (00:46:00) Coursera (00:52:20) Similar Web (00:57:20) Mercado Libre (01:01:00) OpenSea phishing attack (01:08:45) Flatex Degiro wird übernommen? Shownotes: **Doppelgänger Tech Talk Podcast** Sheet https://doppelgaenger.io/sheet/ Earnings & Event Kalender https://www.doppelgaenger.io/kalender/ Disclaimer https://www.doppelgaenger.io/disclaimer/ Post Production by Jan Wagener https://www.linkedin.com/in/jan-wagener-49270018b Sponsoring: https://www.doppelgaenger.io/sponsoring/

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 123 WIE MAN FEHLER IN GROSSEN JOURNAL DATEIEN FINDET

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Jan 29, 2022 4:43


  In diesem Video möchten wir uns einmal mit dem Thema Fehlersuche beschäftigen. Das hier ist ein Sell Trailing Stop, aber der bewegt sich leider nicht. Es liegt also ein Fehler vor und ich würde gerne wissen, woran das liegt. Man kann so auf den ersten Blick nichts erkennen, auch wenn wir in die Historie schauen, dann sehen wir nur, dass der Trailing Stop sich nicht bewegt hat. Auch auf dieser Reiterkarte hier, lässt sich nichts finden. Nur wenn wir ins Journal gucken, dann sehen wir, dass hier Fehler auftreten. Die sieht man von Zeit zu Zeit. Es kann allerdings auch sein, dass über einen längeren Zeitraum überhaupt keine Fehler auftreten. Und wenn man dann nicht direkt ins Journal schaut, dann kann man sich hinterher nur die Frage stellen, was da schief gegangen ist. Wir halten jetzt hier mal kurz den Test an. Es kann sein, dass das noch eine Zeit lang dauert, bis alle Einträge ins Journal geschrieben worden sind.   Da kommen wirklich große Dateien bei raus. Ich glaube jetzt sind alle Einträge fertig und wir klicken jetzt einfach in das Journal mit der rechten Maustaste auf einen Eintrag und wählen hier Öffnen aus, dann wird hier im Explorer eine Datei angezeigt. Die ist von heute, man kann das hier an diesem Datum erkennen. Und wenn man den Mauszeiger einmal über diese Datei hält, dann sieht man, dass die ziemlich groß ist. Wenn ich jetzt auf die rechte Maustaste klicke und Öffnen sagen, dann wird mein Windows-System wahrscheinlich abstürzen, denn solche großen Dateien lassen sich mit der mitgelieferten Notepad Applikation nicht so gut durchsuchen. Ich werde jetzt stattdessen dieses Programm hier verwenden. Das heißt Notepad++. Das ist eine kostenlose Software die man sich bei Webseiten wie Chip oder Heise herunterladen kann.   Und dieses Programm ist in der Lage, auch mit sehr großen Dateien zurecht zu kommen. Wir sehen, dass wir hier viele tausend Zeilen haben. Ich stelle das hier mal auf deutsche Sprache um. Und das gute an dieser Software ist, dass wir hier auf Suchen klicken und nach einem Begriff suchen können. Zum Beispiel nach login. Hier gibt es diesen Button „Alle in aktiver Datei suchen“ und wenn ich den klicke, dann werden mir die Suchbegriffe hier unten in einem separaten Bereich angezeigt. Und ich kann jetzt auf diese Einträge hier klicken und der Editor springt an die Stelle, wo diese Suchbegriffe gefunden worden sind. Natürlich wäre es auch möglich das hier durchzuscrollen und das alles manuell durchzugehen, aber das könnte mehrere Stunden dauern. Bei solchen großen Dateien ist das also sehr hilfreich.   Notepad++ kann das übrigens auch für unterschiedliche Suchbegriffe. Wir wissen in unserem Fall, dass ein Trailing Stop fehlgeschlagen ist. Wenn ich also nach dem Begriff failed suche, dann werden mir hier alle Fehler angezeigt. Ich könnte auch nach diesen eckigen Klammern hier suchen. Klicke wieder auf „Alle in aktiver Datei suchen“ und nach einigen Sekunden sollte das Ergebnis hier auftauchen. Hier sind die Suchergebnisse auch schon zu sehen. In meinem Fall haben wir 261.696 Treffer und ich kann für jeden dieser Treffer jetzt direkt die entsprechende Zeile in der Riesendatei aufrufen. Das spart einen ganze Menge Zeit. Wenn wir in Google mal nach dem Begriff MQL5 Error Codes suchen, dann durfte das hier das erste Suchergebnis sein. Wenn man das anklickt, dann sieht man diese Tabelle hier.   Auf der Webseite mql5.com, auf der Seite lassen sich die Fehlercodes noch einmal explizit durchsuchen. So weit ich weiß gibt es das auch in Deutsch. Für manche Fehler gibt es hier noch ausführlichere Beschreibungen.

The BlackGirlOption Podcast
EP 11: Gaps and ATR Trailing Stop Trading with Greg Collier

The BlackGirlOption Podcast

Play Episode Listen Later Jan 24, 2022 65:21


In this episode of The BlackGirlOption Podcast your host Kayla Salem talks with Investor-Trader-Stock Market Analyst Greg Collier. Greg discusses his early begininngs investing and trading in the tock market. Greg also talks about how it was like trading for huge corporations in the early 90's as well as how technology and trading have progressed over the years, along with that Greg also talks about his trading strategies now which includes playing gaps and using the ATR trailing stop strategy. Connect wit Greg via instagram @GregCollierSupport the show (https://www.paypal.com/donate/?business=6JWLL8V3ABK7W&item_name=Support+The+Podcast%21¤cy_code=USD)

Kapitalbildung - Verdienen | Sparen | Investieren
88. Ordertypen: Limit, Stop, Stop-Limit und Trailing Stop-Loss

Kapitalbildung - Verdienen | Sparen | Investieren

Play Episode Listen Later Jan 6, 2022 16:29


Die Shownotes findest du im Blogbeitrag dieser Folge: 88. Ordertypen: Limit, Stop, Stop-Limit und Trailing Stop-Loss Beim Kauf und Verkauf von Anteilen gibt es jede Menge Zusätze, die auch Ordertypen genannt werden. Dazu gehören das Limit, der Stop, das Stop-Limit und die dynamische Stop-Loss-Order. Doch was genau bringen diese Zusätze und brauchst du sie für deine Kapitalbildung? Genau das klären und besprechen wir heute und schauen auf die Zusätze. Dabei berichte ich auch aus meinen eigenen Erfahrungen. Hier der Link zum Interview mit dem Gründer von getquin: https://kapitalbildung.org/folge-058/ Dort kannst du dir die kostenlose App für iOS oder Android herunterladen und mein persönliches Depot anschauen. Wenn du noch keinen Finanzplan für dein Geld hast, dann lass es uns gemeinsam angehen. Hier geht's zur Finanzplanung: https://kapitalbildung.org/finanzplanung/ Ich freue mich, dass du meinen Podcast hörst. Wenn er dir gefällt, dann bewerte ihn gerne bei iTunes oder abonniere meinen Instagram-Kanal: https://www.instagram.com/kapitalbildung/ Auch bei Fragen oder Anregungen kannst du dich gerne per E-Mail oder Instagram bei mir melden. Bis dahin wünsche ich dir viel Erfolg bei deiner Kapitalbildung! Dein Thorsten

Bayu Rambling about Finance
87. Update Aturan Trailing Stop Loss

Bayu Rambling about Finance

Play Episode Listen Later Nov 29, 2021 11:01


Karena manusia gudangnya salah, mari kita perbaiki Pertanyaan bisa ke : bayutabusalla@gmail.com IG : instagram.com/bayutabusalla Tip : karyakarsa.com/ekonompemalas

Quant Trading Live Report
New strategy with Reverse MACD and ATR Trailing stop merged

Quant Trading Live Report

Play Episode Listen Later Nov 2, 2021 6:43


I have finally debugged a new strategy merging with Reverse MACD and ATR Trailin Stop studies from MotiveWave. It appears I am able to get some complete orders fillled.  Here are some of the extra benefits if you want to take advantage of this last offe.   More concise features of this annual membership: MotiveWave non coding Trading Course How trade cryptocurrency high level 4 week course Overview for Private Chat Server including signals hidden trading room Access to Archived Webinars in Bootcamp series Go here to sign up https://quantlabs.net/shop/product/quant-analytics-subscription-6-month-promo/ Join my newsletter for some free trading PDFs https://quantlabs.net/contact/ Or join the Private chat server at https://quantlabs.info/

Andrea Unger Academy - EN
184. Trailing Stop Loss and Trading Systems - How To Use It and Does It Really Work?

Andrea Unger Academy - EN

Play Episode Listen Later Oct 12, 2021 6:23


Andrea Unger Academy - IT
184. Trailing Stop Loss e Trading Systems - Come si usa e funziona davvero?

Andrea Unger Academy - IT

Play Episode Listen Later Oct 12, 2021 8:52


Swing-Trading the Stock Market
Using Trailing Stop Losses

Swing-Trading the Stock Market

Play Episode Listen Later Oct 1, 2021 21:32


Trailing stop losses or traditional stop-loss orders! Which one should you use? Ryan talks about the pros and cons of using stop-losses and whether he uses them in his swing trading. Whiskey: Blanton's Special Reserve (Green Label) Be sure to check out my Swing-Trading offering through Patreon that goes hand-in-hand with my podcast, offering all of the research, charts and technical analysis on the stock market and individual stocks, not to mention my personal watch-lists and regular updates on the most popular stocks, including FAANG stocks, Microsoft and Tesla. This is provided each and every week! Check it out now at: www.swingtradingthestockmarket.com

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 116 SIMPLE ENVELOPES SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Sep 15, 2021 8:25


  In this video we are going to create an expert advisor that is able to adjust a sell trailing stop according to the upper band of the envelopes indicator. So let’s find out how to do that with MQL5. To get started, please click on the little button here or Press F four on your keyboard. Now you should see the Metaeditor window and here you want to click on File, new File, Expert Advisor from Template. I will call this file Simple Envelopes Sell Trailing Stop. Click on continue, continue and finish.   Now you can delete everything above the Ontick function and let’s remove the two comment lines here. We start with an include statement to include the file trade.mqh. This file is part of MQL5 and it will help us to open a test position. To do that, we need to create an instance of the class Ctrade and that will be called trade. We need to define a static double variable called Last Stop envelopes value.   This will hold the last stop loss value for each time we call the function. We also need to calculate the ask price and the bid price. That can be done by using symbol info double for the current symbol on the chart. We either use symbol underscore ask or symbol underscore bid and with normalize double and underscore digits, we make sure that we automatically calculate the right number of digits behind the dot. To test a trailing stop, we need to open a test position.   Therefore, we check if positions total is below one. If that is true, we want to reset the last value for the stop loss and set it to zero and then we use Trade.sell to sell ten micro lot. You wouldn’t do that on a real account, but that’s what demo accounts are good for. Let’s continue and create two arrays for the upper and the lower band array. We use Array set as series for both arrays to sort them from the current candle downwards. And now we can use the included function Ienvelopes for the current symbol on the chart and the currently selected period on that chart to calculate the envelopes indicator for 14 candles. We don’t use a shift value here. The next parameter is mode underscore SMA, that stands for Simple Moving Average. The result should be calculated based on the close price and this last parameter here is for the deviation, that’s the standard value. If you pick an empty chart window and click on insert, indicators, trend, envelopes, you will also see this value as a deviation value.   Here are the 14 candles. Now please click on OK, rightclick into the chart. Select Templates, save template and save this one as tester.tpl. You can override the current value. Tester.tpl  is the view that we will see when we start the strategy tester.   But back to coding. We continue by using copy buffer to copy data according to the envelopes definition that we have created here, either for buffer zero or for buffer one, for candle zero. That’s the current candle and we want to copy the values for three candles and store them in the upper or in the lower band array. It’s now possible to get the current value for candle zero. I have out commented it in this version, because I’m more interested in the values for the candle before. That’s candle one. To get the last upper band value or the last lower band value, I will look into our array at candle one and with normalize double and comma six, I make sure that the value is using six digits behind the dot. Because that’s also what the original envelopes indicator will show. Now we can call a custom function called CheckEnvelopesSelltrailingStop and pass the last upper band value as a parameter. This function doesn’t exist, so we need to create it in a few seconds. The last thing in the Ontick function is to assign the last upper band value to the last stop envelopes value here, because we need that the next time we call the function.   Now let’s actually create the check envelopes sell trailing stop.   It will get the last upper band value as a parameter here. The type is void because we don’t return any values. We use a for loop to go through all the open positions and we use position get symbol for the current counter value to get the position symbol, because we only want to continue if the current symbol on the chart and the position symbol are equal. If that is the case, we use position get integer and use position underscore ticket to get the current position ticket number. And with position get double, position underscore SL, we can get the current stop loss for the current position.   And now we want to check if the current stop loss for this position is bigger than the last upper band value, or if the current stop loss is zero.   If one of those cases is true, we use trade dot position modify for the current position ticket and adjust the stop loss value to the last upper band value here. The last parameter here is for the take profit. We leave that unchanged. Finally, we need to close the loops and the function here and that’s about it. Well, if this was too fast for you or if you have no idea what all the code here does, maybe you want to watch one of the other videos of the basic series, or maybe even the Premium course on our website might be interesting for you.   We also offer some source codes, if you need more we also have a shop. But for now please click on the compile button or Press F seven on your keyboard. You shouldn’t get any errors Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 17 HOW TO PLACE A SELL STOP MQL5 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY… MQL5 TUTORIAL BASICS - 82 SIMPLE SMA SELL TRAILING STOP MQL5 TUTORIAL BASICS - 44 SIMPLE SAR BUY TRAILING STOP The post MQL5 TUTORIAL BASICS – 116 SIMPLE ENVELOPES SELL TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 116 SIMPLER ENVELOPES SELL TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Sep 15, 2021 8:44


  In diesem Video wollen wir uns einmal anschauen, wie man einen Sell Trailing Stop für diesen Indikator hier programmieren kann. Es handelt sich um den Envelopes-Indikator. Also lassen Sie einmal schauen, wie man so etwas mit MQL5 programmieren kann. Um das zu tun, klicken Sie bitte im Metatrader hier oben auf dieses kleine Symbol 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 SimplerEnvelopesSellTrailingStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion gelöscht werden und auch die zwei Kommentarzeilen werden entfernt.   Wir starten hier mit einem include-Befehl für die Datei trade.mqh. Die ist Bestandteil von MQL5 und wir können darin von der Klasse CTrade eine Instanz mit dem Namen trade erstellen. Diese Instanz werden wir später nutzen, um eine Testposition zu eröffnen. Innerhalb der OnTick-Funktion starten wir damit, dass wir uns eine statische Variable vom Typ double erstellen. Die soll uns den letzten Stop Loss-Wert wieder zur Verfügung stellen, wenn die Funktion das nächste Mal aufgerufen wird. Danach berechnen wir den Ask Preis und Bid Preis. Das geht mit der Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Wir nutzen entweder SYMBOL_ASK oder SYMBOL_BID und mit NormalizeDouble und _Digits stellen wir sicher, dass jeweils die richtige Anzahl von Nachkommastellen hinter den Komma berechnet wird. Damit wir eine Trailing Stop auch anpassen können brauchen wir auch eine Position. Wir prüfen also im nächsten Schritt ob PositionsTotal uns einen Wert von kleiner 1 liefert. Wenn das der Fall ist, dann setzten wir hier unseren letzten Wert für den Stop Loss auf 0.   Danach eröffnen wir eine Testposition mit trade.Sell. Die Position soll 10 Microlot groß sein. Natürlich würden man diesen Schritt auf einem Echtgeldkonto überspringen, aber dafür sind Demokonto ja da. Weiter geht es. Wir benötigen jetzt jeweils ein Array für das obere und für das untere Band des Indikators. Danach nutzen wir ArraySetAsSeries, um das Array für das obere und für das untere Band von der aktuellen Kerze an abwärts zu sortieren und jetzt können wir die in MQL5 enthaltene Funktion iEnvelopes nutzen, um für das aktuelle Währungspaar und die auf dem Chat aktuell ausgewählte Zeiteinheit für 14 Kerzen den Wert des Indikators zu berechnen. Wir nutzen hier keinen Verschiebungswert. Dieser Parameter hier, MODE_SMA, steht für Simple Moving Average. Die Ergebnisse sollen anhand der Schlusskurse berechnet werden.   Und dieser Wert 0.100 den sieht man auch, wenn man auf einem leeren Chartfenster einmal auf Einfügen, Indikatoren, Tendenz, Envelopes klickt. Da ist der Wert. Es handelt sich um den Abweichungswert oder auf Englisch Deviation-Wert. Bitte übernehmen Sie hier alle grundlegenden Einstellungen, klicken auf OK. Jetzt erscheint der Indikator auf dem Chart und jetzt klicken wir mit der rechten Maustaste, wählen Vorlagen, Vorlage speichern und speichern das Ganze unter den Namen tester.tpl. Den alten Wert können Sie hier ersetzen. Tester.tpl ist die Schablone, die angezeigt wird, wenn wir einen Strategietest starten, aber zurück zum Programm. Mit CopyBuffer können wir uns jetzt anhand der Envelopes-Definition, die wir hier oben getroffen haben, entweder für Buffer 0 oder Buffer 1, das steht für das jeweilige Band, von der aktuellen Kerze 0 für drei Kerzen die Daten ins obere bzw. untere Band-Array kopieren. Das ermöglicht uns dann die Werte für die aktuelle Kerze zu ermitteln. Das hab ich hier aber mal auskommentiert, denn in diesem Fall interessiert uns eher die Kerze davor.   Das ist Kerze 1 und den Wert dafür erhalten wir, indem wir auf Kerze 1 im jeweiligen Array zugreifen. Ich hab hier noch NormalizeDouble und die Sechs genutzt, um die Wert auf sechs Nachkommastellen zu kürzen. Das ist nämlich auch das was wir angezeigt bekommen,

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 115 SIMPLE ENVELOPES BUY TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Aug 15, 2021 6:58


  In this video, we are going to create an Expert Advisor that is able to create a buy trailing stop that is based on this indicator, it's the envelopes indicator. So let's find out how to do that with MQL4. To get started, please click on a little icon here or press F4 on your keyboard. Now you should see the Metaeditor window and here you want to click on file, New file, Expert Advisor from template, continue. I will call this file Simple Envelopes buy trailing stop.   Click on continue, continue and finish. Now you can delete everything above the ontick function. And let's also remove the two comment lines here. We start by creating a static variable. It's a double variable and we are going to use it to save the value for the last Stop Loss and to use a trailing stop, we obviously need to create a test buy position. You wouldn't do that on a real account, but on a demo account we will check if OrdersTotal equals zero, that would mean we have no open position.   And in that case we use Ordersend to open a Buy position for 10 Microlot. Of course, we need to reset the value for the last Stop Loss, because with a new position we need a new Stop Loss level. Let's continue and calculate the values for the lower band and for the upper band. That is done by using the included function Ienvelopes for the current symbol on the chart and the currently selected period on that chart. We want to calculate values for fourteen candles.   We use ModeUnderscoreSMA for simple moving average, no shift value. The result should be calculated based on the close price. And if you wonder what this value is, well, if you open a new chart window and click on insert indicators, trend, envelopes, the standard value is zero point ten percent. So let's click on OK, let's use that value in our indicator. This parameter here is for buffer two or buffer one. If you open the reference, you will see that the ienvelopes function uses mode upper or mode lower, or the values would be one for the upper line and two for the lower line.   That's actually what we are using here. The last value here is for the candle number. We are going to use candle one. And if the last stop envelopes value is below the lower band, we want to call a function that is called check envelopes buy trailing stop. And we want to pass the lower band value here as a parameter. At the end of the ontick function, we want to save the lower band value as last stop envelopes value for the next time we call the function.   But this function doesn't exist. So let's create that. The return type is void, the name as check envelopes buy trailing stop. We are passing the lower band value here, afterwards we are going to use a For loop to go through all the open orders and for each order we want to use orderselect to select the order, then we want to check if the current order symbol equals the symbol on the chart. On top of that, we want to check if the order type equals OP buy.   So it's a buy trade. And if all that is true, we also want to know of the order Stop Loss is below the lower band. If all those conditions are true, we use order modify to modify the current order and adjust the Stop Loss to the value for the lower band. Finally, please close all the open loops and functions and that's about it. Well, if this was too fast for you or if you have no idea what all the code here does, maybe you want to watch one of the other videos in the basic video series or maybe even the Premium Course on our website might be interesting for you.   For now, please click on the Compile button or press F7 on your keyboard, you shouldn't get any errors here. And if that is the case, you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader, you want to click on insert, indicators, trend, envelopes. Please go with the default values here. Click on OK. Now you should see the indicator on the chart. Maybe you need to zoom in or zoom out.   Now right click onto the chart,

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 115 SIMPLE ENVELOPESBUY TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Aug 15, 2021 8:54


  In this video, we are going to create a buy trailing stop that is based on the envelopes indicator. So let’s find out how to do that with MQL5. 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 you want to click on file, new file, Expert Advisor from Template, Continue. I will call this file simple envelopes buy trailing. Stop, click on Continue, continue and finish.   Now you can delete everything above the Ontick function and the two Comment lines here, we start with an include statement and we’ll include the file Trade.mqh. This one comes with MQL5 and we can create an instance of the included Class Ctrade. That instance will be called trade and we are going to use it to open a position later on. Inside of the ontick function, we start with a static variable. This is a double variable for the last value of the Stop Loss.   Afterwards, we need to calculate the Ask price and the Bid price. That can be done by using Symbolinfodouble for the current symbol on the chart, we use either symbol underscore ask or we use symbol underscore bid and with normalize double and underscore digits, we make sure that we calculate the right number of digits behind the dot, because there are currency pairs with three digits and others have five digits. For our Stop Loss, we need to open a test position. That wouldn’t be done on a real account.   But if we have no open positions and that would be true of PositionsTotal is below one, we want to open a test position on our demo account. So we use trade.Buy to buy 10 Microlot and we want to reset the last value for the Stop Loss. Because with the new position we need to set a new Stop Loss value. Now let’s continue with two arrays, one for the upper band and one for the lower end of the envelopes indicator. With arrays set as series we sort the upper and lower band array from the current candle downwards. And now we can use the included Ienvelopes function for the current symbol on the chart and the currently selected period on that chart.   We want to calculate the values for 14 candles, the next value here is a shift value. We don’t need that. So we set it to zero. We use MODE SMA for simple moving average. The result should be based on the close price and this last value here is what you see when you open a new chart and click on insert, indicators, trend, Envelopes. It’s the so-called deviation. We are going with the standard values here. Click on OK.   Here is the indicator, and now we want to right click into the chart, save the template as tester.tpl, you can override the current value because the Tester.tpl template is what we will see in the strategy tester. Now, let’s add some data. We use Copybuffer according to the envelopes definition that we have created here. To fill our array for the buffer zero and the buffer one. Buffer zero is for the upper Band and buffer one is for the lower band.   We want to copy data from the current Candle zero for three candles and store those values in our arrays. To calculate the upper band array for the current candle, we only need to look at Candle zero in our upper band array. I use Normalize double and six to cut it to six digits behind the dot. And we repeat that for the lower band value. Let’s repeat that, everything is equal, but this time we are doing it for candle one. That’s the candle before the current candle.   And of course, the variable names are different. This time, we use my last upper band value and my last lower band value. So let’s check for the conditions for the buy trailing stop. The first condition would be that the last lower band value is below the current Bid price. The second condition is we want to check if the last lower band value is bigger than the last stop envelopes value. If both conditions are true, we want to call a function that is called check envelopes buy trailing stop and we want to pass the last lower bands value as a parameter here.   This function doesn’t exist so far, so we need to create it in a few minutes. And once we have adjusted the Stop Loss, we assign the last lower band value to the variable last stop envelopes value. That’s it for the Ontick function. Let’s continue with the trailing stop function. It will get the last lower band value as a parameter. Now we need to use a for loop to go through all the open positions. We use position get symbol for the current counter value to get the symbol.   And if the current currency pair on the chart equals our position symbol, we are going to continue. We need to get the position ticket. That can be done by using  position get integer and the parameter here is position underscore ticket. Let’s also get the current Stop Loss for this position. That can be done by using position get double and the parameter here is buy position underscore SL. And if the current Stop Loss is below the last lower band value, we are going to use trade position modify to move the Stop Loss to the last lower band value that we have calculated.   Now let’s end the loops here and the function and that’s about it. Well, if this was too fast for you or if you have no idea what all the code here does, you maybe want to watch one of the other videos in the basic video Not sure what to do? Click on the automated trading assistant below MQL5 Tutorial - Simple Sell Stop Expert Advisor MQL5 TUTORIAL BASICS - 81 SIMPLE SMA BUY TRAILING STOP MQL5 TUTORIAL BASICS - 82 SIMPLE SMA SELL TRAILING STOP MQL5 TUTORIAL BASICS - 102 SIMPLE BUY CROSSOVER STOP LOSS MQL5 TUTORIAL BASICS - 104 SIMPLE SELL CROSSOVER STOP LOSS The post MQL5 TUTORIAL BASICS – 115 SIMPLE ENVELOPESBUY TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 115 SIMPLER ENVELOPES BUY TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Aug 15, 2021 8:15


  In diesem Video wollen wir einmal anhand dieses Indikators hier einen Buy Trailing Stop programmieren. Der vom Envelopes-Indikator gesteuert wird. Also lassen Sie uns einmal schauen, wie man so etwas mit MQL5 programmieren kann. Um das zu tun, klicken Sie bitte hier oben auf dieses kleine Symbol oder drücken Sie die F4-Taste im Metatrader. 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 SimplerEnvelopesBuyTrailingStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion hier gelöscht werden und auch die zwei Kommentarzeilen werden entfernt. Wir starten hier mit einem include-Befehl.   Der wird uns die Datei trade.mph importieren. Die ermöglicht es uns von der Klasse C-Trade eine Instanz mit dem Namen trade zu erstellen und die werden wir gleich nutzen, um eine Testposition zu eröffnen. In der OnTick-Funktion starten wir mit einer statischen Variable vom Typ double. Die soll den Wert für den letzten Stop-Loss speichern. Danach ermitteln wir den Ask-Preis und den Bid-Preis. Das geht über die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Wir nutzen entweder SYMBOL_ASK oder SYMBOL_BID und mit NormalizeDouble und _Digits ermitteln wir automatisch wie viele Nachkommastellen das jeweilige Währungspaar hat. Damit wir einen Stop-Loss testen können müssen wir eine Testposition eröffnen.   Das macht man natürlich nur auf einem Demokonto und immer, wenn PositionsTotal uns einen Rückgabewert von kleiner 1 zurückgibt, dann bedeutet das, dass wir keine geöffnete Position haben. Und dann eröffnen wir hier mit trade.Buy eine Testposition über 10 Microlot. Direkt im Anschluss setzen wir den letzten Stop-Loss-Wert zurück, denn mit einer neuen Position muss der Stop-Loss natürlich auch neu berechnet werden. Für unseren Envelopes-Indikator brauchen wir zwei Arrays. Die erstellen wir hier und im Anschluss nutzen wir ArraySetAsSeries, um diese beiden Arrays von der aktuellen Kerze an abwärts zu sortieren. Danach nutzen wir die in MQL5 eingebaute Funktion iEnvelopes für das aktuelle Währungspaar auf dem Chart und die auf dem Chart ausgewählte Zeiteinheit, um den Indikatorwert für 14 Kerzen zu berechnen. Den Verschiebungswert setzen wir auf 0.   Wir nutzen MODE_SMA für Simple Moving Average. Das Ergebnis soll anhand der Schlusskurse berechnet werden und dieser letzte Parameter hier ist der sogenannte Diviation-Wert. Wenn Sie einmal ein leeres Chart öffnen und auf Einfügen, Indikatoren, Tendenz, Envelopes klicken, dann sehen Sie auch hier diesen Wert als Abweichung von 0.100. Wir übernehmen hier mal die Standardwerte, klicken auf OK, klicken mit der rechten Maustaste in das Chart, speichern diese Vorlage unter dem Namen tester.tpl, denn das ist die Vorlage, die wir gleich im Strategietester sehen werden. Den alten Wert können Sie hier getrost ersetzen. Weiter geht´s im Metaeditor mit dem Befehl CopyBuffer. Der wird uns anhand der Envelopes-Definition, die wir hier oben getroffen haben, die Daten für Buffer 0 und für Buffer 1 in das obere beziehungsweise in das untere Band kopieren. Wir starten jeweils mit Kerze 0 und kopieren uns Preisdaten für drei Kerzen. Um den aktuellen Wert zu berechnen, brauchen wir nur in Kerze  des jeweiligen Arrays hineinzuschauen. Mit NormalizeDouble und ,6 kürze ich das Ganze hier auf sechs Nachkommastellen.   Uns interessiert in diesem Fall eher die Kerze davor. Die Werte lassen sich ähnlich ermitteln. Hier schauen wir einfach auf den Wert von Kerze 1 und natürlich müssen wir auch den Namen der Variablen entsprechend anpassen. Weiter geht´s mit den Prüfkonditionen, denn wir möchten gerne wissen, ob der letzte Wert für das untere Band kleiner ist als der Bid-Preis. Als nächstes überprüfen wir, ob der Wert für das letzte untere Band größer ist als der Wert für unseren letzten Stop-Loss und wenn beide Bedingungen zutreffen,

The Investor Show
How Do I Do A Trailing Stop On Etrade (4 Min)

The Investor Show

Play Episode Listen Later Apr 19, 2021 5:16


How do I do a trailing stop on Etrade? (4 min)

Florida Mosquito Radio
Episode 5 - BUY TRAILING STOP? BLINK al top!

Florida Mosquito Radio

Play Episode Listen Later Dec 22, 2020 21:36


Episode 5 - Come funziona il BUY TRAILING STOP? BLINK al top!

Radio USA – Notizie dall'America
Episode 5 - BUY TRAILING STOP? BLINK al top!

Radio USA – Notizie dall'America

Play Episode Listen Later Dec 22, 2020 21:36


Episode 5 - Come funziona il BUY TRAILING STOP? BLINK al top!

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 84 SIMPLE BOLLINGER BANDS SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Nov 7, 2020 8:29


In this video we are going to create an expert advisor that is able to move a sell trailing stop for the upper bollinger band, so let’s find out how to do that with mql5. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file, simple bollinger bands sell trailing stop, click on continue, continue and finish. Now you can delete everything above the ontick function and the two comment lines here. We start with an include statement to include the file trade dot mqh, this one will give us some simple trading functions, it contains the class ctrade and we are going to create an instance of ctrade that will be called trade. Inside of the ontick function, we want to create a static double variable, called last stop bollinger bands value. We are going to use it later to move our trailing stop and compare the current value with the last value. We also need to calculate the ask price and the bid price that is done by using symbol info double for the current symbol on the chart, we use either symbol ask or symbol underscore bid and with normalize double and underscore digits we automatically calculate the right number of digits behind the dot depending on the currency pair that might be three digits or five digits. And to move our sell trailing stop we need to have a test position so if positions total is less than one we use trade dot sell to sell ten micro lot and now I will set the last stop bollinger bands value to an unrealistic high value of one thousand, we also could set it to zero here but we would need to add another condition later on and for this simple example it is good enough. Now let’s create an upper band array and a lower band array. Actually, we have a middle band but we don’t need it, so let’s use array set as series for the upper and the lower band to sort both arrays from the current candle downwards. Now we can define the bollinger bands by using the included ibands function for the current symbol on the chart and the currently selected period on that chart, we want to calculate it for twenty candles, don’t use a shift value, the deviation value is two and we are going to calculate the results based on the close price. With copy buffer we can now fill our array according to the bollinger bands definition that we have created here, we will do it for buffer one and buffer two. Buffer one is for the upper bend array, we start with candle zero and we want to copy the values for three candles and store them in the upper band array or in this case store them in the lower band array and that makes it possible to calculate the last upper band value and the last lower band value by just looking at candle one in the upper and in the lower band array. Let’s continue with the conditions because if my last upper band value is above the ask price and if my last upper band value is below the last stop bollinger bands value that is when it’s time to check the bollinger sell trailing stop, we are passing the parameter my last upper bands value here and afterwards, we assign the last upper band value to the variable last stop bollinger bands value because the next time we call the function the current value will be the last one. Now let’s continue with the user-defined function, we are using void because we don’t need a return value, the name is check bollinger sell trailing stop, this is the parameter that we have passed and now we use a for loop to go through all the open positions. Position get symbol will give us the currency pair for the current position. Now we need to check if the current symbol on the chart is the same symbol as the position symbol and maybe we should close the ontick function here, so let’s continue with the position ticket, we will get that by using position get integer and the parameter is position underscore ticket. Let’s repeat that for the current stop loss! To get the current stop loss we use position get double and the parameter is position underscore sl and if the current stop loss is bigger than the my last upper bands value or if we have no stop loss at all – in that case, the current stop loss would be zero – that is when we want to use trade dot position modify for the current position ticket and set the stop loss to the my last upper band value, the take profit value will not be changed and please don’t forget this or condition here because when you don’t set a stop loss it can never be bigger than this value and if you forget to check this condition the stop loss will never be moved. Now let’s close the loops here and close the function, and that’s it. If you have no idea what all the code here does or this was too fast for you you might want to watch the other videos in this basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7 on your keyboard… I messed up the parentheses, we have closed one if loop here but there is another one! So let’s fix that! Here we are! Let’s recompile the code and this time it worked without any errors and if that is the case you can click on a little Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 17 HOW TO PLACE A SELL STOP MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY… MQL5 TUTORIAL BASICS - 81 SIMPLE SMA BUY TRAILING STOP MQL5 TUTORIAL BASICS - 44 SIMPLE SAR BUY TRAILING STOP MQL5 TUTORIAL BASICS - 82 SIMPLE SMA SELL TRAILING STOP The post MQL5 TUTORIAL BASICS – 84 SIMPLE BOLLINGER BANDS SELL TRAILING STOP appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 84 SIMPLE BOLLINGER BANDS SELL TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Nov 7, 2020 6:21


In this video we are going to create a sell trailing stop for the upper bollinger band, whenever the bollinger bands are going down we will see the trailing stop is moved, so let’s find out how to do that with mql4. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple bollinger band sell trailing stop, click on continue, continue and finish. Now you can delete everything above the ontick function and let’s also remove the two comment lines. We start by creating a static double variable and we will call it last stop bollinger value, this is going to hold the last value so that we can compare it with the current one. And to move a stop loss we need to open a test position, we use order send for the current symbol on the chart, we use op sell to open a sell position for ten micro lot and we also want to reset the last stop bollinger value to zero here. Now we can use the included ibands function that comes with mql4 for the current symbol on the chart and the currently selected period, we want to calculate the result for twenty candles, the deviation is two, we don’t use a shift value and we want to calculate the prices based on the close price once for the lower and once for the upper bollinger band, we do that for candle one. Now that we have the value we pass the value for the upper bollinger band to a user-defined function called check bollinger sell trailing stop. This function doesn’t exist so far, so we need to create it in a few seconds but before we do that we take the value for the upper bollinger band and save it as the last stop bollinger value because this is the value that we are going to use the next time we call the function. So let’s continue with the user-defined function, we use void because we don’t need a return value, the name of the function is check bollinger sell trailing stop and we pass the value for the upper bollinger band as a parameter. Inside of the function we use a for loop to go through all the open positions, we want to select each order that is done by using order select for the current order number, that’s the counter of the for loop here. Now let’s check if the current order symbol is the same as the symbol on our chart, symbol equals currency pair in our case. In the next step, we want to find out if the order type is op sell. That would mean we have a sell trade and let’s find out if the current order stop loss is bigger than the value for the upper bollinger band because that’s when we want to adjust the sell trailing stop. And if that is true we use order modify for the current order ticket, we don’t change the order open price but we do change the stop loss and assign the value for the upper bollinger band, the order take profit is also unchanged and that is true for the expiration date and for the color. Finally, we want to close the if loop, the for loop and the function and that’s about it. Well, if this was too fast for you or if you have no idea what all the code here does maybe you want to watch one of the other videos in this basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7, I don’t have any errors and if that is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader you want to pick an empty chart, click on insert, indicators, trend, bollinger bands, we want to select a period for twenty candles, the deviation value is two, applied to the close price, no shift value, now pick a color and click on okay and here are the bollinger bands, now let’s right-click select template, save template and save it as tester dot tpl because this is the template that we are going to see in the next strategy test. So let’s start one and click on view,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 GRUNDLAGEN – 84 SIMPLER BOLLINGER BANDS SELL TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Nov 7, 2020 9:07


In diesem Video wollen wir uns einmal anschauen, wie man einen Sell Trailing Stop für das obere Bollinger Band programmieren kann. Also lassen Sie uns einmal schauen, wie man so etwas im Metatrader programmiert. Um das zu tun, klicken Sie bitte im Metatrader hier oben auf dieses kleine Symbol 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 SimplerBollingerBandsSellTrailingStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion gelöscht werden und auch die zwei Kommentarzeilen werden entfernt. Wir starten hier oben mit einem include-Befehl. Der wird uns die in MQL5 enthaltene Datei trade.mqh importieren. Und die enthält eine Klasse mit dem Namen CTrade. Davon erstellen wir uns jetzt eine Instanz und geben ihr den Namen trade. In der OnTick-Funktion starten wir mit einer statischen double-Variable. Die bekommt den Namen LastStopBollingerBandsValue und die wird immer den letzten Wert aufnehmen, den wir dann mit dem aktuellen Wert vergleichen. Jetzt berechnen wir den Ask Preis und den Bid Preis. Das übernimmt die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Wir nutzen entweder SYMBOL_ASK oder SYMBOL_BID und mit NormalizeDouble und _Digits stellen wir sicher, dass wir die richtige Anzahl von Nachkommastellen berechnen. Je nach Währung können das nämlich 3 oder 5 Nachkommastellen sein. Damit wir einen Trailing Stop nachziehen können, prüfen wir jetzt, ob die Anzahl der Positionen kleiner ist als 1 und wenn wir keine geöffnete Position haben, dann nutzen wir trade.Sell, um uns eine Testposition über 10 Microlot zu eröffnen. Natürlich würde man das nur auf dem Demokonto oder im Strategietester machen. Danach setzen wir die Variable LastStopBollingerBandsValue auf einen sehr hohen Wert von 1000. Den werden wir in der Realität nie haben und theoretisch könnten wir den hier auch auf 0 setzen, aber dann müssten wir zusätzliche Überprüfungen einbauen und für dieses einfache Beispiel soll uns das hier so reichen. Weiter geht es mit der Erstellung von zwei Arrays für das obere und für das untere Bollinger Band. Es gäbe auch noch das mittlere Band, aber das wird in diesem Fall nicht benötigt. Mit ArraySetAsSeries sortieren wir uns beide Bollinger Bänder von der aktuellen Kerze an abwärts. Mit der Funktion iBands, die in MQL5 eingebaut ist, können wir jetzt für das aktuelle Währungspaar und die auf dem Chart eingestellte Zeiteinheit die Bollinger Bänder für 20 Kerzen berechnen. Wir nutzen hier keinen Wert für die Verschiebung. Der Wert für die Deviation beträgt 2. Wenn man mal auf die Eigenschaften der Bollinger Bänder klickt, dann wird das in Deutsch mit Abweichung übersetzt. Wir möchten die Werte anhand der Schlusskurse berechnen und darum nutzen wir hier als letzten Parameter PRICE_CLOSE, bitte alles in Großbuchstaben. Jetzt füllen wir unser Array für das obere und das untere Bollinger Band, und zwar mittels CopyBuffer. Anhand der Bollinger Band Definition, die wir hier oben getroffen haben, für das obere Band machen wir das für Buffer 1, für das unter nutzen wir Buffer 2 und für beide gilt, wir starten mit der aktuellen Kerze 0 und kopieren die Werte für 3 Kerzen, um sie in unseren Arrays zu speichern. Und jetzt können wir auf Kerze 1 in unserem Array zugreifen, um das letzte obere und das letzte untere Bollinger Band zu berechnen. Kerze 1 nutzen wir, weil es für die aktuelle Kerze 0 keinen Schlusskurs gibt. Da würde uns ein sich ständig ändernder Wert angezeigt. Jetzt prüfen wir noch einige Dinge ab. Wir möchten gerne wissen, ob der Wert für das obere Bollinger Band größer ist als der Ask Preis und außerdem möchten wir den Stop Loss nur dann verschieben, wenn der Wert für das Bollinger Band kleiner ist als der letzte Wert für dieses Band. Denn sonst würden wir den Trailing Stop auch wieder nach oben verschieben und das macht bei einem...

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 83 SIMPLE BOLLINGER BANDS BUY TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Nov 1, 2020 6:57


In this video, we are going to create an expert advisor that is able to move a buy trailing stop for the bollinger bands indicator, so let’s find out how to do that with mql4. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple bollinger bands buy trailing stop, click on continue, continue and finish. Now you can remove everything above the ontick function and we also delete the two comment lines here. First, we want to create a static variable, it’s a double variable and it is called last stop bollinger value, and to have something that we can modify we need a position, so let’s check if we have no open positions – that would be the case when orders total equals zero – and in that case, we will open a test position by using order send. I would like to open a buy position for ten micro lot, and whenever we do that we want to set the last stop bollinger value to zero because this is a new position so we need a new stop value. Let’s continue and calculate the lower bollinger band and the upper bollinger band that is done by using the ibands function that comes with mql4, for the current symbol on the chart and the currently selected period, we want to calculate the result based on twenty candles, the deviation value is two, we don’t need any shift values here, the calculation should be done based on the close price and we use either mode lower or mode upper to calculate the lower or the upper bollinger band for candle one – that’s the last finished candle on the chart – and afterwards we want to try to move the stop loss. We try it because it will not be changed every time we want to do that, that depends on a few things so you might see these order modify errors here. For example, if the current price is too close to the lower bollinger band we cannot move the stop loss upwards because of the spread and whenever we want to try to change the stop loss we want to call a function called check bollinger buy trailing stop and we pass the value for the lower bollinger band as a parameter here. Afterwards, we want to assign the value for the lower bollinger band to the last stop bollinger value because the current value will be the last value the next time we call the function so let’s actually create that function. We use void because we don’t have a return type here. The name of the function is check bollinger buy trailing stop and we pass the parameter for the lower bollinger bands. Afterwards, we use a for loop to go through all the open orders. Now we want to use order select to select each of those orders. In the next step, we want to find out if the if the current order symbol is equal to the symbol on the chart. We check if the order type equals op buy for a buy order and if all those conditions apply we want to find out if the current order stop loss is below the lower bollinger band and if this is true we use order modify for the current order ticket, we don’t change the order open price but we will try to change the stop loss to the value for the lower bollinger band, the order take profit, the expiration and the color values are not modified here. Finally, we need to close the loops and the function and that’s about it. If you have no idea what all the code here does or if this was too fast for you or if maybe you want to watch one of the other videos in the basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7, you shouldn’t get any errors here and if that is the case you can press the little button here or press F4 on your keyboard to go back to Metatrader. And in Metatrader we want to open a blank chart and click on insert, indicators, trend, bollinger bands, please select a period for twenty candles, the deviation value is two,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 83 SIMPLER BOLLINGER BANDS TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Nov 1, 2020 8:43


In diesem Video wollen wir uns einmal anschauen, wie man einen Expert Advisor programmieren kann, der in der Lage ist, einen Buy Trailing Stop mit den Bollinger Böndern nachzuziehen. Also lassen Sie uns einmal schauen, wie man so etwas in MQL5 progammieren kann. Um das zu tun klicken Sie im Metatrader bitte auf dieses kleine Symbol 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 SimplerBollingerBandsBuyTrailingStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion gelöscht werden und auch die zwei Kommentarzeilen können weg. Wir starten mit der include-Funktion, um uns die Datei Trade.mqh zu importieren. Die ist Bestandteil von MQL5 und wird uns helfen später einfache Positionen zu eröffnen. Dazu erstellen wir uns von der Klasse CTrade, die in dieser Traidingbibliothek enthalten ist, eine Instanz mit dem Namen trade. In der OnTick-Funktion starten wir damit, dass wir uns eine statische double-Varibale erzeugen. Die bekommt hier den Namen LastStopBollingerBandsValue und soll den jeweils letzten Wert für unseren Stop Loss aufnehmen. Danach berechnen wir den Ask Preis und Bid Preis. Das übernimmt die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Wir nutzen SYMBOL_AKS bzw. SYMBOL_BID und mit NormalizeDouble und _Digits stellen wir sicher, dass wir die richtige Anzahl von Nachkommastellen hinter dem Komma berechnen und damit wir einen Trailing Stop nachziehen können, benötigen wir natürlich auch eine Testposition. Wenn also die Funktion PositionsTotal kleiner ist als 1, dann möchten wir hier trade.Buy benutzen, um eine Testposition über 10 Microlot zu eröffnen. Natürlich macht man das nicht auf einem Echtgeldkonto, aber auf einem Demokonto brauchen wir halt jetzt die Position, denn sonst können wir den Trailing STop nicht benutzen. Im Anschluss setzen wir den letzen Wert für den StopBollingerBandsValue auf 0, denn der wir ja beim nächsten Mal wieder benötigt. Für die Bollinger Bänder benötigen zunächst einmal zwei Array vom Typ double. Einmal für das obere und einmal für das untere Band. Eigentlich gibt’s es hier auch noch ein mittleres Band, aber das spielt in diesem Fall keine Rolle. Im Anschluss nutzen wir ArraySetAsSeries, um das obere und das untere Band von der aktuellen Kerze an abwärts zu sortieren. Und mit der in MQL5 enthaltenen Funktion iBands erstellen wir uns jetzt eine Definition für die Bollinger Bänder für das aktuelle Währungspaar auf dem Chart und die auf dem Chart aktuell ausgewählte Zeiteinheit. Wir möchten gerne für 20 Kerzen die Werte berechnen. Wir nutzen keinen Wert für die Verschiebung. Die Diviation ist 2 und die Berechnung soll anhand der Schlusskurse erfolgen. Jetzt können wir CopyBuffer nutzen, um unser jeweiliges Array mit Daten zu füllen. Für das obere Band nutzen wir Buffer 1, für das untere Band nutzen wir Buffer 2. Und damit können wir anhand der Bollinger Bands-Definition, die wir hier oben getroffen haben, von der Kerze 0, das ist die aktuelle Kerze, für 3 Kerzen die Daten kopieren und in unseren jeweiligen Array speichern. Uns interessiert jeweils der Wert für die letzte abgeschlossene Kerze. Das ist Kerze 1. Also greifen wir hier einfach auf Kerze 1 in unserem oberen und unterem Band zu und weisen das Ergebnis der jeweiligen Variable zu. Für unseren Buy Trailing Stop interessiert uns, ob der letzte Lower Band Value, also untere Bandwert, unterhalb des Bid Preises liegt. Außerdem möchten wir noch wissen, ob dieser Wert größer ist als der letzte Stop Bollinger Band-Wert. Denn es macht nur dann Sinn einen Stop Loss für einen Buy Trade nachzuziehen, wenn die Preise auch gestiegen sind. Und falls das Beides zutrifft, dann möchten wir gerne eine Funktion mit dem Namen CheckBollingerBuyTrailingStop aufrufen. Hier übergeben wir dann den letzten Lower Band-Wert für das untere Bollinger Band.

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 82 SIMPLER SMA SELL TRAILING STOP

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Oct 31, 2020 9:00


In diesem Video wollen wir uns einmal anschauen, wie man einen Sell Trailing Stop für einen gleitenden Durchschnitt programmieren kann. Wenn wir hier hineinzoomen dann sehen wir, dass wir eine Sell Position haben. Hier ist der gleitende Durchschnitt und der Stop Loss wird hier nachgezogen, also lassen Sie uns einmal schauen, wie man so etwas in MQL5 programmieren kann. Um das zu tun klicken Sie im Metatrader 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 mal den Namen SimplerSMASellTrailingStop, klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion hier entfernt werden und wir löschen auch die beiden Kommentarzeilen. Im ersten Schritt nutzen wir die include-Anweisung, um die Datei Trade.mqh zu importieren. Die ist Bestandteil von MQL5 und stellt uns vereinfachte Handelsfunktionen bereit. Dazu erstellen wir uns zunächst eine Instanz von der Klasse CTrade und geben ihr den Namen trade. In der OnTick-Funktion erstellen wir eine statische Variable vom Typ double. Die bekommt den Namen LastStopMovingAverageValue und wird den jeweils vorhergehenden Wert für unseren StopMovingAverage-Wert aufnehmen. Außerdem benötigen wir die Werte für den Ask Preis und den Bid Preis. Die liefert uns die Funktion SymbolInfoDouble für das aktuelle Währungspaar auf dem Chart. Wir nutzen entweder SYMBOL_ASK oder SYMBOL_BID und mit NormalizeDouble und _Digits stellen wir sicher, dass wir die richtige Anzahl von Nachkommastellen für jedes Währungspaar automatisch berechnen. Damit wir einen Stop Loss nachziehen können brauchen wir auch eine Testposition. Wenn also die Funktion PositionsTotal einen Wert kleiner 1 zurückliefert, dann heißt das: wir haben keine geöffnete Position. Und dann nutzen wir trade.Sell, um eine Position für 10 Microlot zu verkaufen. Im nächsten Schritt setzen wir hier den Wert für LastStopMovingAverageValue auf einen unrealistisch hohen Wert von 1.000. Man könnte hier den Wert auch hier auf 0 setzen, dann müssten wir aber eine zusätzliche Überprüfung einbauen, denn in der Regel wird bei einem SellTrailingStop geprüft, ob der aktuelle Stop Loss tiefer ist als der vorhergehende Wert und der wird niemals kleiner als 0. Darum machen wir das in diesem Fall einfach mal so. Für unseren einfachen gleitenden Durchschnitt erstellen wir jetzt ein Array. Das wird im nächsten Schritt mit ArraySetAsSeries von der aktuellen Kerze an abwärts sortiert. Und mit der in MQL5 enthaltenen Funktion iMA erstellen wir uns jetzt für das aktuelle Währungspaar auf dem Chart und die auf dem Chart ausgewählte Zeiteinheit für 500 Kerzen, ohne eine Verschiebung zu nutzen einen SimpleMovingAverage. Darum nutzen wir MODE_SMA. SMA steht für SimpleMovingAverage. Und wir möchten gerne, dass die Ergebnisse anhand der Schlusskurse berechnet werden. Mit CopyBuffer füllen wir jetzt unser MovingAverageArray anhand der Definition, die wir hier oben getroffen haben, und zwar für Buffer 0. Das ist diese Linie hier von dem gleitenden Durchschnitt. Wir starten bei der aktuellen Kerze 0 und füllen unser MovingAverageArray mit Werten für 3 Kerzen. Danach können wir den aktuellen Wert ermitteln indem wir uns einfach den Wert für Kerze 1 aus unserem Array herausholen. Zunächst einmal möchten wir wissen, ob der Wert für den Stop Loss Moving Average größer ist als der aktuelle Ask Preis und außerdem macht es nur dann Sinn, wenn sich der Wert so verändert hat, dass er jetzt niedriger ist als der letzte gemessene Wert, denn bei einem SellTrailingStop macht es keinen Sinn den Stop weiter nach oben zu schieben. Und wenn diese beiden Bedingungen wahr sind, dann möchten wir eine Funktion mit dem Namen CheckSMASellTrailingStop aufrufen. Der übergeben wir dann den aktuellen Bid Preis und den berechneten Wert für den StopMovingAverage-Wert. Anschließend weisen wir den aktuellen Wert der Variable...

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 83 SIMPLE BOLLINGER BANDS TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Oct 31, 2020 7:17


In this video we are going to create an expert advisor that is able to calculate a buy trailing stop for the bollinger bands indicator, so let’s find out how to do that with mql5. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file, simple bollinger bands buy trailing stop, click on continue, continue and finish. Now you can delete everything above the ontick function and the two comment lines here. First, we want to include the file trade dot mqh, this one comes with mql5 and it contains the class ctrade and we are going to create an instance from ctrade that is called trade. Inside of the ontick function, we want to create a static double variable, called last stop bollinger bands value. Afterwards, we want to calculate the ask price and the bid price by using symbol info double for the current symbol on the chart, we use symbol ask or symbol bid and we use normalize double and underscore digits to automatically calculate the right number of digits behind the dot. For a trailing stop we need to have an open position, so let’s create a test position, whenever positions total is below one we use trade dot buy to buy ten micro lot and we set the value for the last stop bollinger bands value to zero. Now let’s create an array for the upper band array and for the lower band array. Actually, the bollinger bands have three arrays for the upper, the middle, and the lower band but in this case, we only need the two extremes. Let’s use array set as series to sort both arrays from the current candle downwards. Now we can define the bollinger bands by using the integrated ibands function for the current symbol on the chart and the currently selected period, we want to calculate the result for twenty candles, we use no shift value, the deviation value is two and we want to calculate the results based on the close price. Now we use copy buffer to copy the data according to the bollinger bands definition that we have created here, we use buffer one for the upper bend array and buffer two for the lower band array starting from the current candle zero and we want to copy the values for three candles and store them in the array. And now we can calculate the last candle by looking into candle one of our upper band array or our lower band array, this really depends on if you are looking for a buy or a sell trade. For a buy trade, we want to check if the last lower band value was below the current bid price and we also want to know if the current value is above the last bollinger bands value, and if this is true we want to call a function called, check bollinger buy trailing stop and we pass the value my last lower band value. Afterwards, we are going to assign the last lower band value to the last stop bollinger band value. So far so good but this function doesn’t exist so far, so let’s create that now! We are using void because we have no return value, the name of the function is check bollinger buy trailing stop and we pass the last lower band value here. Now we use a for loop to go through all the open positions, with position get symbol for the current counter value we will get the position symbol and that makes it possible to check if the current symbol on the chart equals the position symbol, if that is true, we use position get integer, position underscore ticket to get the current position ticket number and with position get double for the current stop loss – the parameter is called position underscore sl – we get the current stop loss and only if the current stop loss is below the last lower band value we use trade dot position modify for the current position ticket to move the current stop loss to the last lower band value, this parameter is for the take profit and we will leave that one unchanged. Finally, we want to close the if loop, the for loop and the function, and that’s about it. If this was too fast for you or if you have no idea what all the code here does maybe you want to watch one of the other videos in the basic video series or maybe even the premium course on our website might be interesting for you, for now, let’s enable the toolbar here and click on compile or press F7, I have no errors here and if this is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader you want to click on view, strategy tester or press control and r, please pick the new file, simple bollinger bands buy trailing stop dot ex5, mark the option for the visual mode here and start a test. Here we are! We have a first position and a stop loss and when the lower bollinger band is rising, the stop loss is adjusted, so our little expert advisor works as designed and in this little video you have learned how to create a buy trailing stop for the lower bollinger band 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 - 44 SIMPLE SAR BUY TRAILING STOP MQL5 TUTORIAL BASICS - 41 SIMPLE SELL BREAKEVEN STOP MQL5 TUTORIAL - SIMPLE STANDALONE BOLLINGER BANDS… MQL5 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY… The post MQL5 TUTORIAL BASICS – 83 SIMPLE BOLLINGER BANDS TRAILING STOP appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 82 SIMPLE SMA TRAILING STOP LOSS

MQL4 TUTORIAL

Play Episode Listen Later Oct 31, 2020 6:51


In this video, we are going to create a sell trailing stop for a simple moving average, so let’s find out how to do that with mql4. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple sma sell trailing stop, click on continue, continue and finish. Now you can remove everything above the ontick function and we can delete the two comment lines here. First, we want to create a static double variable for the last stop moving average value and to use a trailing stop we also need to have open positions, so when orders total equals zero that means we have no open positions and that’s when we use order send to open a test position that is ten micro lot, we use op underscore sell to open a sell position and afterwards we set the last stop moving average value to an unrealistic high value of one thousand, so when we call this function the next time you could also use zero here but you would need to implement another condition check, so for this simple example we go with this solution. Now we can use the integrated ima function for the current symbol on the chart and the currently selected period on that chart to create a simple moving average for five hundred candles, we don’t use a shift value here, we use the parameter mode underscore sma because this stands for simple moving average and we would like to have the results based on the close price for candle one. Actually, this part needs to be outside of this if condition, now we can check if the current stop moving average value is below the last stop moving average value and we also want to know if the current value is bigger than the ask price otherwise it will be hard to set the stop loss and if both conditions are true we want to call a function called check sma sell trailing stop and pass the stop moving average value as a parameter. This function doesn’t exist, so we need to create it in a few seconds but before we do that we assign the current stop moving average value to the variable last stop moving average value because the next time we call this function the current value will be the last value. Now let’s continue with our new function called check sma sell trailing stop we use void here because we don’t have a return value and we pass the stop moving average value as a parameter. Afterwards, we use a for loop to go through all the open orders and with order select, we select each position, we want to check if the order symbol is equal to the symbol on the chart, we also want to know if the current order type is a sell order and finally we need to check if the current order stop loss is above the stop moving average value that we have calculated otherwise we won’t change anything and if all those conditions are true we use order modify for the current order ticket, we don’t change the order open price but we do change the stop moving average value for the stop loss value here, we leave the order take profit as it is and we also don’t want to change the value for the expiration or for the color. Now let’s close the for loop and the function here and that’s about it. If you have no idea what all the code here does or if this was too fast for you maybe you want to watch one of the other videos in the basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7, I didn’t get any errors and if that is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader you want to click on insert, indicators, trend, moving average, please pick a period for five hundred candles, select the method simple for simple sma, apply to the close price, pick a color and click on okay, now let’s zoom into the chart and here is the simple moving average. Now we right-click,

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 82 SIMPLE SMA SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Oct 25, 2020 8:14


In this video we are going to create an expat advisor for a simple moving average sell trailing stop, so let’s find out how to do that with mql5. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple sma sell trailing stop, click on continue, continue and finish. Now you can delete everything above the ontick function and the two comment lines here. First, we want to include the file trade dot mqh, this one comes with mql5 and it provides trading functions, it also contains the class ctrade, so we are going to create an instance of that class called trade. We start by creating a static variable for the last stop moving average value, now we want to calculate the ask price and the bid price that is done by using symbol info double for the current symbol on the chart, we use either symbol ask or symbol bid and with normalize double and underscore digits we make sure that we calculate the right number of digits behind the dot. To use a stop loss we need to open a test position, we are going to use trade dot sell to do that and the condition is whenever positions total is below one – that means we have no open positions – and that’s when we want to sell ten micro lot. We also want to set the last stop moving average value to a very high value, actually, you could also set it to zero but you would need to add another condition because usually, we are going to check if the current value is lower than the last stop moving average value and that one will never be below zero so let’s go with the high value for now. In the next step, we are going to create an array for the moving average. With array set as series, we are going to sort the array from the current candle downwards and now we can use the integrated ima function for the current symbol on the chart and the currently selected period on that chart to create a simple moving average for five hundred candles, we don’t use a shift value here, we are going to use mode underscore sma as it stands for simple moving average and we want to calculate the results based on the close price. Let’s continue with copy buffer, this one is used to fill the array according to the moving average definition that we have created here, we will grab the values for buffer zero that’s the moving average signal line here, we will start with candle zero – that’s the current candle – and we will copy the values for three candles and store them in the array. And now that we have done that we can calculate the stop moving average value by looking into candle one of our moving average array. The first condition we want to check to move a sell stop loss is if the current stop moving average array is above the ask price otherwise we would not be able to change it. We also want to know if the current stop moving average value is below the last stop moving average value, and if this is true we are going to use a function called check sma sell trailing stop and pass the bid price and the stop moving average value as a parameter. This function doesn’t exist so far, so we need to create it now and please don’t forget to set the last stop moving average value and assign the current stop moving average value because the current one will be the last one the next time we call this function. Our trailing stop function will use void because we don’t need to return anything, the name is check sma sell trailing stop and we pass the bid price and the stop moving average value as parameters here. Now we use a for loop to go through all the open positions, we will count down until there are no other positions left, afterwards we use position get symbol for the current counter of the for loop to get the currency pair symbol for the current position and only if the symbol on the chart matches the currency pair symbol we are going to continue. With position get integer and parameter position underscore ticket, we can now get the current position ticket and to find out the current stop loss we are using position get double and pass the parameter position underscore sl that will allow us to check if the current stop loss is above the stop moving average value and we also need to find out if the current stop loss equals zero, this is the case when you don’t set a stop loss when you open a position, so we also need to check this one and afterwards, we use trade position modify for the current position ticket to set the desired stop moving average value, the last parameter here is for the take profit, we won’t change that one. Finally, we need to close the if loop, the for loop and the function and that’s about it. Well, if you have no idea what all the code here does or if this was too fast for you maybe you want to watch one of the other videos in this basic video series first or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button, I need to set the toolbar to visible, here is the compile button and you could also press F7 on your keyboard, I don’t have any errors and if that is the case you can click on the Not sure what to do? Click on the automated trading assistant below MQL5 TUTORIAL BASICS - 33 SIMPLE SELL POSITION MODIFIER MQL5 TUTORIAL BASICS - 45 SIMPLE SAR SELL TRAILINGSTOP MQL5 Tutorial - Simple Sell Stop Expert Advisor MQL5 TUTORIAL BASICS - 27 HOW TO CODE A SIMPLE SELL… MQL5 TUTORIAL BASICS - 84 SIMPLE BOLLINGER BANDS… The post MQL5 TUTORIAL BASICS – 82 SIMPLE SMA SELL TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 81 SIMPLE SMA BUY TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Oct 24, 2020 8:17


In this video, we are going to create an expert advisor that is able to create a a simple buy trailing stop that is based on a simple moving average value, so let’s find out how to do that with mql5. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple sma buy trailing stop, click on continue, continue and finish. Now you can delete everything above the ontick function and the two comment lines here. First, we want to include the file trade dot mqh, this one comes with mql5 and provides simplified trading functions afterwards we create an instance of the class ctrade and call it trade. Inside of the ontick function we start with a static double variable called last stop moving average value, we continue by calculating the ask price and the bid price that can be done by using normalize double, symbol info double for the current symbol on the chart and the second parameter is symbol underscore ask or underscore bid, with normalize double and underscore digits we make sure to calculate the right number of digits behind the dot. To have something that we can use for the trailing stop we need to open a test position, so whenever positions total is smaller than one or in other words when we have no open position we use trade dot buy to buy ten micro lot. That will open a new position and that’s when we set the last stop moving average value to zero because for each position we need a new value. Let’s go on and create an array for the moving average, now we want to sort the array from the current candle downwards that is done by using array set as series for our moving average array that we have created here. Now let’s define the properties, we want to use the ima function for the current symbol on the chart and the currently selected period on that chart, we want to use it for five hundred candles starting from the current candle zero, we don’t use a shift value and we use mode underscore sma because this stands for simple moving average and the calculation should be done based on the close price. Afterwards, we use copy buffer to fill our moving average array according to the definition that we have created here for buffer zero, we start with candle zero – that’s the current candle – and we copy the values for three candles and store them in the array. And to get the value that we need we simply have a look at the value for candle one in our moving average array and we assign the value to stop moving average value. Now that we have done that we can check if the stop moving average value is below the current bid price and the second condition will be if the stop moving average value is bigger than the last stop moving average value and if that is the case we want to call a function that is called check sma buy trailing stop, we will pass the ask price and the stop moving average array value as parameters here and afterwards we want to assign the current value for the next function call, so we store the value for stop moving average value in the variable called last stop moving average value. Please remember this was a static variable so it will keep the values inside of this function, well this function doesn’t exist so far, so we need to create it now, the name of the function will be check sma buy trailing stop, we use void because we don’t use a return value here and we pass the ask price and the stop moving average value as parameters. Now let’s use a for loop to go through all the open positions, we use position get symbol to get the symbol for the current position because we need to check if the current symbol on the chart is equal to the position symbol and if this is true we get the position ticket by using the function position get integer position underscore ticket. To get the current stop loss we use position get double and the parameter is position underscore sl and if the current stop loss is below the stop moving average value we want to change it that is done by using trade position modify for the current position ticket and we pass the stop moving average value as the second parameter. The third parameter would be used when we would like to change the take profit value but this is not the case. Finally, please close all the loops and also close the function that we have created and this is it. Well, if this was too fast for you or if you have no idea what all the code here does maybe you want to watch one of the other videos in this basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button here or press F7 on your keyboard, you shouldn’t get any errors and if this is the case you can click on the little button here or press F4 to go back to Metatrader. And in Metatrader we click on view, strategy tester or press control and r, please pick the new file, simple sma buy trailing stop dot ex5, mark the option for the visual mode and start a test. Here we are! We need to zoom into the chart because that’s when we see that the moving average is far below the current price, we also see that the stop loss is modified, if you click Not sure what to do? Click on the automated trading assistant below MQL5 Tutorial - Simple Sell Stop Expert Advisor MQL5 TUTORIAL BASICS - 6 SIMPLE IF CONDITION MQL5 TUTORIAL BASICS - 27 HOW TO CODE A SIMPLE SELL… MQL5 TUTORIAL BASICS - 41 SIMPLE SELL BREAKEVEN STOP MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY… The post MQL5 TUTORIAL BASICS – 81 SIMPLE SMA BUY TRAILING STOP appeared first on MQL5 Tutorial.

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 81 SIMPLE SMA BUY TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Oct 24, 2020 7:47


In this video, we are going to create an expert advisor that is able to create a buy trailing stop for a simple moving average, so let’s find out how to do that with mql4. To get started please click on a little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, continue and finish. Now you can delete everything above the ontick function and the two comment lines here. We start by creating a static variable and we call it last stop moving average value. To have something that we can use with a buy trailing stop we need to create a test buy position so whenever we have no open orders we use order send to open a buy position for ten micro lots, please don’t do that on a real account, this is just for testing purposes, so let’s calculate the stop moving average value that is done by using the ima function for the current symbol on the chart and the currently selected period on that chart, I will use a simple moving average for five hundred candles, we don’t use a shift value, the mode is for sma simple moving average, the calculation will be based on the close price for candle one. Now we want to check if the current value for the stop moving average is bigger than the last value and the second condition will be if the stop moving average value is below the current bid price and if that is the case we want to try to change the stop loss that’s done by calling a function check sma buy trailing stop and we are going to pass the stop moving average value that we have calculated here. And afterwards, we want to assign the stop moving average value to the variable for the last stop moving average value for the next time we will check it because the current one will be the last one the next time we check it. So far so simple, but this function doesn’t exist so far, so we need to create it now, the name of the function is check sma buy trailing stop, we don’t return a value so we use void and we will pass a parameter called stop moving average value from the main function, we use a for loop to go through all the open orders, each order is selected for the current counter value that we have used here in the for loop. The next condition we need to check is if the current order symbol is equal to the symbol on the chart and as we are going to create a buy trailing stop we also want to check if the order type equals op underscore buy, we also want to know if the current order stop loss for the position is below the stop moving average value that we have calculated, and if all the conditions are true we use order modify for the current order ticket, we don’t change the order open price but we try to change the stop loss value here, we leave the other options unchanged, now let’s close the if statement and the for loop, and finally the function, and that’s about it. Well, if this was too fast for you or if you have no idea what all the code here does maybe you want to watch the other videos in this basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7, I have messed up one of the braces here so let’s recompile now, and this time we have no errors, please notice that we have two warnings here, order send and order modify should be checked, there are several conditions when we will not be able to modify anything, for example, if we try to replace the stop moving average value with something that the broker is not accepting or if we use the same value twice. I will show you the modify errors in the journal. To get back to Metatrader please click on a little icon here or press F4 on your keyboard, now you should see the Metatrader window and here you want to create a new chart, click on insert, indicators, trend, moving average, please pick a period for five hundred candles for a simple moving average applied to the close price,

MQL5 Tutorial - Automatisch traden mit Metatrader5
MQL5 TUTORIAL GRUNDLAGEN – 81 Simpler SMA Buy Trailing Stop

MQL5 Tutorial - Automatisch traden mit Metatrader5

Play Episode Listen Later Oct 24, 2020 8:36


In diesem Video wollen wir uns einmal anschauen, wie man für einen simplen gleitenden Durchschnitt einen Buy Trailing Stop programmieren kann, also lassen Sie uns einmal anschauen, wie man so etwas in MQL5 realisiert. Um das zu tun, klicken Sie im Metatrader 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 Datei, neue Datei, Expert Advisor aus Vorlage, weiter. Ich vergebe hier einmal den Namen SimplerSMABuyTrailingStop klicke auf weiter, weiter und fertigstellen. Jetzt kann alles oberhalb der OnTick-Funktion gelöscht werden und auch die zwei Kommentarzeilen können weg. Wir starten damit, dass wir mittels include hier die Datei Trade.mqh einbinden. Die ist Bestandteil von MQL5 und ermöglicht es uns von der Klasse CTrade eine Instanz zu bilden. Die wird uns später helfen, wenn wir Positionen eröffnen. Innerhalb der OnTick-Funktion erstellen wir eine statische Variable für den letzten MovingAverageValue, also den letzten bekannten Wert. DAnnach möchten wir gerne den Ask Preis und den Bid Preis ermitteln. Das übernimmt die Funktion SymbolInfoDouble für das aktuelle Währungspaar. Wir nutzen entweder SYMBOL_ASK oder SYMBOL_BID und mit NormilzeDouble und _Digits stellen wir sicher, dass wir die richtige Anzahl von Nachkommastellen für das jeweilige Währungspaar ermitteln. Damit wir unseren Trailing Stop für eine Position nutzen können, müssen wir natürlich auch eine eröffnen. Wenn also die Funktion PostitionsTotal einen Rückgabewert von < 1 liefert, dann haben wir keine geöffnete Position. Das bedeutet, dass wir eine eröffnen müssen. Dazu nutzen wir tade.Buy, um eine Kaufposition für 10 Microlot zu eröffnen. Natürlich macht man das nur auf einem Demokonto und für jede Position möchten wir auch den Wert für den letzten bekannten MovingAverage Wert zurücksetzen auf 0. Andernfalls könnte es passiert, dass der Expert Advisor versucht den Trailing Stop mit den Werten für die letzte Position nachzuziehen und das wollen wir ja nicht. Für den eigentlichen MovingAverage erstellen wir uns jetzt ein Array vom Typ double, damit es auch Nachkommastellen aufnehmen kann. Anschließend wir das Array mit ArraySetAsSeries von der aktuellen Kerze an abwärts sortiert. Jetzt können wir definieren, welche Art von gleitendem Durchschnitt wir gerne nutzen möchten. Dazu nutzen wir die Funktion iMA. Die ist in MQL5 integriert. Und als Parameter übergeben wir das aktuelle Währungspaar auf dem Chart und die auf dem Chart ausgewählte Zeiteinheit. Wir möchten gerne 500 Kerzen ermitteln lassen, ohne Verschiebungswert. Wir nutzen MODE_SMA. Das steht für SimpleMovingAverage und das Ergebnis soll anhand der Schlusskurse errechnet werden. Mit der Funktion CopyBuffer füllen wir jetzt unser erstelltes Array, dass wir hier oben definiert haben. Und zwar für Buffer 0. Buffer 0 ist die einzige Linie die unser gleitender Durchschnitt hat. Bei anderen Signalen, wie den Bollinger Bändern gebe es mehrere Buffer. Wir starten hier auch mit der aktuellen Kerze 0 und wir möchten die Werte für drei Kerzen kopieren und in unserem Array speichern. Nachdem wir das getan haben, können wir den aktuellen Wert ermitteln, in dem wir uns in unserem Array den Wert für Kerze 1 anschauen. Das ist die letzte geschlossene Kerze auf dem Chart. Damit unser Stop Loss richtig nachgezogen wird, möchten wir noch ein paar Dinge prüfen. Und zwar ob der StopMovingAverage Wert kleiner ist als der aktuelle Bid Preis. Andernfalls kann er nicht verändert werden. Eine zweite Sache, die wir überprüfen möchten ist, ob der aktuelle Wert größer ist, als der letzte Wert den wir ermittelt haben. Und wenn beide Bedingungen zutreffen, dann möchten wir gerne eine Funktion CheckSMABuyTrailingStop aufrufen. Hier übergeben wir den aktuellen Ask Preis und den ermittelten Wert für den StopMovingAverage Wert. Danach weisen wir den aktuellen Stop Loss Wert der Variable LastStopMovingAverageValue zu,

Poor Vs Standard
Episode 15 - Don't Stop Limit Limit!

Poor Vs Standard

Play Episode Listen Later Sep 8, 2020 37:04


Poor and Standard Discuss Slippage and Order types such as Stop Loss, Limit, Trailing Stop orders and others! have a question? find us on Twitter! @vs_poor send us a question via email: poorvstandard@gmail.com patreon: patreon.com/poorvstandard

InvestTalk
07-17-2020: New Research Claim: Pandemics Typically Lead To Receding Inflation

InvestTalk

Play Episode Listen Later Jul 17, 2020 45:07


Theory: Pandemics leave a traumatized population determined to save rather than spend, and a labor-capital ratio that has fallen to levels that undermine the incentive to invest. Today's Stocks & Topics: ACI - Albertsons Cos. Inc., The Heroes Act, Inflation Rates, AQN - Algonquin Power & Utilities Corp., INO - Inovio Pharmaceuticals Inc., Trailing Stop, COVID-19 Test Kit Manufacturers, VTR - Ventas Inc., PLNT - Planet Fitness Inc. Cl A, HP - QHP Inc., KGC - Kinross Gold Corp., Central Banks & Inflation. Support this podcast at — https://redcircle.com/investtalk-investment-in-stock-market-financial-planning/donations Advertising Inquiries: https://redcircle.com/brands

Online Forex Trading Course
#369: Should You Use a Trailing Stop Loss?

Online Forex Trading Course

Play Episode Listen Later Jun 7, 2020 6:58


Should You Use a Trailing Stop Loss?Podcast: #369: Should You Use a Trailing Stop Loss?In this video:00:26 – How to manage trades?01:08 – Don’t move your stop loss to breakeven01:50 – Disadvantages of a trailing stop03:17 – Where do I place a stop loss?04:05 – How I manage a stop loss06:15 – Try to avoid moving to breakeven and avoid trailing stops06:40 – Email me if you have any questions about trading the Forex marketShould you trail your stop, or should you move your stop to break even, or should you do something completely different? Let's talk about that and more, right now.Hey Forex traders, it's Andrew Mitchem here at The Forex Trading Coach, with video and podcast number 369.How to manage trades?Now, I quite often get emails asking me about how I manage trades, and I've had an email come through just today, and it's from someone who's saying "Hey Andrew, can you tell me the best way to trail a stop?" and they basically said they want to use trailing stops, and how should they use it? My question back to them is quite simple. It's how big a stop-loss should you use? And it's like "well, how long is a piece of string?" It really is a level or a number that no one can tell you what you should do, because in my opinion, you should not use trailing stops.Don’t move your stop loss to breakevenI also don't think you should move your stop to break even either. Because when you think about it, moving a stop to break even doesn't actually do anything. It might make you feel all warm and fuzzy, and "Well, I can't lose on this trade," but from a trading point of view, and if you actually look at your trade's bigger picture longer term, if you just move your stop to break even, does that actually improve your trading success and your overall profitability?I highly doubt it does, because when you move your stop to break even, when do you decide to do that? Do you move it when you're almost at your profit target? Do you move it really soon, and then you get stopped out all the time? How do you decide? And it's a little bit like a trailing stop.Disadvantages of a trailing stopOne of the big disadvantages of a trailing stop is that on most platforms, you actually have to have your computer on, in order for that trailing stop to work, certainly on the MetaTrader platform you do. You can't just put a trailing stop in and turn your computer off, because the trailing stop actually sits on your computer, rather than on the broker's service, unlike a fixed stop or fixed profit target.And then it comes down to the point of how big is your trailing stop, and when do you introduce that trailing stop? Now, an example would be the Euro British Pound, doesn't move very much, but if you're trading something like the Euro New Zealand or the Pound New Zealand dollar, and then the same stop loss that you use on your Euro-Pound would be stopped at all the time on your bigger moving pair. And then of course, it comes down to another thing: what timeframe charts are you trading, and how big is your stop-loss anyway. So it all becomes quite a bit... It becomes very messy and it doesn't become something that you can do very well with consistency. It starts to become emotional and a bit of guesswork on there. And I don't like emotions and guesswork in trading. I like to know facts on like to know actuals. And I think that's where people who play around with their stop-losses too much actually come on stuck. They actually think they're doing a good thing, but in reality, they're probably not really doing themselves any trading favours.Where do I place a stop loss?

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 44 SIMPLE SAR BUY TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Jan 12, 2020 7:46


In this video we are going to create a buy trailing stop for the parabolic sar indicator you see the little dots here, our stop loss is trailing as our price is rising, so let’s find out how to code a stop loss that moves based on an indicator value. To do that please click on view, toolbars, standard and click this little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple sar buy trailing stop, click on continue, continue and finish. Now we can delete everything that is above the on tick function and let’s also delete the two comment lines here. We start with an include statement to include the file trade dot mqh, afterwards, we create an instance of the class ctrade that will be called trade. Inside of the on tick function we need to calculate the ask price, that is done with symbol info double for the current symbol on the chart, we use symbol underscore ask and with normalize double and underscore digits we calculate the right number of digits behind the dot. For our little demo account, we want to create a test position, you wouldn’t do that on your real account but we need something to test, so if we have no open positions and positions total delivers a return value below one we use trade dot buy to buy ten micro lot. Afterwards, we create an array for the sar and we use the integrated function isar for the current symbol on the chart and the currently selected period on that chart. These two parameters here is what you see when you click on insert, indicators, trend, parabolic sar. Here we have a step value of zero point zero two and the maximum value of zero point two, these are the default values so that’s what we use here. Let’s use array set as series to sort the sar array from the current candle downwards and now we use copy buffer according to the sar definition that we have created here to fill our array for three candles starting with candle zero. This parameter here is for the buffer, this indicator only has one buffer because it only produces one line of dots. And now we can actually calculate the sar value by looking into our array especially at candle zero. I use normalize double and the value five because each of those dots here has five digits behind the dot. And now we want to call a function called check sar buy trailing stop, we pass two parameters, the first one is the ask price and the second one is the sar value and as this function does not exist so far we need to create it now. Our trailing stop function will be called check sar buy trailing stop, it will take two parameter values from the main function, the first one is the ask price and the second one is the sar value. Now we use a for loop to go through all the open positions, first we need to get the symbol of the current position, that is done by using position get symbol for the current counter value and we only want to continue if the symbol on the chart and the position symbol are equal. In that case we use position get integer for the position ticket – all in capital letters – to get the ticket number and with position get double we can get the current stop loss by using position underscore sl. And if the current stop loss is below the sar value we use trade dot position modify for the current position ticket to move the stop loss to the sar value. This last parameter here is for the take profit value, we don’t modify that, actually we could but this is something for another video. Finally, we close all the loops here and that’s about it. Well, if you don’t understand what all the code here does or if this was too fast for you maybe you want to watch the other videos in this video series or maybe even the premium course on our website is interesting for you, for now, please click on the compile button… I made a mistake here, I think I have missed a curly bracket here, let’s recompile the code and this time it works! So now we can click on the little button here or press F4 to go back to Metatrader. And in Metatrader we click on insert, indicators, trend, parabolic sar, let’s go with the default values here, right-click into the chart, select save templates and save it as tester dot tpl. And if you don’t see the strategy tester here please click on view, strategy tester or press control and r, pick the new file simple sar buy trailing stop dot ex5, mark the option for the visual mode here and start a test. Here we are! Let’s zoom into the chart, this is the first buy position, here comes the stop loss and it follows the sar indicator values and now you know how to create a trailing stop that is based on an indicator value for the parabolic sar and you have coded it with a few lines of mql5 code. More MQL5 Tutorial Videos: MQL5 TUTORIAL BASICS - 27 HOW TO CODE A SIMPLE SELL TRAILING STOP In this video we are going to create a trailing stop for sell trades, you can see when the price falls that the trailing stop… MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY TRAILING STOP In this video we want to create a trailing stop loss like this one, the stop loss is trailing whenever the price is going up… MQL5 TUTORIAL BASICS - 41 SIMPLE SELL BREAKEVEN STOP In this video, we are going to find out how to set a breakeven stop for sell trades when the price is running into our… MQL5 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP In this video we are going to create break-even stops for buy trades, this is the initial stop-loss for this trade and when the price… MQL5 TUTORIAL BASICS - 23 HOW TO CODE A SIMPLE PARABOLIC SAR EXPERT ADVISOR In this video, we are going to create this interesting Expert Advisor for the Parabolic SAR Indicator. You see the little green points here, this… MQL5 TUTORIAL BASICS - 43 SIMPLE IOSMA EA In this video we are going to create an expert advisor to trade this little indicator here, it's the moving average of oscillator so let's… MQL5 TUTORIAL - SIMPLE SAR STANDALONE EXPERT ADVISOR In this video we are going to create a standalone Expert Advisor that is actually able to trade the Parabolic SAR Indicator. This is a… MQL5 Tutorial - Simple trend based sell stop In this video we are talking about a sell stop that is triggered whenever we have a trend that is going down. That is called… The post MQL5 TUTORIAL BASICS – 44 SIMPLE SAR BUY TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 44 SIMPLE SAR BUY TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Jan 12, 2020 7:46


In this video we are going to create a buy trailing stop for the parabolic sar indicator you see the little dots here, our stop loss is trailing as our price is rising, so let’s find out how to code a stop loss that moves based on an indicator value. To do that please click on view, toolbars, standard and click this little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple sar buy trailing stop, click on continue, continue and finish. Now we can delete everything that is above the on tick function and let’s also delete the two comment lines here. We start with an include statement to include the file trade dot mqh, afterwards, we create an instance of the class ctrade that will be called trade. Inside of the on tick function we need to calculate the ask price, that is done with symbol info double for the current symbol on the chart, we use symbol underscore ask and with normalize double and underscore digits we calculate the right number of digits behind the dot. For our little demo account, we want to create a test position, you wouldn’t do that on your real account but we need something to test, so if we have no open positions and positions total delivers a return value below one we use trade dot buy to buy ten micro lot. Afterwards, we create an array for the sar and we use the integrated function isar for the current symbol on the chart and the currently selected period on that chart. These two parameters here is what you see when you click on insert, indicators, trend, parabolic sar. Here we have a step value of zero point zero two and the maximum value of zero point two, these are the default values so that’s what we use here. Let’s use array set as series to sort the sar array from the current candle downwards and now we use copy buffer according to the sar definition that we have created here to fill our array for three candles starting with candle zero. This parameter here is for the buffer, this indicator only has one buffer because it only produces one line of dots. And now we can actually calculate the sar value by looking into our array especially at candle zero. I use normalize double and the value five because each of those dots here has five digits behind the dot. And now we want to call a function called check sar buy trailing stop, we pass two parameters, the first one is the ask price and the second one is the sar value and as this function does not exist so far we need to create it now. Our trailing stop function will be called check sar buy trailing stop, it will take two parameter values from the main function, the first one is the ask price and the second one is the sar value. Now we use a for loop to go through all the open positions, first we need to get the symbol of the current position, that is done by using position get symbol for the current counter value and we only want to continue if the symbol on the chart and the position symbol are equal. In that case we use position get integer for the position ticket – all in capital letters – to get the ticket number and with position get double we can get the current stop loss by using position underscore sl. And if the current stop loss is below the sar value we use trade dot position modify for the current position ticket to move the stop loss to the sar value. This last parameter here is for the take profit value, we don’t modify that, actually we could but this is something for another video. Finally, we close all the loops here and that’s about it. Well, if you don’t understand what all the code here does or if this was too fast for you maybe you want to watch the other videos in this video series or maybe even the premium course on our website is interesting for you, for now, please click on the compile button… I made a mistake here, I think I have missed a curly bracket here, let’s recompile the code and this time it works! So now we can click on the little button here or press F4 to go back to Metatrader. And in Metatrader we click on insert, indicators, trend, parabolic sar, let’s go with the default values here, right-click into the chart, select save templates and save it as tester dot tpl. And if you don’t see the strategy tester here please click on view, strategy tester or press control and r, pick the new file simple sar buy trailing stop dot ex5, mark the option for the visual mode here and start a test. Here we are! Let’s zoom into the chart, this is the first buy position, here comes the stop loss and it follows the sar indicator values and now you know how to create a trailing stop that is based on an indicator value for the parabolic sar and you have coded it with a few lines of mql5 code.More MQL5 Tutorial Videos:MQL5 TUTORIAL BASICS - 27 HOW TO CODE A SIMPLE SELL TRAILING STOP In this video we are going to create a trailing stop for sell trades, you can see when the price falls that the trailing stop…MQL5 TUTORIAL BASICS - 45 SIMPLE SAR SELL TRAILINGSTOP In this video we are going to create a sell stop for this parabolic sar indicator, so let's find out how to do that with…MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY TRAILING STOP In this video we want to create a trailing stop loss like this one, the stop loss is trailing whenever the price is going up…MQL5 TUTORIAL BASICS - 41 SIMPLE SELL BREAKEVEN STOP In this video, we are going to find out how to set a breakeven stop for sell trades when the price is running into our…MQL5 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP In this video we are going to create break-even stops for buy trades, this is the initial stop-loss for this trade and when the price…MQL5 TUTORIAL BASICS - 30 HOW TO CLOSE ALL BUY POSITIONS This test expert advisor is going to open ten test positions and as soon as we have ten open positions we call a function called…MQL5 TUTORIAL BASICS - 58 SIMPLE DYNAMIC BUY POSITION SIZE In this video, we are going to find out how to dynamically calculate position sizes for buy trades, in this case, based on the equity,…MQL5 TUTORIAL BASICS - 75 SIMPLE TIME FILTER In this video, we are going to create a filter for time-based entries so let's find out how to do that with mql5. To get…

MQL4 TUTORIAL
MQL4 TUTORIAL BASICS – 44 SIMPLE SAR BUY TRAILING STOP

MQL4 TUTORIAL

Play Episode Listen Later Jan 12, 2020 6:03


In this video, we are going to create a trailing stop that is calculated based on this indicator value here for the parabolic sar. You see that the trailing stop moves whenever one of those dots appears on the chart. So let’s find out how to code that 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 we click on file, new file, expert advisor from template, continue, I will call this file simple sar buy trailing stop, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here. We start by creating a global variable called sar value and inside of the on tick function we want to open a test position, you wouldn’t do that on a real account but in our case we need to open a position or we cannot set a trailing stop. So if orders total returns a value of zero – in other words we don’t have any open orders – and if the sar value is below the bid price we use order send for the current symbol on the chart and open a position for ten micro lot. Afterwards, we want to calculate the sar value that is done by using the integrated isar function that comes with mql4 for the current symbol on the chart and for the currently selected period on that chart. And these two parameter values here that’s what you see if you click on insert, indicators, trend, parabolic sar, here we have a step value of zero point zero two and the max value of zero point two, so let’s go with the default values here. And now we right-click into the chart, select template, save template and save it as tester dot tpl, you can replace the current one. And now that we have finished the definition we want to check if the current sar value is below the bid price – that is the case when the dots are below the candles – and in that case we want to check our sar buy stop function, that function doesn’t exist so far so we need to create it now. Our custom function will not have any return values so it is a void function, it is called check sar buy stop, we start by using a for loop to go through all the open orders and positions, afterwards we want to select an order for the current counter value, we use select buy position and mode trades here. We also want to know if the order symbol equals the symbol on the chart and if that is the case we check if the current order type equals op buy – or in other words if it is a buy trade – and only if the current order stop loss is below the current sar value we use order modify for the current order ticket to adjust the stop loss to the current sar value. We leave all the other parameters unmodified. Let’s close the loop and the function here and that’s about it. Now you can click on the compile button here or press F7, you shouldn’t get any errors here but if this was too fast for you or if you don’t understand what all the code here does you maybe want to watch the other videos in this basic series first or maybe even the premium course on our website is interesting for you. If you don’t get any errors here and the compilation process is fine please click on the little button here or press F4 to go back to Metatrader. And in Metatrader you want to click on view, strategy tester or press control and r, please pick the new file simple sar buy trailing stop dot ex4, mark the visual mode here and start a test. Here is our expert advisor, let’s zoom into the chart and as soon we see dots appear below the candles we should also see a trailing stop, that happened right now, so our expert advisor is working as expected and now you know how to create a parabolic sar trailing stop in mql4 and you have coded it yourself with a few lines of mql4 code in the Metaeditor. Automated Trading Tutorial Related Posts:

WHI -malayalam Share Market Talks
Share market stop loss , trailing stop loss in Malayalam by shamnas and dhaneesh

WHI -malayalam Share Market Talks

Play Episode Listen Later Jan 9, 2020 12:10


Share market stop loss , trailing stop loss in Malayalam by shamnas and dhaneesh of WHI Telegram group --- Send in a voice message: https://anchor.fm/don-antony/message

Trend Following Trading For Beginners Podcast
Episode 22 - Trading rule #3 - use a trailing stop loss to reduce your trading risk

Trend Following Trading For Beginners Podcast

Play Episode Listen Later Oct 8, 2019 21:56


In today's episode I want to talk about how the proper use of a trailing stop loss can help to reduce your overall trading risk and explain it using a bell curve. For more trading information and advise please visits: Online - https://www.trendfollowingtradingacademy.org On Facebook - https://www.facebook.com/trendfollowingtraingacademy On Twitter - https://twitter.com/VictorC79619164 On Instagram - https://www.instagram.com/trendfollowingtradingacademy/ Sign up for a free 15 mins no obligation zoom call with me to discuss your trading issues - https://mailchi.mp/9d6f3aca0db5/podcast-sign-up +++++++++++++++ Music credit: Music from https://filmmusic.io, "Funkorama" by Kevin MacLeod (https://incompetech.com). License: CC BY (http://creativecommons.org/licenses/by/4.0/) --- Send in a voice message: https://anchor.fm/victor-cheung/message

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 27 HOW TO CODE A SIMPLE SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Aug 16, 2019 5:55


In this video we are going to create a trailing stop for sell trades, you can see when the price falls that the trailing stop is adjusted automatically and now we want to find out how to do that in mql5. To start please click on the little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file: simple sell trailing stop, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here. First, we include the file trade dot mqh that one will give us simplified trading functions, and it includes a class called c trade, we will create an instance of that class called trade that is what we are going to use later on to open a new trade. To do that we first need to find out the bid price that is done by using symbol info double, for the current symbol on the chart and we use symbol underscore bid – all in capital letters. I also like to use normalize double and underscore digits because that will automatically calculate the number of digits behind the dot depending on the currency pair that could be 3 or 5 digits. So let’s first find out if we have any open positions, and if positions total equals zero that would mean that we don’t have any positions. So on a demo account, we would now use trade dot sell, to sell 10 micro lot because we need a position otherwise, we cannot find out if the trailing stop works and afterwards we want to call the function check the trailing stop and pass the bid price. Well, this function does not exist, so we now need to create it. I use void because I don’t need to return any values, I just want to check and adjust the trailing stop. Our function will take the bid price as a parameter and I would like to have the stop loss 150 points above the bid price. So let’s go through all the positions that is done with a for loop, positions total will give us the number of open positions and we want to count down until we have no open positions left. First we need to get the position symbol for the current position because we only want to continue if the current symbol on the chart and the position symbol are equal and we also want to check if the position type is order type sell – all in capital letters – because if you mark that and press F1 you will see that this kind of order type is for a market sell order and that’s what we need. If this is the case we want to get the position ticket – that’s kind of a license plate that will identify one particular position – and we get it by using position get integer. Please use position underscore ticket – once again all in capital letters – afterwards we want to calculate the current stop loss that is done by using position get double and position underscore sl – also in capital letters – and if the current stop loss is above the stop loss that we want to have we use trade dot position modify for the current position ticket to adjust the current stop loss by 10 points. Finally, we need to close the loops and that’s about it. Once again if this is too fast for you or if you don’t understand what the code does you maybe want to watch the other videos in this basic series or maybe even you want to take part in the premium course. But for now please click on the compile button, you should not get any errors here and if this is the case please click on the little symbol here or press F4 to go back to Metatrader. Inside of Metatrader I take an empty chart, right-click, select templates, save template and I save it as tester dot tpl, replace the current one because this is what we want to see in the backtest, we don’t need any Indicators. When you are done please click on view, strategy tester or press ctrl and r, here we want to pick the new file simple sell trailing stop ex5, please mark the option for the visualization here and start your test. And here is our expert advisor at work, we should be able to see the trailing stop moving down as the price goes down and in this video you have learned how to create a trailing stop for sell trades and you have coded it with a few lines of mql5 code. More MQL5 Tutorial Videos: MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY TRAILING STOP In this video we want to create a trailing stop loss like this one, the stop loss is trailing whenever the price is going up… MQL5 Tutorial - Simple Order Cancel Order EA 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… MQL5 TUTORIAL BASICS - 16 HOW TO SET A SELL LIMIT In this video we are going set a sell limit. A sell limit is a pending order far above the current Bid price, so let's… MQL5 TUTORIAL BASICS - 17 HOW TO PLACE A SELL STOP In this video we are going set a sell stop that is a pending order. You don’t see it right now but when we zoom… MQL5 Tutorial - Simple Sell Stop Expert Advisor A sell stop is an order that has been placed into the market and that will be triggered whenever the price is falling below the… MQL5 TUTORIAL BASICS - 13 HOW TO OPEN A SIMPLE SELL TRADE In this video we are going to find out how to create a sell order, whenever the first red candle appears on the chart, so… MQL5 TUTORIAL BASICS - 15 HOW TO PLACE A SIMPLE BUY STOP In this video we are going to talk about a buy stop. You don't see it here but when you zoom into the chart you… MQL5 TUTORIAL - SIMPLE ORDER HISTORY PROFIT In this video we are going to calculate the history profit for positions that have been already closed, it will output the text: “My last… The post MQL5 TUTORIAL BASICS – 27 HOW TO CODE A SIMPLE SELL TRAILING STOP appeared first on MQL5 Tutorial.

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 27 HOW TO CODE A SIMPLE SELL TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Aug 16, 2019 5:55


In this video we are going to create a trailing stop for sell trades, you can see when the price falls that the trailing stop is adjusted automatically and now we want to find out how to do that in mql5. To start please click on the little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file: simple sell trailing stop, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here. First, we include the file trade dot mqh that one will give us simplified trading functions, and it includes a class called c trade, we will create an instance of that class called trade that is what we are going to use later on to open a new trade. To do that we first need to find out the bid price that is done by using symbol info double, for the current symbol on the chart and we use symbol underscore bid – all in capital letters. I also like to use normalize double and underscore digits because that will automatically calculate the number of digits behind the dot depending on the currency pair that could be 3 or 5 digits. So let’s first find out if we have any open positions, and if positions total equals zero that would mean that we don’t have any positions. So on a demo account, we would now use trade dot sell, to sell 10 micro lot because we need a position otherwise, we cannot find out if the trailing stop works and afterwards we want to call the function check the trailing stop and pass the bid price. Well, this function does not exist, so we now need to create it. I use void because I don’t need to return any values, I just want to check and adjust the trailing stop. Our function will take the bid price as a parameter and I would like to have the stop loss 150 points above the bid price. So let’s go through all the positions that is done with a for loop, positions total will give us the number of open positions and we want to count down until we have no open positions left. First we need to get the position symbol for the current position because we only want to continue if the current symbol on the chart and the position symbol are equal and we also want to check if the position type is order type sell – all in capital letters – because if you mark that and press F1 you will see that this kind of order type is for a market sell order and that’s what we need. If this is the case we want to get the position ticket – that’s kind of a license plate that will identify one particular position – and we get it by using position get integer. Please use position underscore ticket – once again all in capital letters – afterwards we want to calculate the current stop loss that is done by using position get double and position underscore sl – also in capital letters – and if the current stop loss is above the stop loss that we want to have we use trade dot position modify for the current position ticket to adjust the current stop loss by 10 points. Finally, we need to close the loops and that’s about it. Once again if this is too fast for you or if you don’t understand what the code does you maybe want to watch the other videos in this basic series or maybe even you want to take part in the premium course. But for now please click on the compile button, you should not get any errors here and if this is the case please click on the little symbol here or press F4 to go back to Metatrader. Inside of Metatrader I take an empty chart, right-click, select templates, save template and I save it as tester dot tpl, replace the current one because this is what we want to see in the backtest, we don’t need any Indicators. When you are done please click on view, strategy tester or press ctrl and r, here we want to pick the new file simple sell trailing stop ex5, please mark the option for the visualization here and start your test. And here is our expert advisor at work, we should be able to see the trailing stop moving down as the price goes down and in this video you have learned how to create a trailing stop for sell trades and you have coded it with a few lines of mql5 code.More MQL5 Tutorial Videos:MQL5 TUTORIAL BASICS - 41 SIMPLE SELL BREAKEVEN STOP In this video, we are going to find out how to set a breakeven stop for sell trades when the price is running into our…MQL5 TUTORIAL BASICS - 45 SIMPLE SAR SELL TRAILINGSTOP In this video we are going to create a sell stop for this parabolic sar indicator, so let's find out how to do that with…MQL5 TUTORIAL BASICS - 26 HOW TO CODE A SIMPLE BUY TRAILING STOP In this video we want to create a trailing stop loss like this one, the stop loss is trailing whenever the price is going up…MQL5 TUTORIAL BASICS - 44 SIMPLE SAR BUY TRAILING STOP In this video we are going to create a buy trailing stop for the parabolic sar indicator you see the little dots here, our stop…MQL5 TUTORIAL BASICS - 31 HOW TO CLOSE ALL SELL POSITIONS In this video we want to to find out how to close all the sell positions at the same time, this little expert advisor is…MQL5 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP In this video we are going to create break-even stops for buy trades, this is the initial stop-loss for this trade and when the price…MQL5 TUTORIAL BASICS - 50 SIMPLE RANDOM ENTRY EXPERT ADVISOR In this video we are going to trade random entries, you might find random entries very strange but I promise that you might find the…MQL5 TUTORIAL BASICS - 60 SIMPLE DYNAMIC SELL POSITION SIZE In this video we are going to create an expert advisor that is able to dynamically calculate the position size for sell positions, so let's…

MQL5 Tutorial
MQL5 TUTORIAL BASICS – 26 HOW TO CODE A SIMPLE BUY TRAILING STOP

MQL5 Tutorial

Play Episode Listen Later Aug 11, 2019 5:37


In this video we want to create a trailing stop loss like this one, the stop loss is trailing whenever the price is going up so let’s find out how to do that. To get started please click on a little icon 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”, I will call this file: “SimpleBuyTrailingStop”, click on “Continue”, “Continue” and “Finish”. Now you can delete everything above the “OnTick” function and please also remove the two comment lines here. We start by including “Trade.mqh”, this file will give us simplified trading functions, and we start by creating an instance of “CTrade” that will be called: “trade” and we are using it to open a test function in our case. To do that we need to get the Ask price, that is done by using “SymbolInfoDouble”, for the current symbol (_Symbol), we use “SYMBOL_ASK” – all in capital letters – and with “NormalizeDouble” and “_Digits” we will get either 3 or 5 digits behind the dot depending on the currency pair we have on the chart. So let’s find out if we have no open positions, that would be true when “PositionsTotal” equals 0 (zero) and in that case, we are going to open a buy position by using “trade.Buy”, we will buy 10 micro lot. This is just a test position for this case because we need a position to find out if the trailing stop really works, you wouldn’t do that on a real account without any entry signal and finally, we want to check the trailing stop for our position. In this case we are using the Ask price as a parameter and now we need to create the check trailing stop function (CheckTrailingStop), this one will take the Ask price and now we use it to calculate the stop loss, we want it to be 150 points below the current Ask price and as it is possible to have more than one position on the chart we use “PositionsTotal” and a “for” loop to go through all the open positions. First we want to find out if the position belongs to the right symbol, so we use “PositionGetSymbol” for the current position number to get the symbol and if the symbol of the current currency pair (_Symbol) equals the symbol of the position (symbol), we have a position that needs to be modified. And now we get the position ticket (PositionTicket) by using “PositionGetInteger”. A position ticket will identify our position; it’s like a license plate. We also want to calculate the current stop loss for the position that is done by using “PositionGetDouble”, “POSITION_SL” will give us the stop loss, if you mark that and press F1 you will see that it’s also possible to get the position volume (POSITION_VOLUME) or the take profit value (POSITION_TP) and other position properties but we just want to check if the current stop loss is below the desired stop loss and if this is the case we use “trade.PositionModify” for the position ticket (PositionTicket) that we have calculated here and now we rise the current stop loss by 10 points. Finally we want to close the “if” loop, the “for” loop and the function and if you don’t understand what all the code does or if this was too fast for you maybe you want to watch the other videos in this basic series or maybe you want to even become a customer for the premium course. Otherwise please click on the “Compile” button now, you shouldn’t get any errors here and in that case you can click on a little button here or press F4 to go back to Metatrader. In Metatrader we use an empty chart without any Indicators, we click on: “Templates/ Save Template” and save it as: “tester.tpl” because this is the template that is going to be used in the backtest, so let’s replace the current one, click on: “View/ Strategy Tester” or press CTRL and R, please pick the new file: “SimpleBuyTrailingStop.ex5” and start a test. Here we are! Our trailing stop is actually working and in this little video you have learned how to code a buy trailing stop and you have done it yourself with a few lines of MQL5 code. More MQL5 Tutorial Videos: MQL5 TUTORIAL BASICS - 15 HOW TO PLACE A SIMPLE BUY STOP In this video we are going to talk about a buy stop. You don't see it here but when you zoom into the chart you… MQL5 TUTORIAL BASICS - 12 HOW TO OPEN A SIMPLE BUY ORDER In this video we want to find out how to open a simple buy position when a bullish candle appears on the chart, in this… MQL5 Tutorial - Simple Sell Stop Expert Advisor A sell stop is an order that has been placed into the market and that will be triggered whenever the price is falling below the… MQL5 TUTORIAL - SIMPLE POSITION INFO In this video we are going to talk about position properties. This chart is about the Australian against the Canadian Dollar. We have a position… MQL5 Tutorial - Simple Order Cancel Order EA 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… MQL5 TUTORIAL - SIMPLE POSITION CLOSE This time we are talking about closing of positions, that happened right now. I have gotten a request to do this from one of the… MQL5 TUTORIAL BASICS - 17 HOW TO PLACE A SELL STOP In this video we are going set a sell stop that is a pending order. You don’t see it right now but when we zoom… MQL5 TUTORIAL - SIMPLE DYNAMIC POSITION SIZE MQL5 TUTORIAL – SIMPLE DYNAMIC POSITION SIZE Audio into Text Transcription In this video, we are going to open lots and lots of trades to… The post MQL5 TUTORIAL BASICS – 26 HOW TO CODE A SIMPLE BUY TRAILING STOP appeared first on MQL5 Tutorial.

Andrea Unger Academy - IT
Approfondimento sul Trailing Stop

Andrea Unger Academy - IT

Play Episode Listen Later Jul 19, 2019 6:21


Se non ti sei ancora iscritto al mio webinar gratuito, clicca qui: http://cli.re/TSSita-pod

Andrea Unger Academy - IT
Approfondimento sul Trailing Stop

Andrea Unger Academy - IT

Play Episode Listen Later Jul 19, 2019 6:21


Se non ti sei ancora iscritto al mio webinar gratuito, clicca qui: http://cli.re/TSSita-pod

Andrea Unger Academy - EN
Trailing Stop Insight

Andrea Unger Academy - EN

Play Episode Listen Later Jul 19, 2019 7:43


If you haven't seen my free webinar yet, click here: http://cli.re/TSSeng-pod

Andrea Unger Academy - EN
Trailing Stop Insight

Andrea Unger Academy - EN

Play Episode Listen Later Jul 19, 2019 7:43


If you haven't seen my free webinar yet, click here: http://cli.re/TSSeng-pod

Dividenden-Alarm
Wie funktioniert eine Trailing Stops Order?

Dividenden-Alarm

Play Episode Listen Later Feb 7, 2019 17:04


Im heutigen Artikel möchte ich euch die Trailing Stop Order vorstellen, die ich während Kaufphasen und Verkaufsphasen des Dividenden-Alarm Indikators häufig verwende. Mit der Orderart Trailing Stop kann man seine Aktien meist zu besseren Einstiegskursen ordern, seinen Gewinn automatisiert laufen lassen, ist auch in der Lage seine Verluste zu begrenzen und kann allgemein sein Trading verbessern. Trailing Stops bieten wichtige Vorteile und eignen sich gerade für langfristige Dividenden-Investoren.

Andrea Unger Academy - EN
Trailing Stop,Yes or No?

Andrea Unger Academy - EN

Play Episode Listen Later Jun 1, 2018 6:53


If you haven't seen my free webinar yet, click here: http://cli.re/TSSeng-pod

Andrea Unger Academy - IT
Trailing Stop, Si o No?

Andrea Unger Academy - IT

Play Episode Listen Later Jun 1, 2018 6:14


Clicca qui per iscriverti alla Masterclass gratuita: https://autc.pro/TSSita-pod?sl=14933957

Andrea Unger Academy - IT
Trailing Stop, Si o No?

Andrea Unger Academy - IT

Play Episode Listen Later Jun 1, 2018 6:14


Se non ti sei ancora iscritto al mio webinar gratuito, clicca qui: http://cli.re/TSSita-pod

Andrea Unger Academy - EN
Trailing Stop,Yes or No?

Andrea Unger Academy - EN

Play Episode Listen Later Jun 1, 2018 6:53


If you haven't seen my free webinar yet, click here: http://cli.re/TSSeng-pod

Aktien mit Kopf - Investieren für Privatanleger
Trailing Stop-Loss Order / ETF Angebot & Nachfrage / Gold an der Börse

Aktien mit Kopf - Investieren für Privatanleger

Play Episode Listen Later Jan 2, 2017 36:31


Richard Dittrich ist wieder zu Gast im Podcast und es hagelt wieder geballtes Börsenwissen! Und zwar zu den Themen: 1. Trailing Stop Loss / Stop Loss bei Zertifikaten 2. Haben eigentlich Aktiengesellschaften direkt etwas davon, wenn ihr Kurs steigt? 3. Wie funktioniert eigentlich die Ausgabe und Rücknahme von ETF-Anteilen? 4. Ist EUWAX-Gold nach einem Jahr steuerfrei zu verkaufen? Wie funktioniert die Auslieferung des Goldes im Detail? Folge direkt herunterladen

Truth About FX
EP21: Should I Use Two Targets vs. One Target and Trailing Stop?

Truth About FX

Play Episode Listen Later Jul 7, 2016 4:33


In this episode of Truth About FX, Walter discusses about the pros and cons of using two targets alone versus using one target and a trailing stop to maximize profits on the last position. He also points out that it is important to use the method that you are comfortable with and is acceptable within... The post EP21: Should I Use Two Targets vs. One Target and Trailing Stop? appeared first on Truth About Forex Trading Podcast.

Online Forex Trading Course
Should you use a trailing stop as a Forex trader?

Online Forex Trading Course

Play Episode Listen Later Oct 8, 2015 4:59


Podcast: Should you use a trailing stop as a Forex trader?In this video: 00:26 Do Trailing-Stops Beneficial 01:20 Trailing- Stop Issues 04:03 Just A Quick SurveyShould you use a trailing stop as a Forex trader? Let's talk about that and more right now.Hi Forex traders, it's Andrew Mitchem here, the Forex trading coach. Today is Friday, the 9th of October. As you can see, it's springtime here in New Zealand, and I thought it would be a great idea to get outside into the bit of fresh air, and away from the charts for this video and podcast.Do Trailing-Stops BeneficialI want to talk about trailing-stops. I've had an email here from Raphael, who said, "Hey, Andrew, can you make a video describing the benefits of trailing stops. I think it would make a great topic for your weekly videos." I've had a think about that, because it's a question that I get asked quite often. I've got to be really honest with you, I'm not a fan of trailing stops myself.I'm not saying they don't work, I'm just saying that within my own trading and the style of trading that I have, I don't use trailing stops, and I'll explain why. As a technical trader, I like to look at what's happening on the charts, and I like to have a reason for everything that I do. I like to have a reason for placing the trade, a reason for my stop loss, a reason for my profit target, etc. That, as a technical trader, gives me confidence of why I'm taking a trade.Trailing- Stop IssuesThe problem that I have with a trailing stop is, how big a trailing stop do you use?Do you use 10 pips, 20 pips, 100 pips?What is it that you use?Then you come back to the problem of your trading is then determined by how many pips you make, rather than the percentages, like I talk about in terms of the way that I trade with risk and money management.I'm not a great fan of saying, "Hey, I want to move my stop, trail it by 20 pips," because it depends on what pair I'm trading, because different currency pairs move at different amounts. It depends on the time of day that I'd be trading. The Asian session is generally a lot slower than, let's say, the European sessions, so 20 pips doesn't really mean a great deal. If I was trading the British Pound/New Zealand Dollar (GBP/NZD), 20 pips is absolutely nothing. Yet, if I'm trading the Euro/British Pound (EUR/GBP), 20 pips is actually quite a lot, because it's a slower moving currency pair.Again, you can see the issues with picking a trailing stop. Also, what determines 20 pips? Maybe it should be 30, maybe it should be 40? It's hard to know exactly how big a trailing stop to use.Of course, if you use MT4 and that's probably the same with other trading platforms, is that a trailing stop will only work if you have your computer on. A hard stop loss, you can put that in and close your computer down and walk away from your charts, and your broker's server keeps that on there on their platform, whereas a trailing stop only works if your computer is actually on, and connected to the internet. If you have a virtual server, not a problem, but I'm guessing the majority of people who are trading, don't have a virtual server and they have their computer on. If your computer stops, you lose an internet connection, you close down your platform, then you lose that trailing stop figure. That becomes another issue.For me, if I place stop loss, and my trade moves into some really good profit, let's say, and I want to protect that profit, then I'd much rather move my stop loss to a technical level. Let's say, I might be buying. I want to move my stop loss up to below the last swing low, or the candle low, or round number, or pivot point, whatever it is that I'm using as my strategy. Wherever I see a good support level, I might want to bring my stop loss up to below that last support ...

Forex Answers | Forex Trading Strategies 7 Days A Week | Learn To Trade Foreign Exchange Markets | Forex Trading For Beginner

A trailing stop loss is a really good Forex tool to use for closing out trades. find out what it can be used to do in detail.

Stock Trading University
46. How a Trailing Stop Loss Order Works

Stock Trading University

Play Episode Listen Later Oct 23, 2014 3:11


In this session, you will be introduced to the trailing stop loss order.

Stock Trading University
46. How a Trailing Stop Loss Order Works

Stock Trading University

Play Episode Listen Later Oct 23, 2014 3:11


In this session, you will be introduced to the trailing stop loss order.

Forex Answers | Forex Trading Strategies 7 Days A Week | Learn To Trade Foreign Exchange Markets | Forex Trading For Beginner

Welcome to episode 64 of the Forex Answers podcast. If you are new to Forex trading, this is a great resource for you to start learning about Forex. Each episode is going to cover one brand new question. And our podcast is 7 days a week. We just want to take this time to thank you all for helping this show take off. And hopefully we can provide you with valuable content in each and every episode. In today's episode, we are going a bit deeper into a Forex stop loss because today's question is all about a trailing stop loss. Want a question answered on the show? Send them to questions@vintageducation.com Click here to Record your question   Enjoy the show... IN THIS Episode: What a trailing stop loss is   Why a trailing stop loss is different   How you can use a trailing stop loss in your trade   why I don't recommend using this tool or feel you will need this tool if you trade shorter time frames   Why I never use a trailing stop loss   Some disadvantages & advantages of using a trailing stop loss RESOURCES, LINKS & Tips MENTIONED IN THe episode: Forex Answers Episode 38 - What a stop loss is    Free 7 Day Course - Our free 7 day Forex course starts you off on the right track and walks you through 7 days of great content   Right Click here to download the episode. Show Review We would love you to leave a review (5* hopefully) because your support is really unmeasurable. Every positive review we receive, the more Forex traders we can reach. If you haven't already please leave a review and subscribe to the podcast. Click here to leave a review and subscribe to the podcast. Thanks again. The VintagEducation Team

Stock Market Mentor Chart of the Day
Green Mountain continues to march higher...just one penny below resistance. Are you using a trailing stop? (December 20, 2012)

Stock Market Mentor Chart of the Day

Play Episode Listen Later Dec 20, 2012


InvestTalk
12-05-18: U.S. Treasury: Stock and Bond Markets Represent the Biggest Threat to Financial Stability

InvestTalk

Play Episode Listen Later Dec 31, 1969 47:18


The Treasury's Office of Financial Research claims interest-rate uncertainty, and rising costs, are driving market risks higher. Today's Stocks & Topics: Business Development Corporations, S&P 500, Facebook, Tech Companies, Tax Laws, Rate of Return, Tactical Trading, 401K, Roth I-R-A, Bonds, ETFs vs. Mutual Funds, Put Options, 12 Month Cycle, PEG Ratio, Trailing Stop, Dollar Cost Average, Blank Check Companies.Support this podcast at — https://redcircle.com/investtalk-investment-in-stock-market-financial-planning/donations

InvestTalk
03-06-19: U.S. Treasury: Stock and Bond Markets Represent the Biggest Threat to Financial Stability

InvestTalk

Play Episode Listen Later Dec 31, 1969 50:19


The Treasury's Office of Financial Research claims interest-rate uncertainty, and rising costs, are driving market risks higher. Today's Stocks & Topics: Business Development Corporations, S&P 500, Facebook, Tech Companies, Tax Laws, Rate of Return, Tactical Trading, 401k, Roth I-R-A, Bonds, ETFs vs. Mutual Funds, Put Options, 12 Month Cycle, PEG Ratio, Trailing Stop, Dollar Cost Average, Blank Check Companies.Support this podcast at — https://redcircle.com/investtalk-investment-in-stock-market-financial-planning/donations