afsarfx replies to: MA dashboard indicator

MA Dashboard indicator

I wrote the attached indicator a few years ago. I’m not doing personal programming requests, hence it’s offered on a “take it or leave it” basis.

Attached File

File Type: ex4MA Dashboard.ex4   31 KB | 231 downloads | Uploaded Feb 5, 2018 4:39am

NOTE: This indicator was written using MetaEditor/compiler build 509. If you want the .mq4 source to compile/run without errors, you’ll need to do this first. Otherwise, download only the .ex4 file.

Attached File

File Type: mq4MA Dashboard.mq4   10 KB | 273 downloads | Uploaded Feb 5, 2018 4:39am

Attached Image (click to enlarge)

Click to Enlarge Name: PPI 363.png Size: 78 KB

ParameterFile: to keep things simple, leave this as NONE, and simply enter the settings into MT4’s dialog box as shown in the above screenshot.

However, advanced MT4 users might want to use a parameter file, which allows you to save your settings and then recall them for use on other charts (a bit like a MT4 template). The parameter file must be named Presets—MADash.xxx and exist in your …./MQL4/Files folder, where xxx (the file extension) matches the value you type into the ParameterFile setting. Thus you could have several sets of parameters, e.g. in files like Presets—MADash.GBP or Presets—MADash.M15, and then simply type GBP or M15 into the ParameterFile setting to choose the settings listed in the file of your choice.
Note: If this file doesn’t exist, then the indicator simply uses the settings you type into the dialog box.

Parameter files are maintained usiong a text editor like Windows’ Notepad. The data in the parameter files must exactly meet a certain format, explained in the section ‘Parameter File format’ at the end of this document. A sample file named Presets—MADash.TXT is included in the attached ZIP file. You can use this file as a model for creating parameter files (and then save the file as a different name). After saving the file, you must refresh the indicator (the easiest way is to switch to a different timeframe, and then back again), to force the indicator to read the modified settings, and recalc/replot the dashboard.

Currencies: all of the entered currencies will be paired against each other, to create the list that is displayed (dashboard rows)

CurrencySuffix: this will be attached to each currency pair, e.g. if you type pro, symbol names will be GBPUSDpro, EURUSDpro, etc

TimeFrames: determines the dashboard columns, in the order you want them displayed

MAParameters: five entries separated by commas:
1. MA period
2. MA shift
3. MA method: 0=simple (SMA), 1=exponential (EMA), 2=smoothed, 3=linear weighted
4. Applied price: 0=close, 1=open, 2=high, 3=low, 4=median (H+L)/2, 5=typical (H+L+C)/3, 6=weighted (H+L+C+C)/4
5. Shift

FontNameSizeColor: used for the column/row labels, three entries separated by commas:
1. Must be the valid name of an installed Windows font
2. Font size
3. Font color: must be either a valid MT4 color token (e.g. Red, LimeGreen, DodgerBlue, Goldenrod, etc) or RnGnBn (e.g. R30B0G255 for red=30, blue=0, green=255)

WindingsSymbol: used to plot the symbols in the body of the dashboard, see the table below:

Attached Image (click to enlarge)

Click to Enlarge Name: PPI 364.png Size: 365 KB

BullishColor: symbol will be plotted using this color, if price is above the MA
BearishColor: symbol will be plotted using this color, if price is below the MA

PositionSettings: seven entries separated by commas:
1. Subwindow number: 0=main chart window, 1=next lower subwindow (must already exist), etc
2. Corner: TL=top left, TR=top right, BL=bottom left, BR=bottom right
3. Starting horizontal position
4. Horizontal adjustment (space between label and first symbol in the row)
5. Horizontal spacing (between symbols)
6. Vertical starting position
7. Vertical spacing (between rows)

Visibility: which chart TFs you want the indicator to display on

RefreshPeriod: This controls how often the files are to be output (overwritten) with fresh data:
+0 means on the first price tick of a new candle on the current chart
+1 means on the first price tick of a new candle on the next higher TF
+2 means on the first price tick of a new candle two TFs higher
-1 means on the first price tick of a new candle on the next lower TF
etc; or
T means on every new price tick
I means perform once only, i.e. on init()
M1 means on the first price tick of the each new M1 candle
M5 means on the first price tick of the each new M5 candle
etc

Everything else should hopefully be self-explanatory. I haven’t used the indicator for many years, hence I can’t remember how it works, but feel welcome to experiment.

Parameter Files format

Every line in the file, even blank lines or comment lines, must end with a semicolon (; ). Failure to do so will cause unpredictable results.

Any line that starts with two slashes (//) is a comment line, and its content will be ignored by the indicator. This allows you to write notes, or have several different values for a setting, and then switch between them by simply ‘commenting’ those you want disabled, and ‘uncommenting’ the one you want to enable. If two or more uncommented (enabled) lines for the same setting exist, the last one in the file will be effective.

The format for a line is
setting_name = value;
where setting_name is a correctly spelled name for the parameter setting (see the sample file Presets—MADash.TXT for examples), and value is the value you wish to assign to the setting. setting_name may be any combination of upper/lowercase, and have embedded spaces or underscore characters to improve readability, but apart from this it must be spelled exactly the same as the ‘Variable’ name in MT4’s dialog box.
Text (string) values should be enclosed in double quotes:
setting_name = “value”;
If a setting is either disabled or omitted, the value typed into the corresponding setting in MT4’s dialog box will be used.

Don’t forget to save the file, and then refresh the indicator, for any changes to take effect.

Here is the content of the sample file Presets—MADash.TXT — please feel welcome to copy/paste sections of it, however you wish:

Inserted Code

 Currencies = "AUD,CAD,CHF,EUR,GBP,JPY,NZD,USD"; CurrencySuffix = ""; TimeFrames = "MN,W1,D1,H4,H1,M30,M15,M5,M1";
// period, ma_shift, ma_method, applied_price, shift; MAParameters = "20,0,1,0,0"; FontNameSizeColor = "Comic Sans MS,13,White"; WingdingsSymbol = 110; BullishColor = LimeGreen; BearishColor = Red;
// Window, Corner, HorizPos, HorizAdjust, HorizSpacing, VertPos, VertSpacing; PositionSettings = "0,TR,30,120,45,14,20"; RefreshPeriod = "+0";

Attached File

File Type: txtPresets—MADash.TXT   < 1 KB | 114 downloads | Uploaded Feb 5, 2018 4:41am

Terms and Conditions

 All code is supplied FREE of charge. It may NOT be sold or distributed commercially.

 Software is offered on an ‘as is’ basis. I’m not offering a programming or troubleshooting service; source code has been posted if you want to modify it yourself (but see the note in red typeface above).

 There is no guarantee that the software is fit for purpose, or free of errors. Download and use the indicator(s) at your own risk; I accept no liability for any computer damage or financial losses.

Leave a Reply

Your email address will not be published. Required fields are marked *