Something Interesting in Financial Video - page 33

You are missing trading opportunities:
- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Forum on trading, automated trading systems and testing trading strategies
Programming tutorials
MetaQuotes, 2023.05.24 16:54
Moving Average Crossover EA mql5 Programming
Moving Average Crossover EA mql5 Programming
Hi, this is Toby, and in today's video, I'll show you how to code a simple moving average crossover expert advisor for MetaTrader 5. Let's get started.
First, let's define what we want the expert advisor to do. We want the EA to open a buy position when the fast moving average (blue line) crosses above the slow moving average (red line) and open a sell position when the fast moving average crosses below the slow moving average. We'll also add a stop loss and take profit to the EA, as well as input variables for the periods of the moving averages.
To begin coding, open the MetaEditor in MetaTrader 5. Create a new expert advisor using the template and name it "Moving Average." Clean up the code by removing unnecessary lines and comments. Next, add input variables for the periods of the fast and slow moving averages. Set default values for these variables and display them in the input tab of the EA settings.
Check the user input in the OnInit function to ensure valid values are entered. If the input is invalid (zero or negative), display an alert message and stop the EA. Create handles for the fast and slow moving averages using the ma function. Set the symbol, period, and input variables for each moving average. Check if the creation of handles is successful. If not, display an alert message and stop the EA. Create global variables for storing the indicator values. Use dynamic arrays for the fast and slow buffers. In the OnTick function, copy the latest indicator values into the buffers and check if enough data is available. If not, return and display an alert message.
Print the indicator values on the screen to verify if everything is working correctly. Use the Comment function to display the values of the fast and slow moving averages.
In the Strategy Tester, test the EA to check if the indicator values are displayed correctly. Now, we can check for a crossover of the moving averages. If the fast moving average is below the slow moving average at bar 1 and above the slow moving average at bar 0, we have a crossover. Open a buy position in this case.
To open positions, use the CTrade class. Define a trade variable and proceed with the necessary actions. Compile the code and test the EA in the Strategy Tester to verify if the crossover condition is working correctly and positions are opened accordingly.
That's it for coding the moving average crossover expert advisor in MetaTrader 5. And then we can use the trade.Buy function to open a buy position. We specify the volume of the position, which can be a fixed value or based on your risk management strategy. For now, let's use a fixed volume of 0.1 lots. Now we need to add a condition to check for a sell position. If the fast moving average is above the slow moving average for bar 1 and below for the current bar, we have a crossover in the opposite direction. In this case, we want to open a sell position. We can use the trade.Sell function to do that.
Finally, we can add a stop loss and take profit to our positions. We'll use the trade.SetStopLoss and trade.SetTakeProfit functions. Let's set a stop loss of 100 pips and take profit of 200 pips for this example. Now we have a complete code for our simple moving average crossover expert advisor. We can compile it and test it in the MetaTrader 5 platform.
Once you have compiled the code without any errors, you can save the expert advisor and use it in MetaTrader 5. Remember to backtest and optimize your expert advisor before using it with real money.
Forum on trading, automated trading systems and testing trading strategies
Quantitative trading
MetaQuotes, 2023.05.12 14:25
Basics of Quantitative Trading
Basics of Quantitative Trading
In this video on the basics of quantitative trading, algorithmic trader Shaun Overton discusses the challenges and opportunities involved in algorithmic trading. Overton explains that data collection, analysis, and trading are the three simple problems involved in algorithmic trading, though the process can get complicated due to finding high-quality data and proper analysis. It can be challenging to select the right platform with good data and features to meet the trader's goals, with the most popular platforms being MetaTrader, NinjaTrader, and TradeStation, depending on the trading type one prefers. Overton also discusses the harsh reality of how easy it is to blow up accounts when trading in the live market, and how important it is to manage risk. Additionally, he explains how quantitative traders can predict overextended moves in the market and discusses the impact of currency wars.
The "Basics of Quantitative Trading" video on YouTube covers various strategies for algorithmic trading, including sentiment analysis and long-term strategies based on chart lines; however, the biggest returns are made during big tail events and trends. Attendees of the video discuss different platforms for backtesting, challenges of integrating multiple platforms for trading analysis, and the increasing interest in formalizing and automating trading strategies. Some long-term traders seek automation as they have been in the game for a long time, and NinjaTrader for programming languages is recommended but has limitations.
Doji Candlestick Chart Pattern
The Doji is a important Candlestick formation, signalling indecision between bulls and bears. A Doji is formed when the opening price and the closing price are equal. In a Doji chart pattern, the stock market moves up and down during the trading session, but cannot commit either way.
Forum on trading, automated trading systems and testing trading strategies
Something Interesting
Sergey Golubev, 2023.08.10 06:46
Trading strategy based on the improved Doji candlestick pattern recognition indicator - the article
The article "Improved candlestick pattern recognition illustrated by the example of Doji" dealt with the concept of metabars. In short, a metabar is a conditional combination of several consecutive bars into a large one. This is similar to a bar of a higher timeframe, but not exactly, since the size of the metabar is not fixed (it "floats" in a given range) and there is no binding to a specific start and end time of the bar. Therefore, the use of metabars allows traders to detect various patterns of candlestick analysis much more often.
How to Trade Spinning Tops and Doji Candlestick Patterns
In our last lesson we learned how different candlestick formations can tell us different things about whether the buyers or the sellers won out in a particular time period. In today's lesson we are going to look at some of the basic candlestick patterns and what they mean when looked at in the context of recent price action in the market.
The Spinning Top
When a candlestick with a short body in the middle of two long wicks forms in the market this is indicative of a situation where neither the buyers nor the sellers have won for that time period as the market has closed relatively unchanged from where it opened. The upper and lower long wicks however tell us that both the buyers and the sellers had the upper hand at some point during the time period the candle represents. When you see this type of candlestick form after a runup or run down in the market it can be an indication of a pending reversal as the indescision in the market is representative of the buyers loosing momentum when this occurs after an uptrend and the sellers loosing momentum after a downtrend.
The Doji
Like the Spinning Top the Doji Represents indecision in the market but is normally considered a stronger signal because unlike the spinning top the open and the close that form the Doji Candle are at the same level. If a Doji forms in sideways market action this is not significant as the sideways market action is already indicative of indecision in the market. If the Doji forms in an uptrend or downtrend this is normally seen as significant as this is a signal that the buyers are loosing conviction when formed in an uptrend and a signal that sellers are loosing conviction if seen in a downtrend. Most traders will place greater significance on the Doji when it forms in a market that is in overbought or oversold territory.
The Bullish Engulfing Pattern
The Bullish Engulfing pattern is another candlestick formation which represents a potential reversal in the market when seen in a downtrend. The pattern is made up of a white and black candle where the latest candle (the white candle) opens lower than the previous candle's (the black candle) close and closes higher than the previous candle's open. When this happens the current period's white candle completely engulfs the previous period's black candle.
When thinking about this from a buyer/seller perspective, you can understand that the long body of the current candle engulfing completely the body of the previous candle to the upside is representative that the buyers have not only taken control but have taken control with force. When this white engulfing candle occurs after a small black candle the formation is given even more significance as the small black candle is already indicative of a trend that is running low on steam.