MQL4 Tutorial Bootcamp2 - 8 Buy And Sell Module

4,799 بازدید
بیشتر
MQL4Tutorial
MQL4Tutorial
...
https://mql4tutorial.com/?s=expert

A Buy and Sell Module in MQL4

Okay, by now, we have created our first useful MQ4 module. And that was useful because now we are able to check any trend we like. But it’s even more useful if you can import pre-calculated modules. This one is already done and it’s called Open a Trade. It will check an integer value that is called direction, and if the direction is zero, it’s going to open a buy trade. In the other case, the direction is 1 and it’s going to sell.


After the trend is calculated in the main expert advisor, we will check if the trend is positive and if this is the case, we will call the function OpenTrade with a 0. Otherwise, we call the function OpenTrade with a 1. Let’s see if that works. Right now, in July of 2015, the Euro was going down, so we know it has to sell, here back into 13 the Euro, went up and it should buy and it did.

همه توضیحات ...