Artwork

תוכן מסופק על ידי MQL4 TUTORIAL. כל תוכן הפודקאסטים כולל פרקים, גרפיקה ותיאורי פודקאסטים מועלים ומסופקים ישירות על ידי MQL4 TUTORIAL או שותף פלטפורמת הפודקאסט שלו. אם אתה מאמין שמישהו משתמש ביצירה שלך המוגנת בזכויות יוצרים ללא רשותך, אתה יכול לעקוב אחר התהליך המתואר כאן https://he.player.fm/legal.
Player FM - אפליקציית פודקאסט
התחל במצב לא מקוון עם האפליקציה Player FM !

MQL4 TUTORIAL BASICS – 103 SIMPLE BUY GRID SYSTEM

5:36
 
שתפו
 

סדרה בארכיון ("עדכון לא פעיל" status)

When? This feed was archived on December 18, 2021 00:33 (2+ y ago). Last successful fetch was on October 24, 2021 04:05 (2+ y ago)

Why? עדכון לא פעיל status. השרתים שלנו לא הצליחו לאחזר פודקאסט חוקי לזמן ממושך.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 290782690 series 1615247
תוכן מסופק על ידי MQL4 TUTORIAL. כל תוכן הפודקאסטים כולל פרקים, גרפיקה ותיאורי פודקאסטים מועלים ומסופקים ישירות על ידי MQL4 TUTORIAL או שותף פלטפורמת הפודקאסט שלו. אם אתה מאמין שמישהו משתמש ביצירה שלך המוגנת בזכויות יוצרים ללא רשותך, אתה יכול לעקוב אחר התהליך המתואר כאן https://he.player.fm/legal.

[This post contains video, click to play]

In this video, we are going to create an Expert Advisor that is able to set buy prices as a grid system when we have an uprising trend. 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 Metaeditor window. And here you want to click on file, new file, Expert Advisor from Template, continue. I will call this file simple buy grid system.

Click on Continue, continue and finish.

Now you can delete everything above the ontick function. And let’s also delete the two comment lines here, we start by creating a global variable called signal. This is a string variable so it can hold text values, but we don’t assign any values here because we are going to calculate that later. Inside of the ontick function we want to create a static variable. Static is a modifier that will exist during the whole lifetime of the MQL4 program. We use double because we need floating types.

And the name of the variable is next buy price, we are going to use it to set the next buy price level for the grid system and we want to check if OrdersTotal equals zero. That would be the case when we have no open positions. In that case, we set the buy price to zero. Afterwards we want to call a function that is called check entry signal. This function doesn’t exist so far. We need to create it later. And that will check if we have a buy or a sell signal, one of the conditions to open a buy trade would be if the Ask price is above or equal to the next buy price.

The second condition is that we want to check if the signal equals buy and if both conditions are true, we are using Ordersend to open a buy trade for 10 Microlot and we also want to set the next buy price level. So now we are going to calculate the next buy price buy using the current Ask price and adding 30 points. Let’s add a comment statement. That will output the current Ask price and the next buy price directly on our chart. This function doesn’t exist so far, so we need to create it now. The name of the function will be check entry signal. It’s a string function. That means it will return a string value. We use a very simple way to find out if we want to buy or sell. In our case, we want to check if the last candle is bullish. That would be the case when the close price for candle one is bigger than the open price for candle one. If that is true, we assign the word buy to our signal.

In the other case, when the close price for candle one is below the open price for candle one, that would be a sell signal. And now we assign the word sell to our signal. Finally, we want to return the signal to the main module 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 you want to buy the Premium Course, you can find that one on our website. This was actually suggested buy a Premium Course member. And if you are already a premium member and have an idea for such a video, please let me know. For now, we want to click on the Compile button or press F7. I don’t have any errors here. And if that is the case, we can click on a little button here or press F4 to go back to Metatrader.

And in Metatrader we want to click on View, Strategy tester or press Control and R. Please pick the new file simple buy grid system dot EX4, mark the option for the visual mode here. And start your test. Here we are. The Expert Advisor is running and once we see a rising trend, we should see additional positions. That happened right now, so our little Expert Advisor works as expected, and in this little video, you have learned how to create a simple buy grid system and you have coded it yourself with a few lines of MQL4 code.


Not sure what to do? Click on the automated trading assistant below

The post MQL4 TUTORIAL BASICS – 103 SIMPLE BUY GRID SYSTEM appeared first on MQL4TUTORIAL.COM.

  continue reading

32 פרקים

Artwork
iconשתפו
 

סדרה בארכיון ("עדכון לא פעיל" status)

When? This feed was archived on December 18, 2021 00:33 (2+ y ago). Last successful fetch was on October 24, 2021 04:05 (2+ y ago)

Why? עדכון לא פעיל status. השרתים שלנו לא הצליחו לאחזר פודקאסט חוקי לזמן ממושך.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 290782690 series 1615247
תוכן מסופק על ידי MQL4 TUTORIAL. כל תוכן הפודקאסטים כולל פרקים, גרפיקה ותיאורי פודקאסטים מועלים ומסופקים ישירות על ידי MQL4 TUTORIAL או שותף פלטפורמת הפודקאסט שלו. אם אתה מאמין שמישהו משתמש ביצירה שלך המוגנת בזכויות יוצרים ללא רשותך, אתה יכול לעקוב אחר התהליך המתואר כאן https://he.player.fm/legal.

[This post contains video, click to play]

In this video, we are going to create an Expert Advisor that is able to set buy prices as a grid system when we have an uprising trend. 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 Metaeditor window. And here you want to click on file, new file, Expert Advisor from Template, continue. I will call this file simple buy grid system.

Click on Continue, continue and finish.

Now you can delete everything above the ontick function. And let’s also delete the two comment lines here, we start by creating a global variable called signal. This is a string variable so it can hold text values, but we don’t assign any values here because we are going to calculate that later. Inside of the ontick function we want to create a static variable. Static is a modifier that will exist during the whole lifetime of the MQL4 program. We use double because we need floating types.

And the name of the variable is next buy price, we are going to use it to set the next buy price level for the grid system and we want to check if OrdersTotal equals zero. That would be the case when we have no open positions. In that case, we set the buy price to zero. Afterwards we want to call a function that is called check entry signal. This function doesn’t exist so far. We need to create it later. And that will check if we have a buy or a sell signal, one of the conditions to open a buy trade would be if the Ask price is above or equal to the next buy price.

The second condition is that we want to check if the signal equals buy and if both conditions are true, we are using Ordersend to open a buy trade for 10 Microlot and we also want to set the next buy price level. So now we are going to calculate the next buy price buy using the current Ask price and adding 30 points. Let’s add a comment statement. That will output the current Ask price and the next buy price directly on our chart. This function doesn’t exist so far, so we need to create it now. The name of the function will be check entry signal. It’s a string function. That means it will return a string value. We use a very simple way to find out if we want to buy or sell. In our case, we want to check if the last candle is bullish. That would be the case when the close price for candle one is bigger than the open price for candle one. If that is true, we assign the word buy to our signal.

In the other case, when the close price for candle one is below the open price for candle one, that would be a sell signal. And now we assign the word sell to our signal. Finally, we want to return the signal to the main module 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 you want to buy the Premium Course, you can find that one on our website. This was actually suggested buy a Premium Course member. And if you are already a premium member and have an idea for such a video, please let me know. For now, we want to click on the Compile button or press F7. I don’t have any errors here. And if that is the case, we can click on a little button here or press F4 to go back to Metatrader.

And in Metatrader we want to click on View, Strategy tester or press Control and R. Please pick the new file simple buy grid system dot EX4, mark the option for the visual mode here. And start your test. Here we are. The Expert Advisor is running and once we see a rising trend, we should see additional positions. That happened right now, so our little Expert Advisor works as expected, and in this little video, you have learned how to create a simple buy grid system and you have coded it yourself with a few lines of MQL4 code.


Not sure what to do? Click on the automated trading assistant below

The post MQL4 TUTORIAL BASICS – 103 SIMPLE BUY GRID SYSTEM appeared first on MQL4TUTORIAL.COM.

  continue reading

32 פרקים

כל הפרקים

×
 
Loading …

ברוכים הבאים אל Player FM!

Player FM סורק את האינטרנט עבור פודקאסטים באיכות גבוהה בשבילכם כדי שתהנו מהם כרגע. זה יישום הפודקאסט הטוב ביותר והוא עובד על אנדרואיד, iPhone ואינטרנט. הירשמו לסנכרון מנויים במכשירים שונים.

 

מדריך עזר מהיר