Published on May 31, 2022

Popular full videos highly rated Bear Market, Trading Strong Trend, Buying Signals, and Ma Crossover EA, LEARN MQL5 TUTORIAL BASICS – 104 SIMPLE SELL CROSSOVER STOP LOSS.


With MQL5 for Metatrader5 we create an Expert Advisor that is able to open sell trades and close them based on a crossover of two moving averages.

In this video, we are going to create an Expert Advisor for a simple moving average crossover Sell Stop Loss. So let’s find out how to do that with MQL5. To get started please click on a 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 cross over Stop Loss.

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.mqh. This one is part of MQL5 and it will help us to use some simplified trading functions.

Therefore, we create an instance of the class Ctrade and call it trade. Inside of the ontick function we start by calculating the Ask price. That can be done by using symbolinfodouble for the current symbol on the chart, we are using symbol underscore ask and with normalize double and underscore digits we automatically calculate the right number of digits behind the dot. Now let’s repeat that for the Bid price. This is very similar. But to calculate the Bid price, we are going to use Simbol underscore bid. For the signal, we use a string variable.

This is called signal, but we don’t assign any values here because we are going to calculate that later.

Now, let’s create two arrays, one for the small moving average array and one for the big moving average array. The small moving average is defined by using the IMA function for the current symbol on a chart and the currently selected period on that chart. We are going to calculate it for twenty candles. The shift value is zero. We use ModeUnderscore SMA for simple moving average and the result should be calculated based on the close price. Let’s repeat that for the big moving average, this time we are going to use the same function, but for 50 candles, everything else is similar.

And with Copybuffer, we now can fill the small moving average array according to the definition that we have created here for buffer zero, starting from the current candle zero, we copy the values for three candles and store them in the small moving average array. Now let’s do the same for the big moving average array.

Once we have done that, we can now find out if the big moving average array for candle one is below the small moving average array for candle one. If that is the case, we consider that to be a buy signal, so we assign the word buy to our signal. In the other case, if the big moving average array for candle one is bigger than the small moving average array for candle one, that would be sell signal. And now we assign the word sell to our signal.

And if our signal equals buy and we have open positions, we are going to use a function that is called close all sell position this pair. Otherwise, if the signal equals sell and the return value for PositionsTotal equals zero, that would mean that we have no open position. So now we need to open a test position, that is done by using trade.Sell. We are opening a position for 10 Microlot. Please remember, this is just a test position. You wouldn’t do that on a real account.

And to see what’s going on, I would like to add a comment statement that will output the text the signal is now followed by the signal. That’s it for the main part, but to use this function, we need to create it. Now, the name of the function is close all sell position this power we are using void because we don’t need to return value. Now we need to use a For loop for all the positions and go through each and every position to get some details.

The first detail is the ticket number. We can get that by using position get ticket for the current counter value of the For loop. And we also need to get the currency pair for the position. That is done by using position get symbol for the current counter value. And as we only want to close sell position, we need to find out the position direction, that is done by using position get integer for the position type.

So let’s check if the position direction equals position type sell. That would mean we have a sell position. We also want to know if the current symbol on the chart is equal to the currency pair of the position. And if both conditions are true, we are going to close the current position. That is done by using trade dot buy position close for the current ticket number. Finally, we need to close the for loop and the function. And that’s about it.

Ma Crossover EA


How Finding Out Brand-New Rsi Principles Can Turn Your Trading Around Overnight

It is presented in a chart where all you have to do is to keep a keen eye on the very best entrance and exit points. The strongest signal is where the existing price goes through both the SMAs at a steep angle.

LEARN MQL5 TUTORIAL BASICS – 104 SIMPLE SELL CROSSOVER STOP LOSS, Search most searched complete videos relevant with Ma Crossover EA.

Trading Patterns – Understanding When To Enter And Exit

You just have to have patience and discipline. You must develop your own system of day trading. The bulk of third quarter profits were reported over the previous two weeks. Yesterdays SMA was approximately the cost points 1 – 8.

When in a while the technical indicators begin making news. Whether it’s the VIX, or a moving average, somebody gets the story and soon it’s on CNBC or Bloomberg as the news of the day. So, as a financier one needs to ask, “are technical indicators actually a factor to buy or offer?” In some aspects the response is no, since “investing” is something different from swing trading or day trading.

The time frame is short and is from 2 minutes to 5 minutes. The quickest scalping technique is tape reading where the Moving Average Trader reads the charts and puts a trade for a short time period. In this article is the concentrate on longer trades than the short tape reading technique.

“Again, I have actually drawn a swing chart over the price bars on this everyday chart. When you comprehend swing charts, you will be able to draw these lines in your mind and you will not require to draw them on your charts any more,” Peter said.

It’s appealing to begin trading at $10 or $20 a point simply to see how much money, albeit make-believe money, you can Forex MA Trading in as brief a time as possible. But that’s a mistake. Then you must treat your $10,000 of make-believe money as if it were genuine, if you’re to find out how to trade currencies successfully.

You’ve most likely heard the phrase that “booming Stocks MA Trading climb up a wall of concern” – well there doesn’t seem much of a wall of concern left anymore. A minimum of as far as the retail investor is concerned.

A 50-day moving average line takes 10 weeks of closing price information, and then plots the average. The line is recalculated everyday. This will reveal a stock’s price trend. It can be up, down, or sideways.

Stochastics is utilized to figure out whether the market is overbought or oversold. The marketplace is overbought when it reaches the resistance and it is oversold when it reaches the support. So when you are trading a variety, stochastics is the finest indication to tell you when it is overbought or oversold. It is also called a Momentum Indicator!

I know these ideas might sound basic. and they are. However you would be shocked the number of traders abandon a good trading system due to the fact that they feel they should have the ability to trade the system without any thought whatsoever. If you would only learn to sell the ideal direction and exit the trade with revenues. your look for a profitable Forex system would be over.

Buy-and-hold state TV commentators and newsletter publishers who’s clients already own the stock. It is effectively among the factors that the interest in trading Forex online has actually been increasing.

If you are looking best ever entertaining comparisons relevant with Ma Crossover EA, and Chinese Stocks, Range Trading please subscribe our email subscription DB now.

  • Leave a Reply

Enjoyed this video?
"No Thanks. Please Close This Box!"