Artwork

เนื้อหาจัดทำโดย MQL4 TUTORIAL เนื้อหาพอดแคสต์ทั้งหมด รวมถึงตอน กราฟิก และคำอธิบายพอดแคสต์ได้รับการอัปโหลดและจัดเตรียมโดย MQL4 TUTORIAL หรือพันธมิตรแพลตฟอร์มพอดแคสต์โดยตรง หากคุณเชื่อว่ามีบุคคลอื่นใช้งานที่มีลิขสิทธิ์ของคุณโดยไม่ได้รับอนุญาต คุณสามารถปฏิบัติตามขั้นตอนที่อธิบายไว้ที่นี่ https://th.player.fm/legal
Player FM - แอป Podcast
ออฟไลน์ด้วยแอป Player FM !

MQL4 TUTORIAL BASICS – 108 SIMPLE IOBVEA OSCILLATOR

6:41
 
แบ่งปัน
 

ซีรีส์ที่ถูกเก็บถาวร ("ฟีดที่ไม่ได้ใช้งาน" 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 293711919 series 1615247
เนื้อหาจัดทำโดย MQL4 TUTORIAL เนื้อหาพอดแคสต์ทั้งหมด รวมถึงตอน กราฟิก และคำอธิบายพอดแคสต์ได้รับการอัปโหลดและจัดเตรียมโดย MQL4 TUTORIAL หรือพันธมิตรแพลตฟอร์มพอดแคสต์โดยตรง หากคุณเชื่อว่ามีบุคคลอื่นใช้งานที่มีลิขสิทธิ์ของคุณโดยไม่ได้รับอนุญาต คุณสามารถปฏิบัติตามขั้นตอนที่อธิบายไว้ที่นี่ https://th.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 create buy or sell position based on oscillator values. 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. IOBVA. 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 string variable for the signal, but we are not going to assign a value now. Afterwards, we want to create an array for 100 items. This is a double array. Now let’s use a For loop to go through all the array items and we calculate the value for the array items by using the iOBV function. This will calculate the on balance volume indicator for the current symbol on the chart and the currently selected period on that chart. We use price underscore close for the current counter value and afterwards we are going to add the calculated value to our array.

That’s it for the For loop. Now we need to calculate some values. The first one is the current value for Candle zero. That is calculated by using iOBV for the current symbol on the chart and the currently selected period on that chart. We are using price underscore close.

And we want to calculate the value for Candle zero, that’s the current candle, afterwards, we need to calculate the candle number for the highest candle in our array. And we can do that by using array maximum for the array that we have created. We want to search the whole array starting from item number zero. That’s the first item in our array. And this function will get the number for the highest candle. Therefore, we repeat the whole thing and this time we use array minimum to get the number of the lowest candle, because once we know the number of the candle, we can calculate the value by simply looking into the number of the highest candle, we will get the maximum value.

And it is very similar to get the minimum value by looking into our array for the candle number that we have calculated here. So let’s check for the signal because of the current value for Candle zero is bigger or equal, the max value that we have calculated, we would consider that to be a buy signal and that’s when we assign the word buy to our signal. Otherwise, if the current value is below or equal, the minimum value that we have calculated, that would be a sell signal.

And that’s when we assign the word sell to our signal. And when our signal equals buy and OrdersTotal is zero, that would mean we have no open positions and a buy signal and that’s when we use Ordersend to buy 10 Microlot. In the other case when the signal equals sell and we also have no open orders, we use Ordersend and OP_SELL to sell 10 Microlot. Finally, we use the comment statement. This will create a chart output and it will output the current, the max, the min and the signal value.

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 series first or maybe even the Premium Course on our website might be interesting for you. That’s also where you can find links to source codes in case you don’t want to type everything. But for now, please click on the Compile button or 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 we use an empty chart and click on insert indicators, volumes, on balance volume. You can go with the default values here and click on OK, here is the oscillator. Now lets rightlick into the chart, select template, save template and we want to save it as tester.tpl.

You can override the current value because this is what we are going to see in the strategy tester. So let’s click on View, strategy tester or press Control and R. Please pick the new filedot Simple IOBVEA.EX4 mark the option for the visual mode here and start a test. Here we are. The Expert Advisor is calculating the current value and as soon as it is below the minimal value, here we see a sell trade on the chart. So our little Expert Advisor is working. And in this little video you have learned how you can create an Expert Advisor that is able to open buy and sell positions based on extreme values of an oscillator.

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 – 108 SIMPLE IOBVEA OSCILLATOR 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 293711919 series 1615247
เนื้อหาจัดทำโดย MQL4 TUTORIAL เนื้อหาพอดแคสต์ทั้งหมด รวมถึงตอน กราฟิก และคำอธิบายพอดแคสต์ได้รับการอัปโหลดและจัดเตรียมโดย MQL4 TUTORIAL หรือพันธมิตรแพลตฟอร์มพอดแคสต์โดยตรง หากคุณเชื่อว่ามีบุคคลอื่นใช้งานที่มีลิขสิทธิ์ของคุณโดยไม่ได้รับอนุญาต คุณสามารถปฏิบัติตามขั้นตอนที่อธิบายไว้ที่นี่ https://th.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 create buy or sell position based on oscillator values. 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. IOBVA. 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 string variable for the signal, but we are not going to assign a value now. Afterwards, we want to create an array for 100 items. This is a double array. Now let’s use a For loop to go through all the array items and we calculate the value for the array items by using the iOBV function. This will calculate the on balance volume indicator for the current symbol on the chart and the currently selected period on that chart. We use price underscore close for the current counter value and afterwards we are going to add the calculated value to our array.

That’s it for the For loop. Now we need to calculate some values. The first one is the current value for Candle zero. That is calculated by using iOBV for the current symbol on the chart and the currently selected period on that chart. We are using price underscore close.

And we want to calculate the value for Candle zero, that’s the current candle, afterwards, we need to calculate the candle number for the highest candle in our array. And we can do that by using array maximum for the array that we have created. We want to search the whole array starting from item number zero. That’s the first item in our array. And this function will get the number for the highest candle. Therefore, we repeat the whole thing and this time we use array minimum to get the number of the lowest candle, because once we know the number of the candle, we can calculate the value by simply looking into the number of the highest candle, we will get the maximum value.

And it is very similar to get the minimum value by looking into our array for the candle number that we have calculated here. So let’s check for the signal because of the current value for Candle zero is bigger or equal, the max value that we have calculated, we would consider that to be a buy signal and that’s when we assign the word buy to our signal. Otherwise, if the current value is below or equal, the minimum value that we have calculated, that would be a sell signal.

And that’s when we assign the word sell to our signal. And when our signal equals buy and OrdersTotal is zero, that would mean we have no open positions and a buy signal and that’s when we use Ordersend to buy 10 Microlot. In the other case when the signal equals sell and we also have no open orders, we use Ordersend and OP_SELL to sell 10 Microlot. Finally, we use the comment statement. This will create a chart output and it will output the current, the max, the min and the signal value.

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 series first or maybe even the Premium Course on our website might be interesting for you. That’s also where you can find links to source codes in case you don’t want to type everything. But for now, please click on the Compile button or 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 we use an empty chart and click on insert indicators, volumes, on balance volume. You can go with the default values here and click on OK, here is the oscillator. Now lets rightlick into the chart, select template, save template and we want to save it as tester.tpl.

You can override the current value because this is what we are going to see in the strategy tester. So let’s click on View, strategy tester or press Control and R. Please pick the new filedot Simple IOBVEA.EX4 mark the option for the visual mode here and start a test. Here we are. The Expert Advisor is calculating the current value and as soon as it is below the minimal value, here we see a sell trade on the chart. So our little Expert Advisor is working. And in this little video you have learned how you can create an Expert Advisor that is able to open buy and sell positions based on extreme values of an oscillator.

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 – 108 SIMPLE IOBVEA OSCILLATOR appeared first on MQL4TUTORIAL.COM.

  continue reading

32 ตอน

ทุกตอน

×
 
Loading …

ขอต้อนรับสู่ Player FM!

Player FM กำลังหาเว็บ

 

คู่มืออ้างอิงด่วน