POPULARITY
Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it to find entries or exits like you could with a simple moving average. Now if that is almost the same, why should we prefer to use an Adaptive Moving Average? Well Perry J. Kaufmann created this fascinating formula here for a reason. The Adaptive Moving Average has less lagging and generates less false signals. Let’s see if that is true. Now how can we create an Adaptive Moving Average Expert Advisor for Meta Trader 5? First please click on the little button here, that should bring up the MetaEditor. And here you want to select File, New, Expert Advisor from template, Continue and we will call that Simple Adaptive Moving Average. Now click on Continue, Continue, finish, and you can remove everything above the Ontick function here and I will also delete the two comment lines. So let’s create an array that will hold our prices, I will call it my price array and it is a double array because double and float variables can hold floating point types. And the adaptive moving average has six digits behind the dot and now we want to use the integrated MQL5 function iAMA for the current symbol on the chart and the current period, we want to calculate our prices based on the last nine candles. The Fast Moving Average has a value of two because if you Insert, Indicators, Trend, Adaptive Moving Average, you will see the values here, these are the nine candles. The fast EMA, that’s an Exponential Moving Average, is calculated for two candles and the slow EMA is calculated for thirty candles. And we do not need any shift, so we will use the exact same values here: nine candles, two candles for the fast EMA, thirty candles for the slow EMA. Zero for no shift and I would like to have the values calculated based on the close prices because the close price is also the default setting here. Okay let’s move on and sort the price array from the current candle downwards by using the array set as Series function for the price array we have created here. And now we want to fill it with data, that is done by using Copy Buffer for the Defined Moving Average, that’s the Adaptive Moving Average Definition we have created in this line. We just need one line, that’s the zero here, and we want to copy values from the current candle that’s candle zero for three candles that’s the three here, and we want to store the results in our price array. And now what we have done that, we want to get the value of the current candle, that’s candles zero of our price array and we use the normalized double function to get six digits behind the dot and the calculated value should be stored in a variable that is called Adaptive Moving Average Value. And the last step is to create a chart output by using the comment function. It will output the text AMA value and the calculated value for the Adaptive Moving Average Value we have extracted here. Okay that’s it, now please click the Compile bottom and you should get no errors and no warnings here so now you can click the button or hit the F4 key to go back to MetaTrader. And in MetaTrader you want to click on View, Strategy Tester, and in the Strategy Test panel you want to select the Simple Adaptive Moving Average.ex5 file. Select any currency pair you like and please make sure to enable the check mark for the visualisation option before you start your test. And here we go! if you move your mouse to the current value here, you'll see that we have a value of 1.544031, that’s exactly what we have calculated here. And in your Expert Advisor you would now compare the value of the adaptive moving average to the current price. And if the price is above the moving average you would buy, and if the price is below the moving average you would sell. Okay now you can create an Expert Advisor that uses the Adaptive Moving Average Indicator to find out if you want to buy or if you want to sell and you have created it in less than five minutes with a few lines of MQL5 code. Not sure what to do? Click on the automated trading assistant below How to create an Adaptive moving Average EA with MQL5 The Empowering MQL5 Moving Average MQL5 TUTORIAL - PLATIN SYSTEM - ADVANCED MOVING… MQL5 TUTORIAL - SIMPLE AMA STANDALONE EXPERT ADVISOR MQL5 TUTORIAL - HOW TO CREATE A SHIFTED MOVING AVERAGE The post MQL5 Tutorial – Simple Adaptive Moving Average Robot appeared first on MQL5 Tutorial.
This week's "topics" guest is Perry S Kaufman, who is a strategic advisor to founder led companies. Perry worked for some of the largest firms in the country, including KPMG, TravisWolff, and Armanino where he was Partner. Perry, Kevin, and Stewart tackle the "fork in the road" that that so many founder-led companies face. After having advised hundreds of companies of all sizes, industries and complexity, Perry has a unique perspective to provide insight and guidance for founders who find themselves at this "fork in the road" where he can identify with client's situation and formulate alternatives and recommendations to a variety of business challenges.Grab your journal for this week's episode because one-way-or-another these ideas and techniques will impact your professional journey.|| Connect with Us || Check out all our episodes on all major streaming platforms, and further engagement with the 17Twenty crew on social media at:https://17twenty.buzzsprout.com/https://www.linkedin.com/company/17twentyhttps://www.instagram.com/17twentypodcastGrab your copy of the Mountain Mover Manual: How to Live Intentionally, Lead with Purpose, and Achieve Your Greatest Potential, by Kevin CareyOriginally in print:https://amzn.to/441OPeHAnd now available on Audible:https://adbl.co/45YIKB2
Starting a new business is not for the faint of heart. The confidence, courage, and work ethic it takes to get something off the ground is nothing less than herculean. But once a business is off the ground and things are going well, every owner will - hopefully - hit what we're calling The Fork in the Road. A point where it comes time to grow, sell, or pass off a company. With that in mind, this week's episode is the first in a four-part series on this topic that will be spread out over the next couple of months.And joining me to discuss how leaders can navigate this Fork in the Road is Perry Kaufman, a Strategic Advisor who has worked for some of the largest firms in the country, including KPMG as well as TravisWolff and Armanino where he was Partner.He now heads his own boutique practice, PSK Consulting, which specializes in advising Founder-Owned companies at every stage and size.For this first episode we talk about how the classic idea of ‘the owner' no longer applies, why people as driven as entrepreneurs stutter when it comes to innovation, why it's actually a good thing to run out of answers. Enjoy the show!
With the US elections just days away, traders are thinking about how the markets may react to whatever news the elections may bring. Will we see a big selloff, wild swings in price, and huge spikes in volatility? Or do the markets typically deliver something else around election time? In this episode of BST Live, Perry Kaufman from Kaufman Signals joins us to discuss how to survive market selloffs, including: Historical returns around election days since 1924, The 2 types of prices shocks and the best approach to handling them, The link between stock price and percentage change and why you should avoid trading low priced stocks, Should traders hedge to reduce risk, The dangers of Price Shocks on backtesting results (and how to avoid them), How to determine the volatility level where returns are no longer worth the risk, Plus, volatility parity, rebalancing, portfolio volatility, and much more!
In this video we want to find out how to calculate this accumulation distribution oscillator and how to use it as a filter for a simple moving average, so let’s find out how to do that with mql5. To get started please click on the little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple IADEA, now let’s click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here, we start with an include statement for the file trade dot mqh, afterwards, we create an instance of ctrade that will be called trade. Inside of the on tick function we need to get the ask price and the bid price, that is done by using symbol info double, either for symbol underscore ask or underscore bid. We also create an empty string variable called signal, afterwards we need to create two arrays, the first one is for the price data and the second one is for the moving average, so let’s use array set as series to sort the price array from the current candle downwards, afterwards we define the moving average that is done by using the ima function. Now if you don’t know how this works you maybe want to watch the other videos in this basic course video series, in our case we use a simple moving average for twenty candles, let’s also sort this one from the current candle downwards and now we use copy buffer to copy the values for three candles according to the my moving average definition that we have created here and store it in the array. And to calculate the current simple moving average value we just need to look into candle zero of the moving average array and that value will be assigned to a variable called my moving average value. Let’s also calculate the two values we need to find out of the accumulation distribution oscillator is rising or falling, that is done by using the IAD function for the current symbol and the current period on our chart, we use volume tick as the third parameter, afterwards we use copy buffer to fill the price array with price data for eleven candles according to the IAD definition that we have created here. To get the current IAD value we just have to look for the value of candle zero in our price array and we get the value for the last IAD by looking into candle ten of our price array, so now we can define a few conditions, the first one if the ask price is above the moving average, that is the case when the candles are above the simple moving average line here that would be an uptrend and in that case I would like to know if the current IAD value is bigger than the last one, that would be true when the accumulation distribution oscillator is rising and if both conditions are true we assign the word buy to our signal. Otherwise, if the bid price is below the moving average value, like here where the candles are below the simple moving average and if the current IAD value is below the last one, that is true if the value is falling, that’s when we want to assign the word sell to our signal. And if our signal equals sell and positions total is below one or in other words we have no open positions we use trade dot sell to sell ten micro lot. Otherwise, if the signal equals buy and we also have no open positions we use trade dot buy to buy ten micro lot. Finally, we use the comment statement to output the text, the current signal is, followed by the calculated signal. Now if this was too fast for you or if you don’t know what all the code here does maybe you want to watch the other videos in this basic series, otherwise please click on the compile button now or press F7, you shouldn’t get any errors here and if this is the case please click on a 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 IADEA dot ex5, mark the visible mode here and start a test. Here we are! Our little expert advisor is working, it’s creating buy or sell signals and in this little video you have learned how to calculate the value for the accumulation distribution oscillator and how to use it as a filter for a simple moving average and you have coded it yourself with a few lines of mql5 code. More MQL5 Tutorial Videos: MQL5 Tutorial - Simple Moving Average Robot with MQL5 If you have been trading for a while, chances are high that you have used or maybe you have seen a moving average. This is… MQL5 TUTORIAL BASICS - 11 HOW TO CALCULATE A SIMPLE MOVING AVERAGE In this video want to calculate the value for a Simple Moving Average and output the value on the chart, so let’s find out how… MQL5 TUTORIAL BASICS - 19 HOW TO TRADE A SIMPLE MOVING AVERAGE In this video we are going to create a simple Expert Advisor that is going to trade this Moving Average. It’s a Moving Average for… MQL5 Tutorial - Simple Adaptive Moving Average Robot Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it… MQL5 Tutorial - Simple Moving Average Crossover Robot with MQL5 Okay you have asked for it so here it is. A YouTube subscriber with the name Laurent ZB wanted me to create an Expert Advisor… MQL5 TUTORIAL - CROSSOVER STANDALONE EXPERT ADVISOR In this video we are going to talk about one of the most popular entries; this is a crossover entry for a Moving Average that… MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR In this video we are going to create an Expert Advisor that is going to output buy or sell signals based on the SMA (Simple… MQL5 TUTORIAL - SIMPLE DOUBLE EXPONENTIAL MOVING AVERAGE In this video, we are going to trade the Double Exponential Moving Average (DEMA) that's basically a red line you see on your chart. If… The post MQL5 TUTORIAL BASICS – 42 SIMPLE Accumulation Distribution EA appeared first on MQL5 Tutorial.
In this video, we are going to create an Expert Advisor for this Indicator here; actually, it’s a Simple Moving Average and a shifted Simple Moving Average. The Indicator produces buy and sell signals that can be automatically traded in Metatrader so let’s find out how to do that with MQL5. First please click on the little button here or press F4 to open the Metaeditor and here you want to click on: “File/ New/ Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleShiftedSMAEA”, click on “Continue”, “Continue” and “Finish”. Now you can remove everything above the “OnTick” function and the two comment lines here. We start with an include statement to include the file: “Trade.mqh”, this one will give us some simple trade functions. First we create an instance of “CTrade” that will be called: “trade” and we are going to use it later on to open buy and sell positions and to be able to do that we first need to find out the Ask and the Bid price that is done with “SymbolInfoDouble”, “_Symbol”, we use “SYMBOL_ASK” to calculate the Ask price and “SYMBOL_BID” to calculate the Bid price. I also use “NormalizeDouble” and “_Digits” because that will automatically calculate the number of digits behind the dot. Now let’s create a string variable for the signal. So far it has no value; we are going to calculate that later on. First, we create a Moving Average array (myMovingAverageArray) and we also want to create a shifted Moving Average array (myShiftedAverageArray). To calculate the value for the Moving Average array (myMovingAverageArray) we use the integrated “iMA” function. The first parameter is for the current symbol on the chart (_Symbol), The second one will give us the current period (_Period), Parameter 3 is 20 for 20 candles, Parameter 4 is 0 (zero) because we don’t use a shift value for this Moving Average, The next parameter is “MODE_SMA” – that stands for Simple Moving Average – And the last parameter is “PRICE_CLOSE” – in capital letters – will give us the calculation based on the close price. Now let’s repeat the whole thing, this time for the shifted Moving Average. Everything is similar except for the shift value here. This value will move the current Simple Moving Average – that is the red one – 20 candles into the future, that’s the green line. Now we use “ArraySetAsSeries” to sort both Moving Averages from the current candle downwards and with “CopyBuffer” we fill the Moving Average array (myMovingAverageArray) and the shifted Moving Average array (myShiftedAverageArray) according to the Moving Average definition (movingAverageDefinition) that we have created here or the shifted Average definition (shiftedAverageDefinition) that we have created here and fill both arrays for buffer 0 (zero) from the current candle 0 (zero) for 3 candles. Now we are able to get the current value for the Moving Average array (myMovingAverageArray) by looking into candle 0 (zero) of our Moving Average array (myMovingAverageArray) and we get the shifted Moving Average value by looking into candle 0 (zero) in our shifted Moving Average array (myShiftedAverageArray). And if the Moving Average value (myMovingAverageValue) is bigger than the shifted Moving Average value (myShiftedAverageValue) that would be a buy signal so we assign the word: “buy” to our signal. In the other case if the Moving Average value (myMovingAverageValue) is below the shifted Moving Average value (myShiftedAverageValue) we would consider that to be a sell signal and now we assign the word: “sell” to our signal. And whenever the signal equals sell and “PositionsTotal” is below 1 – or in other words, we don’t have any open positions – we use “trade.Sell” and sell 10 micro lot. Otherwise, if the signal equals buy and we have no open position we use “trade.Buy” and buy 10 micro lot. So that’s almost it. We also want to use the “Comment” statement to output the text: “The current signal is now:” followed by the calculated signal. If you don’t understand what all the code here does or this was too fast for you maybe you want to watch the other videos in this basic series or maybe even the premium course is interesting for you, for now, please click on “Compile”, you should not see any errors and no warnings here and in that case you can click on the little button here or press F4 to go back to Metatrader. In Metatrader, we want to create a template. That’s done by using “Insert/ Indicators/ Trend/Moving Average”, we want to pick a period for 20 candles, a shift value of 0 (zero), the method should be “Simple” for Simple Moving Average, apply to close and the colour is red. So let’s click on “OK”, and here is our first SMA, so let’s repeat that and create the other one; “Insert/ Indicators/ Trend/Moving Average”, but this time we are going to use a shift value of 20 and the colour should be green. So let’s click on “OK” to get the second Moving Average here. Now right click into the chart, select “Templates/ Save Template” and save it as “tester.tpl”, you can override the current one because “tester.tpl” is what is going to be used in the next strategy test. To show the Strategy Tester please click on: “View/ Strategy Tester” or press CTRL and R, here you want to pick the new file: “SimpleShiftedSMAEA.ex5”, please enable the visualization option here and start a test. …and here is our little Expert Advisor at work, it produces buy and sell signals, whenever the direction changes and we see a crossover and you have learned how to create a simple Expert Advisor that is able to automatically trade those signals and you have coded it yourself with a few lines of MQL5 code. More MQL5 Tutorial Videos: MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR In this video we are going to create an Expert Advisor that is going to output buy or sell signals based on the SMA (Simple… MQL5 TUTORIAL BASICS - 11 HOW TO CALCULATE A SIMPLE MOVING AVERAGE In this video want to calculate the value for a Simple Moving Average and output the value on the chart, so let’s find out how… MQL5 TUTORIAL BASICS - 19 HOW TO TRADE A SIMPLE MOVING AVERAGE In this video we are going to create a simple Expert Advisor that is going to trade this Moving Average. It’s a Moving Average for… MQL5 Tutorial - Simple Moving Average Robot with MQL5 If you have been trading for a while, chances are high that you have used or maybe you have seen a moving average. This is… MQL5 Tutorial - Simple Moving Average Crossover Robot with MQL5 Okay you have asked for it so here it is. A YouTube subscriber with the name Laurent ZB wanted me to create an Expert Advisor… MQL5 TUTORIAL - SIMPLE DOUBLE EXPONENTIAL MOVING AVERAGE In this video, we are going to trade the Double Exponential Moving Average (DEMA) that's basically a red line you see on your chart. If… MQL5 Tutorial - Simple Adaptive Moving Average Robot Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it… MQL5 TUTORIAL BASICS - 20 HOW TO CODE A SIMPLE CROSSOVER EXPERT ADVISOR In this video we are going to create a standalone version for a crossover Expert Advisor that is producing buy and sell signals directly on… The post MQL5 TUTORIAL BASICS – 25 HOW TO CODE A SHIFTED SMA EXPERT ADVISOR appeared first on MQL5 Tutorial.
In this video, we are going to create an Expert Advisor that is actually going to trade the MACD. The MACD is an oscillator and now we want to automate it with MQL5. To do that please click on the little button here or press F4 in your Metatrader, now you should see the Metaeditor window and here you want to click on: “File/ New File/ Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleMacDEA”, click on “Continue”, “Continue” and “Finish”. Now you can remove everything above the “OnTick” function and the two comment lines here. We start by including the file: “Trade.mqh”, this one will give us some trading functions, afterwards we will create an instance of “CTrade” that will be called: “trade” and we are going to use it to open positions later on. To be able to do that we need to calculate the Ask price and the Bid price that is done by using “SymbolInfoDouble” for the current symbol on the chart, we use “SYMBOL_ASK” or “SYMBOL_BID” and with “NormalizeDouble” and “_Digits” we make sure that we are getting either 3 or 5 digits behind the dot depending on the currency pair we used that might be different. I would like to create a string for the signal that will be called: “signal”, it doesn’t have any value right now, we need to calculate that value later on. Let’s create an array for several prices that will be called: “myPriceArray“, now we defined the properties for the MACD Expert Advisor (MacDDefinition), MQL5 comes with an included function called: “iMACD”, it takes a few parameters: The first one is for the current symbol on the chart, The second one is for the period that is selected on that chart, Here we have 3 values and the MACD value should be calculated based on the close price, so let’s find out what these 3 values mean. On any chart click on: “Insert/ Indicators/ Oscillators/ MACD” and you will see the 3 values: 12, 26 and 9. 12 is the value for the fast Exponential Moving Average (Fast EMA), 26 is the value for the slow Exponential Moving Average (SlowEMA) and there is also a value of 9 for the MACD Simple Moving Average (MACD SMA), if you are interested in the exact formula you could go to sites like investopedia.com. What’s important for now is that the 3 values are used here to calculate one value, we use “CopyBuffer” to copy the price data into our price array (myPriceArray), we do it according to the MACD definition (MacDDefinition) that we have created here for the first buffer – let’s actually call butter – we start with the current candle 0 (zero) and we copy the values for 3 candles. From time to time people ask me why I always use 3 candles, well that’s handy if you want to calculate a crossover value and it’s much faster than it would be to use all the candles on the chart, so we can save some processing power here. Now I can get the value for the MACD by looking into the value of candle 0 (zero) of our price array (myPriceArray), for this simple example let’s assume that we have a sell signal whenever the MACD value (MacDValue) is above the 0 (zero) line – this is the zero line – and when the MACD value (MacDValue) is below the zero line that would be a buy signal and when our signal equals sell and “PositionsTotal” is below 1 – that would mean we have no open position – we would use “trade.Sell” to sell 10 micro lot. In the other case if the signal equals buy and we have no open positions we would use “trade.Buy” and buy 10 micro lot. Finally, we want to create a chart output, I would like to see the text: “The signal is now:” followed by the signal that we have created. That’s about it, so let’s click on the “Compile” button here, I have one warning because I use a float variable here, this one will give me fewer digits behind the dot but it’s faster and it’s enough for our simple example here, so if you don’t have any errors 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 CTRL and R, here you want to pick the file: “SimpleMacDEA.ex5”, please mark the visualization option here and start a test. Now you should actually see the MACD and here is our first position, it’s actually trading and in this little video you have learned how to automate the MACD and create an MQL5 Expert Advisor that is actually going to trade it and you have coded it yourself with a few lines of MQL5 code. More MQL5 Tutorial Videos: MQL5 Tutorial - Simple MacD Trading Robot This video is about the MacD. The MacD is an old indicator, it was created in 1979 by a man called Gerald Appel. And when… MQL5 TUTORIAL - SIMPLE MACD STANDALONE EXPERT ADVISOR In this video we are going to create an Expert Advisor that is actually going to trade. It´s going to trade the MACD indicator. That´s… MQL5 TUTORIAL - SIMPLE AMA STANDALONE EXPERT ADVISOR This time we are going to calculate the Adaptive Moving Average Indicator; this is the red line you see on the chart. Whenever the candles… MQL5 TUTORIAL BASICS - 19 HOW TO TRADE A SIMPLE MOVING AVERAGE In this video we are going to create a simple Expert Advisor that is going to trade this Moving Average. It’s a Moving Average for… MQL5 TUTORIAL - SIMPLE IDEMA STANDALONE EXPERT ADVISOR In this video we are going to create a standalone Expert Advisor for the Double Exponential Moving Average Indicator; it's the red line here and… MQL5 Tutorial - Simple Adaptive Moving Average Robot Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it… MQL5 TUTORIAL BASICS - 20 HOW TO CODE A SIMPLE CROSSOVER EXPERT ADVISOR In this video we are going to create a standalone version for a crossover Expert Advisor that is producing buy and sell signals directly on… MQL5 TUTORIAL - SIMPLE DOUBLE EXPONENTIAL MOVING AVERAGE In this video, we are going to trade the Double Exponential Moving Average (DEMA) that's basically a red line you see on your chart. If… The post MQL5 TUTORIAL BASICS – 21 – HOW TO CODE THE MACD EXPERT ADVISOR appeared first on MQL5 Tutorial.
In this video we are going to create a standalone version for a crossover Expert Advisor that is producing buy and sell signals directly on a chart and it is actually going to trade those signals whenever crossover happens, we will get a signal here, so let’s find out how to do that with MQL5. First you need to click on the little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on: “File/ New/ Expert Advisor (template)” from template, “Continue”, I will call this file: “SimpleCrossoverEA”, click on “Continue”, “Continue” and “Finish”. Now you can delete everything that is above the “OnTick” function and let’s also delete the two comment lines here. We start by including the file: “Trade.mqh” that will help us to create an instance of the class: “CTrade” that will be called: “trade”. Now we want to create two input values, if you mark “input” and press F1 you will see that it defines an external variable, basically it will create a user input. We need two; one small Moving Average (SmallMovingAverage ) and one big Moving Average value (BigMovingAverage). Now let’s calculate the Ask price and the Bid price that is done by using “SymbolInfoDouble” for the current symbol on the chart, we use “SYMBOL_ASK” or “SYMBOL_BID”. “NormalizeDouble” and “_Digits” will give us the number of digits behind the dot. Let’s create an empty value for the signal (signal) that needs to be calculated. We start by creating an array for several prices; one for the small Moving Average (SmallMovingAverageArray) and one for the big Moving Average (BigMovingAverageArray), first we need to define the properties of the small Moving Average (SmallMovingAverageDefinition) – I need to reduce the font size here – we use the function “iMA” for the current symbol on the chart and the currently selected period on that chart, this is the number of candles that we want to use to calculate the small Moving Average – in our case it’s 20 candles – we don’t use a shift value and with “MODE_SMA” and “PRICE_CLOSE” we define that we want to calculate a Simple Moving Average that is based on the close price. Now let’s repeat that for the big Moving Average (BigMovingAverageDefinition), this is basically the same line – that is 50 by default – afterwards we use “CopyBuffer” to fill our small Moving Average array (SmallMovingAverageArray) according to the definition (SmallMovingAverageDefinition) that we have created here for the buffer 0 (zero) – that’s the only line the Moving Average has – we start with candle 0 (zero), copy the value for 3 candles and store them in a small Moving Average array (SmallMovingAverageArray), afterwards you might have guessed it, we do the same thing for the big Moving Average according to the definition (BigMovingAverageDefinition) we have created here, we store the values in our big Moving Average array (BigMovingAverageArray) and if the big Moving Average is greater than the small Moving Average for candle 1 and it was below the small Moving Average for candle 2 that would be a crossover, now we want to buy so we assign the word: “buy” to our signal. Otherwise if the big Moving Average is below the small Moving Average for candle 1 and if the big Moving Average was above the small Moving Average for candle 2 that’s a crossover in the other direction, now we would assign the word: “sell” to our signal and if our signal equals sell and if we have no open positions we use “trade.Sell” to sell 10 micro lot. Otherwise if the signal equals buy and we have no open positions we would use “trade.Buy” to buy 10 micro lot. Finally we want to use the “Comment” function, this will output “The signal is now:” followed by the signal that we have calculated. That’s about it, if this is too fast for you you might consider to become a member of the premium course or repeat the other basic videos in this series. When you’re done you can click on the “Compile” button or press F7 on your keyboard, you should not get any errors and in that case you can click here or press F4 to go back to Metatrader, and in Metatrader we are going to use a little trick please click on: “Insert/ Indicators/ Trend/ Moving Average”, the small Moving Average in our case is for 20 candles, the shift is 0 (zero), we want to calculate a simple moving average that is based on the close price and I would like to have a red line, so let’s click on “OK”, now we repeat the process, pick another Moving Average, now I would like to have 50 candles and this time I would like to have a yellow color, so let’s click on “OK”, let’s right click into the chart, select “Templates/ Save Template” and save it as “tester.tpl” because this is the template that is going to be used in the next strategy test. So let’s bring up the Strategy Tester by clicking on: “View/ Strategy Tester” or pressing CTRL and R, here you want to pick the new file: “SimpleCrossoverEA.ex5”, please mark the visualization option here and start a test. Here is our Expert Advisor, its running, we see the yellow and the red Moving Average and as soon as we see a crossover here, we should get a signal, there it was… One more thing; if you click on the “Inputs” tab you could change the values here, you might use something like 30 for the small Moving Average now, but please don’t forget to also change the properties for the Moving Average in the template and afterwards you need to save the template as “tester.tpl” again. Now the red Moving Average is for 30 candles, we should get a signal in a few seconds, there it is, here is your first sell trade and in this little More MQL5 Tutorial Videos: MQL5 TUTORIAL - CROSSOVER STANDALONE EXPERT ADVISOR In this video we are going to talk about one of the most popular entries; this is a crossover entry for a Moving Average that… MQL5 Tutorial - Simple Moving Average Crossover Robot with MQL5 Okay you have asked for it so here it is. A YouTube subscriber with the name Laurent ZB wanted me to create an Expert Advisor… MQL5 TUTORIAL BASICS - 11 HOW TO CALCULATE A SIMPLE MOVING AVERAGE In this video want to calculate the value for a Simple Moving Average and output the value on the chart, so let’s find out how… MQL5 TUTORIAL BASICS - 19 HOW TO TRADE A SIMPLE MOVING AVERAGE In this video we are going to create a simple Expert Advisor that is going to trade this Moving Average. It’s a Moving Average for… MQL5 Tutorial - Simple Moving Average Robot with MQL5 If you have been trading for a while, chances are high that you have used or maybe you have seen a moving average. This is… MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR In this video we are going to create an Expert Advisor that is going to output buy or sell signals based on the SMA (Simple… MQL5 Tutorial - Simple Adaptive Moving Average Robot Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it… MQL5 TUTORIAL - SIMPLE SIGNAL STACKING In this video I wanted to talk about something that I call: “Signal Stacking”; you see 4 lines here, each is a Moving Average for… The post MQL5 TUTORIAL BASICS – 20 HOW TO CODE A SIMPLE CROSSOVER EXPERT ADVISOR appeared first on MQL5 Tutorial.
Welcome back to Perry Kaufman part 2 on the importance of testing and some of the secrets to his success including rising at 4.30am each morning. Louise Bedford looks at marriage 'material trading' and finding the perfect archetypal trade. Marriage Material Trading Make sure the instrument you buy is MARRIAGE MATERIAL. Do you have a checklist? Do you have an archetype? Find an image of that perfect trade that ticks every box and then …. print it out. Perry Kaufman Perry Kaufman’s advice to youngsters is to marry someone smarter than you. And arguably Perry may have done that himself, his wife was a member and floor trader at the Chicago Mercantile exchange. She is a systematic trader and he is algorithmic, and she is perfectly willing to tell Perry that he is out of his mind. We still don’t know who does the household budget but it is a good guess that they have it sorted between them. Perry talks testing systems and how to determine and define your parameters and he also gives his top 3 pieces of advice in the markets. We ask Perry about some of the secrets to his success. Spoiler alert - one of them is that he rises at 4.30am …. every morning! He eats the ugliest frog first each day and his 100-year old mother still manages her own stock portfolio. We also hear his favourite quote which seems suitably perfect for a former rocket scientist and algorithmic trader: "Numbers are like people if you torture them they will say anything." To find out more about Perry go to www.kaufmansignals.com
Go to the moon in this episode with former rocket scientist and renown algorithmic trader Perry Kaufman who took the exponential smoothing of missiles into the markets to determine buy and sell signals. Hear his views of the markets and why he never watches the movie Apollo 13. Louise Bedford looks at your trading Eureka moment. Mindpower – Louise Bedford TRADING EUREKA moments are precious and the relief which comes from them are sublime. Louise explains what happens in the brain when these moments occur and why we should hang on in to experience one. Perry Kaufman Perry began his career on the space program working on the navigation for Gemini which was later used for Apollo missions and subsequently military reconnaissance. He was also incidentally one of the guys who caused the Y2K problem. But even in aerospace they had free time. Perry used exponential smoothing (similar to moving averages) to determine the path of missiles and he took that technique into the markets to determine buy and sell signals. He evolved into a trader, strategy developer and risk manager using algorithmic systems and is a renown and leading expert in the field. In this interview from The Bahamas Perry speaks about: trend following and moving averages why currencies play follow the leader and why when the US raises rates other countries have to follow breakout systems accepting risk as a trader highlights of his time aerospace and why he won’t watch the movie Apollo 13. To find out more about Perry and his prodigious work go to: www.kaufmansignals.com
In this video want to calculate the value for a Simple Moving Average and output the value on the chart, so let’s find out how to do that with MQL5. Please click on the little button here or press F4 in Metatrader, 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: ”SimpleMovingAverage”, click on “Continue”, “Continue” and “Finish”. Now you can delete everything above the “OnTick” function and the two comment lines here. We start by creating an array for the Simple Moving Average (myMovingAverageArray) and you can think of an array like a raw of boxes that contain values. Let’s continue with the definition of the Moving Average (movingAverageDefinition), we use the integrated MQL5 function: “iMA”, if you highlight it and press F1 you will see that it needs a few parameters; the first parameter “_Symbol” is used to automatically find out what kind of symbol is used on the chart – in my case it’s the currency pair: Australian Dollar against Yen – the second parameter “_Period” contains the value of the time frame that is used on the current chart – I’m using the M1 chart for one minute candles right now – the third parameter is the number of candles that we are going to use to calculate the Moving Average, in our case we use 20 candles. When you put your mouse over the Moving Average you will see 20 in round braces behind the Moving Average behind here (Moving Average (20)) that stands for 20 candles. This parameter here is the starting point; we will start the calculation based on the current candle 0 (zero), we use “MODE_SMA” to calculate a Simple Moving Average and we use “PRICE_CLOSE” in the last parameter because we want to calculate the Moving Average values based on the close price. Now we use “CopyBuffer” to fill our Moving Average array (myMovingAverageArray) with data based on the Moving Average Definition (movingAverageDefinition) that we have created here, we start from candle 0 (zero), we do it for buffer 0 (zero) – that’s the red line here, the only Indicator line that we have for a Moving Average. The Bollinger Bands Indicator for example would have 3 lines, so that would be buffer 0 (zero), 1 or 2, we start with the current candle 0 (zero) and we copy the price data for three candles and store it in our array (myMovingAverageArray). To calculate the Moving Average for candle 1 – that’s the last complete candle that appears on the chart – we can use the value for candle 1 in our Moving Average array (myMovingAverageArray) and store it in a variable called: “myMovingAverage20”. Finally we want to use the “Comment” function to create an output on the chart, saying: “MyMovingAverage20:” followed by the value that we have calculated, that’s it so far. Now you can click on the “Compile” button or press F7 on your keyboard – I’m getting a warning here: “possible loss of data due to type conversion” because I am using a floating type (float), that means we have less digits behind the dot but for our simple example that should be enough – so when you are done and when you don’t have any errors, you can click on the little button here or press F4 to go back to Metatrader. In Metatrader we want to click on: “View/ Strategy Tester” or press CTRL and R, please pick the new file: ”SimpleMovingAverage.ex5”, mark the visualization option here and start a test. Now you should see the Moving Average, it’s the red line here on the chart and in the left upper corner we have the calculated value, so let’s have a look at the value for the Moving Average – remember we have calculated it for a candle 1 – in my case it is 83.4845, that’s exactly what we have here in our value and in this little video you have learned how to calculate the values for a Moving Average and how to create an output on the chart and you have done it with a few lines of MQL5 code. More MQL5 Tutorial Videos: MQL5 TUTORIAL BASICS - 19 HOW TO TRADE A SIMPLE MOVING AVERAGE In this video we are going to create a simple Expert Advisor that is going to trade this Moving Average. It’s a Moving Average for… MQL5 TUTORIAL - SIMPLE SHIFTED SMA EXPERT ADVISOR In this video we are going to create an Expert Advisor that is going to output buy or sell signals based on the SMA (Simple… MQL5 Tutorial - Simple Moving Average Robot with MQL5 If you have been trading for a while, chances are high that you have used or maybe you have seen a moving average. This is… MQL5 TUTORIAL - SIMPLE DOUBLE EXPONENTIAL MOVING AVERAGE In this video, we are going to trade the Double Exponential Moving Average (DEMA) that's basically a red line you see on your chart. If… MQL5 Tutorial - Simple Adaptive Moving Average Robot Okay, this time we are talking about an Adaptive Moving Average Indicator. It was created (I think) by Perry Kaufman and you can use it… MQL5 Tutorial - Simple Moving Average Crossover Robot with MQL5 Okay you have asked for it so here it is. A YouTube subscriber with the name Laurent ZB wanted me to create an Expert Advisor… MQL5 TUTORIAL - SIMPLE SIGNAL STACKING In this video I wanted to talk about something that I call: “Signal Stacking”; you see 4 lines here, each is a Moving Average for… MQL5 TUTORIAL - SIMPLE FRACTAL ADAPTIVE MOVING AVERAGE In this video we want to create an Expert Advisor for the Fractal Adaptive Moving Average Indicator. Whenever the blue line is below the candles… The post MQL5 TUTORIAL BASICS – 11 HOW TO CALCULATE A SIMPLE MOVING AVERAGE appeared first on MQL5 Tutorial.
Today I have a great pleasure to interview a true icon in the world of systematic trading. Ladies and gentlemen, today you can listen to my interview with Perry Kaufman!He began his career in the aerospace industry as a rocket scientist, and his work was used in the Apollo missions. He moved then to trading.His trading career began in 1971, in the futures market, and since the very beginning, he was involved in constructing algorithmic trading systems. He was working with the greatest CTAs and financial institutions.He’s an author of many highly acclaimed books. And in this episode, we talk about topics discussed in his latest work titled “A Guide to Creating A Successful Algorithmic Trading Strategy”.So, let’s start — I hope you will enjoy!
Today I have a great pleasure to interview a true icon in the world of systematic trading. Ladies and gentlemen, today you can listen to my interview with Perry Kaufman!He began his career in the aerospace industry as a rocket scientist, and his work was used in the Apollo missions. He moved then to trading.His trading career began in 1971, in the futures market, and since the very beginning, he was involved in constructing algorithmic trading systems. He was working with the greatest CTAs and financial institutions.He’s an author of many highly acclaimed books. And in this episode, we talk about topics discussed in his latest work titled “A Guide to Creating A Successful Algorithmic Trading Strategy”.So, let’s start — I hope you will enjoy!
Dziś mam ogromną przyjemność zaprezentować wywiad z prawdziwą ikoną tradingu opartego o algorytmy. Panie i Panowie, zapraszam do wysłuchania wywiadu z Perry Kafuman'em.Rozpoczął swoją karierę w przemyśle kosmicznym przy budowie rakiet. Jego praca była wykorzystana m.in. w programie Gemini i Apollo. Następnie swoją karierę pokierował w stronę tradingu.W 1971 roku zaczął handlować kontraktami terminowymi i od początku wykorzystywał do tego algorytmy budując systemy transakcyjne. Pracował z najlepszymi CTA w branży.Perry jest autorem wielu uznanych książek. W tym odcinku rozmawiamy m.in. o tematyce poruszonej w jego książce zatytułowanej "A Guide to Creating A Successful Algorithmic Trading Strategy".Strona odcinka: https://systemtrader.pl/009
Dziś mam ogromną przyjemność zaprezentować wywiad z prawdziwą ikoną tradingu opartego o algorytmy. Panie i Panowie, zapraszam do wysłuchania wywiadu z Perry Kafuman'em.Rozpoczął swoją karierę w przemyśle kosmicznym przy budowie rakiet. Jego praca była wykorzystana m.in. w programie Gemini i Apollo. Następnie swoją karierę pokierował w stronę tradingu.W 1971 roku zaczął handlować kontraktami terminowymi i od początku wykorzystywał do tego algorytmy budując systemy transakcyjne. Pracował z najlepszymi CTA w branży.Perry jest autorem wielu uznanych książek. W tym odcinku rozmawiamy m.in. o tematyce poruszonej w jego książce zatytułowanej "A Guide to Creating A Successful Algorithmic Trading Strategy".Strona odcinka: https://systemtrader.pl/009
Very experienced guys make great interviews. They bring age, perspective and wisdom to the table. Tom DeMark and Perry Kaufman are two men that have previously been on the podcast that exemplify this statement. Michael went back into the archives to bring these men and their interviews on the podcast today. Perry Kaufman is an American systematic trader, index developer, and quantitative financial theorist. He is considered a leading expert in the development of fully algorithmic trading programs. He currently is president of Kaufman Analytics. Tom DeMark is founder and CEO of DeMark Analytics and the creator of the DeMark Indicators. Tom considers himself a market timer and believes that fundamentals are critical; however, he and Michael still have a lot in common. His work is price and technically driven. In this episode of Trend Following Radio: Price movement Fundamentals Technical analysis behind the scenes Elliott wave The Fibonacci sequence Forecasting George Soros Michael Steinhardt Paul Tudor Jones Steve Cohen Computerizing indicators 100% algorithmic trading Systematic vs. Automated Optimization vs. Validation Tail events Discipline
It seems from the emails I’ve been getting lately that more and more traders are becoming concerned about the state of the markets, especially the stock markets, which is understandable. And the concern is really around what’s going to happen when the stockmarkets start falling. What could happen to their strategies and accounts and how can they prepare for it now? How can they protect their portfolios? One form of protection that often comes up is using diversification to reduce portfolio risk. However, a common question that is raised is how to actually go about diversifying? Is there more protection in diversifying across markets, or staying in the same market and diversifying across strategies? In this short piece of audio, Perry Kaufman discusses how he looks at diversification, and it’s something you may want to consider when you’re thinking about how to protect your own trading account and portfolio in a market downturn.
Today I want to share an optimization insight from Perry Kaufman. I was reading an article on a trading website and the author was making some assumptions based on the optimization results which may not have been entirely accurate. I think alot of traders can get caught up making this same assumption... I know I definitely have... And it's good to be reminded of these types of things so we don't make the same mistakes. Listen to Perry explaining what this assumption is, the danger in making it and how to overcome it.
One of the biggest challenges we face as traders is strategies that either fail or experience a reduction in performance over time. There are a number of possible causes for this, one obviously being changes in the market. In podcast Episode 10, Perry Kaufman discussed the change in the markets and how they've become noisier over time, with an increase in erratic movements up and down. This increase in market noise can have a huge impact on trading strategies and particular trading styles too and we're going to hear a little bit more about that from Perry today, including: How market noise has changed over time and what it means to different markets, How to measure the level of market noise, The impacts market noise has on particular trading styles and how to adjust strategies accordingly, and How this information can be used to our advantage to determine the type of strategy that suits a market. So lets take a listen to Perry.
I’m sure we all want to create trading strategies that perform better and last for longer but there are a number of issues we need to look out for when developing robust trading strategies, some are well-known and some perhaps aren't. In this episode we’ll be talking with Perry Kaufman about strategy development and more specifically some of the issues that can catch us out when creating trading strategies. Perry raises some interesting points about optimization that may not be well known plus he shares loads of tips to creating more robust strategies. Perry writes extensively on markets and strategies, having published fourteen books and has just released a new book on building algorithmic trading strategies, which we'll be discussing in this episode. He has worked and consulted to a number of successful CTA, investment and prop trading groups, creating systematic trading and hedging programs. This is also his 2nd appearance on the podcast, appearing as a guest way back in Episode 10. Topics discussed The most robust type of systems How your choice of optimization values could be misrepresenting your results and how to choose parameters that give a more accurate picture The mistakes traders make when analyzing optimization runs and tips to doing it properly How to really determine if a new trading rule is robust Reducing risk by using multiple parameters What the number of profitable runs in an optimization can tell you about the robustness of a strategy Why diversifying across strategies instead of across markets could be a better approach The challenges of building robust strategies using Genetic Algorithms and Neural Networks
In this episode, Perry Kaufman explains the difference between "hard" and "soft" science fiction and makes a couple recommendations (13:21), and Kristi Cates talks about books that readers of The Martian might also like (13:39). Plus, there's a new prize challenge. Perry's recommendations: Blindsight by Peter WattsRevelation Space by Alastair Reynolds Kristi's recommendations: The Mars Trilogy by Kim Stanley Robinson (Red Mars, Green Mars, Blue Mars)Packing For Mars by Mary RoachAlone In Antarctica by Felicity AstonAdrift: Seventy-Six Days Lost at Sea by Steven Callahan Please let us know what you think! You can email us at normalpl.org, or tweet us @NPLTweets.
Perry Kaufman discusses market noise, the impact it has on trading styles and how it can be used to determine which strategies suit a particular market. We also talk about price shocks and how to mitigate their effects, how to use volatility in your favour, volatility parity for position sizing, the information ratio for strategy performance and some strategy ideas you can test yourself. Topics discussed How market noise impacts trend following and mean reversion The effects of money flow during a crisis The types of strategies that work best in new markets and why How the efficiency ratio can be used to determine the best type of strategy for a market The best markets for trend following and mean reversion What strategy style to choose if you're just starting out Using Volatility Parity for position sizing Impacts and dangers of price shocks on backtesting and how to handle them Mitigating the risk of price shocks Using the Information Ratio to measure strategy performance and detect possible over-fitting The effects of volatility on strategies and how to use volatility in your favour Fractal Geometry High Frequency Trading And some strategy ideas you can test
My guest today is Perry Kaufman, an American systematic trader, index developer, and quantitative financial theorist. He is considered a leading expert in the development of fully algorithmic trading programs. The topic is systematic trading. In this episode of Trend Following Radio we discuss: How Kaufman came to the idea of 100% algorithmic trading systems The difference between being systematic and being automated Optimization vs. validation The biggest advantages of testing Why discretion is not part of Kaufman's toolbox The problem of tail events Why discipline is the most important characteristic of a systematic trader The “loose pants fit everyone” philosophy Preparing yourself for uncertainty Comparisons between risk management and risk measurement The Sharpe ratio High volatility trades vs. low volatility Why Kaufman places equal weight on both risk management and the underlying system Systematic trading in established mature markets vs. emerging markets Jump in! --- I'm MICHAEL COVEL, the host of TREND FOLLOWING RADIO, and I'm proud to have delivered 10+ million podcast listens since 2012. Investments, economics, psychology, politics, decision-making, human behavior, entrepreneurship and trend following are all passionately explored and debated on my show. To start? I'd like to give you a great piece of advice you can use in your life and trading journey… cut your losses! You will find much more about that philosophy here: https://www.trendfollowing.com/trend/ You can watch a free video here: https://www.trendfollowing.com/video/ Can't get enough of this episode? You can choose from my thousand plus episodes here: https://www.trendfollowing.com/podcast My social media platforms: Twitter: @covel Facebook: @trendfollowing LinkedIn: @covel Instagram: @mikecovel Hope you enjoy my never-ending podcast conversation!
Today on the podcast Michael Covel speaks with Perry Kaufman. Kaufman is an American systematic trader, index developer, and quantitative financial theorist. He is considered a leading expert in the development of fully algorithmic trading programs. Covel and Kaufman discuss how Kaufman came to the idea of 100% algorithmic trading systems; the difference between being systematic and being automated; optimization vs. validation; the biggest advantages of testing; why discretion is not part of Kaufman’s toolbox; the problem of tail events; why discipline is the most important characteristic of a systematic trader; the “loose pants fit everyone” philosophy; preparing yourself for uncertainty; comparisons between risk management and risk measurement; the Sharpe ratio; high volatility trades vs. low volatility; why Kaufman places equal weight on both risk management and the underlying system; and systematic trading in established mature markets vs. emerging markets. For more information on Perry Kaufman, visit Amphi Capital. Want a free trend following DVD? Go to trendfollowing.com/win.