How to create a Bulls Power EA with MQL5

video
play-sharp-fill

 

  • Introduction and Objective:
    • The tutorial is centered on creating an expert advisor that utilizes the Bulls Power indicator. This oscillator was designed to determine if the bulls or the bears dominate the forex market. The indicator peaks when the price is high, and a transition from below the line to above could indicate a potential price increase.
  • Initial Setup in MetaEditor:
    • Users are guided to open the MetaEditor by clicking on a specific icon or pressing the F4 key.
    • A new file is initiated within the MetaEditor, named “simple bulls power”.
  • Array Creation and Initialization:
    • An array, “price data”, is established to store price data for the last three candles.
    • The copyrates function is used to populate the array with price data.
  • Bulls Power Definition and Calculation:
    • The Bulls Power oscillator is defined using the built-in function. It calculates based on the last thirteen candles.
    • An array, “mypricearray”, is set up to store the Bulls Power values.
  • Signal Generation and Logic:
    • The expert advisor evaluates the Bulls Power values. When the indicator transitions from below the line to above, it could suggest that the price will rise.
    • The indicator’s value and its position relative to the price are displayed on the MetaTrader chart.
  • Testing and Visualization:
    • After coding, users are advised to compile the code.
    • The functionality is then tested in MetaTrader using the strategy tester, with visualization providing a real-time view of the expert advisor in action.
  • Conclusion and Further Learning:
    • The tutorial showcases the expert advisor’s capability to effectively trade based on the Bulls Power indicator in MQL5.
    • The Bulls Power oscillator was developed by Alexander Elder, known for his book “Trading for a Living”. It’s recommended to use the indicator in conjunction with a trend indicator like a moving average.

By following this tutorial, users can effectively create an expert advisor that trades based on the Bulls Power indicator, allowing for informed trading decisions based on the indicator’s signals.


Video Timestamps

  • 0:00 – Introduction to the Bulls Power indicator as an oscillator.
  • 0:30 – Indicator’s ability to determine if the Bulls are stronger than the Bears.
  • 1:00 – Significance of the indicator’s peak when the price is high.
  • 1:30 – Background on the Bulls Power oscillator’s development by Alexander Elder.
  • 2:00 – The indicator’s calculation based on the last 13 candles.
  • 2:30 – Integration of the Bulls Power and Bears Power indicators in MetaTrader 5.
  • 3:00 – Creation of an Expert Advisor for the Bulls Power indicator.
  • 3:30 – Setting up the Expert Advisor in MetaEditor.
  • 4:00 – Defining the properties of the Bulls Power and creating a price array.
  • 4:30 – Sorting the price array and filling it with data.
  • 5:00 – Retrieving the Bulls Power value for the current candle and displaying it on the chart.

Related Questions and Answers:

  1. What is the primary focus of the tutorial?
    • The tutorial is dedicated to creating an expert advisor in MQL5 that trades based on signals from the Bulls Power oscillator, which determines if bulls or bears dominate the forex market.
  2. How can users access the MetaEditor for coding?
    • Users can open the MetaEditor by clicking on a specific icon or pressing the F4 key.
  3. What is the purpose of the “simple bulls power” file in MetaEditor?
    • The “simple bulls power” file is initiated within the MetaEditor to code and develop the expert advisor that trades based on the Bulls Power oscillator signals.
  4. How is the array named “price data” utilized in the tutorial?
    • The “price data” array is designed to store price data for the last three candles. It is populated using the copyrates function.
  5. How is the Bulls Power oscillator defined and calculated in the tutorial?
    • The Bulls Power oscillator is defined using a built-in function and is calculated based on the last thirteen candles. An array named “mypricearray” is set up to store the Bulls Power values.
  6. How does the expert advisor generate trading signals based on the Bulls Power oscillator?
    • The expert advisor evaluates the Bulls Power values. When the indicator transitions from below the line to above, it could suggest a potential price increase. This signal and its position relative to the price are displayed on the MetaTrader chart.
  7. How are the results of the expert advisor displayed to the user?
    • The results, including the indicator’s value and its position relative to the price, are displayed directly on the MetaTrader chart.
  8. What steps should be taken after coding the expert advisor?
    • After coding, users should compile the code. The functionality is then tested in MetaTrader using the strategy tester, with a visual mode providing a real-time view of the expert advisor in action.
  9. Who developed the Bulls Power oscillator and how is it best used in trading?
    • The Bulls Power oscillator was developed by Alexander Elder, known for his book “Trading for a Living”. It’s recommended to use the indicator in conjunction with a trend indicator like a moving average.
  10. What can users achieve by following this tutorial?
  • By following this tutorial, users can effectively create an expert advisor that trades based on the Bulls Power oscillator, allowing for informed trading decisions based on the indicator’s signals.