• Home
  • Free MQL4 Course
  • MQL4 Forums
Forex Mentor Pro
  • Free MQL4 Course
  • MQL4 Made Easy
  • MQL4 Programming
  • Expert Advisors
  • Articles

MQL4 Programming 8

How to Create a Simple Toggle Button in MQL4

Recently I started using an indicator that had been written by another programmer and initially it was doing a pretty good job. However,eventually I started getting annoyed with one particular implementation...

...or rather lack of implementation.

The indicator itself was a pretty simple affair and in essence all it did was to draw a series of lines starting from a predefined point. I'd drop the indicator on the chart, drag the zero line and the rest of the lines would be redrawn automatically, relative to it's position.

The problem came when I wanted to change the orientation of the lines and make the zero line the top rather than the bottom. The way the original programmer had coded it meant that the user would have to go into the settings, scroll down the list, identify the correct setting and change it from true to false.

Now instead of drawing the lines from zero upwards, it would draw them from zero downwards.

What a long winded way to accomplish a simple task!

So I decided it would be much simpler - and cooler - to have a button on the chart that would toggle the settings state from true to false. That way I wouldn't have to mess around with settings and instead could change the value by the click of a button.

Sounds pretty sweet right?

Well here's how you can do it too... (more…)

August 30, 2015 MQL4 Programming button, mql4, toggle

Improved Input Settings in MQL4 – Part 2

mql4 has easier inputs

In my last article about improved input settings in mql4 I told you about enumerations and how they allow you to utilize drop down menus in your EA's settings. That was certainly a great improvement to the way settings are handled in MQL4 but there's another feature that you should be using.

If you're familiar with the original style of MQL4 coding you've probably used 'extern' variables to facilitate input from users. Since build 600 of MetaTrader 4 there's a new kid on the block.

Input variables or settings can now be declared as either 'extern' or 'input' and the difference between the two is pretty straight forward. (more…)

July 28, 2014 6 Comments MQL4 Programming build 600, extern, input, mql4

How to Install MQL4 Experts Advisors, Indicators and Scripts

Build 600 of MetaTrader 4 was a huge leap forward and has offered a great deal of improvements and benefits to the MQL4 coder, but it comes at a price.

Many users are confused initially and have a hard time navigating around the new interface and finding exactly where to install their expert advisors, indicators and scripts.

The folder structure of previous versions of MT4 was much more intuitive and followed the familiar pattern of C:\Program Files\MT4 etc. With Build 600 that  was all changed and the folder structure is slightly more complicated but if you know how to navigate it, it's  almost just as simple. (more…)

July 19, 2014 MQL4 Programming expert advisor, indicators, mql4, mt4, scripts
Older posts
Start Learning MQL4 Today!
Recent Posts
  • Instantly Save Yourself $200
  • How to Create a Simple Toggle Button in MQL4
  • Does The Perfect EA Really Exist?
  • Improved Input Settings in MQL4 – Part 2
  • How to Install MQL4 Experts Advisors, Indicators and Scripts
Recent Comments
  • Steve Fleming on Free Tool to Help With Pair Trading
  • Pedro Paredinha on Free Tool to Help With Pair Trading
  • shelton colds jr on R.E.A.D – A Simple Template Approach to Coding in MQL4
  • Steve Fleming on Improved Input Settings in MQL4 – Part 2
  • Dulcy Tsosie on Improved Input Settings in MQL4 – Part 2
Tags
mql4expert advisorsbuild 600metatraderforexexpert advisortutorialarraymarketplaceautomated trading software
GPS Forex Robot
MQL4 Programming

Learning to code in MQL4 can seem difficult at first but once you get the hang of it you'll find it quite easy. The best way to get started is with a free course and you'll find a great one [...]

| 6 Comments Learn More
Testimonials
Working with Steve has really cleared the fog for me as it relates to writing my own EA’s. I had no prior code writing experience. Prior to working with Steve, I had bought every book available on MQL, read lots of blogs and downloaded pdf lessons. But, none of these resources could answer any of my questions. Working with Steve has given me a much broader understanding of how to write code. He not only teaches you how to write an EA, but explains the best coding practices so you are writing cod… Read more
MichaelIdaho
After extensively researching around for a coach to fast-track my ability to code Expert Advisors, I came across Steve Fleming. Right from the beginning I found Steve to be very helpful and motivating, within five weeks of coaching I am coding my first EA. Programming is just like any other skill in life, it takes time to learn and I know without a coach like Steve, it would have taken me months to learn MQL. Most importantly what I found in Steve is someone who wants to see you succeed as a … Read more
DeonBrisbane
I came to Steve with the aim of learning how to write expert advisors. With his great teaching style and structured course I have been able to learn an enormous amount and have been able to write a number of expert advisors myself. As I develop various systems and sometimes come across issues Steve is always a great source of help. I look forward to developing more expert advisors and using Steve as a mentor as and when required.
AlanSingapore
Market Hours
© Automated Trading Software  2008 - 
Contact |  Sitemap |  Risk Warning |  Privacy |  T & C