The default font used for the Comment("some text") function is not not a fixed-width (aka monotype) and it is often too small.
How can I change the default font used for Comment()?
Q : How can I change the default font used for Comment()?
Having used MQL4 since 2007+ there is, so far, no way to change a font used for Comment() (or the graph Time-/Price-axes).
As #Daniel has remarked, there are some chances to build tools to circumvent this trouble.
I have used a similarly motivated Comment()-based approach for a text-editor, for a (row,col)-addressable text-screen ( still inside a Comment()-text-block ), for an independent overlay with a (row,col,font,color)-text-screen and last, but not least, years ago I started to use a distributed-computing approach, so as not to remain blocked with the absence of screen-controls for the text-part of the GUI ( having a freedom of using several independent graphical views ( multi-time-frame views, views with AI/ML-analytical post-processing graphing and many others ).
Using the Terminal-GUI for a default look-and-feel is accompanied with any number of "remote"-screens ( implemented in python and other, non-MQL4, domain languages, some HPC-languages on remote computers ) that are used in-sync with the flow of MQL4-processed events.
This is the safest way to work with text-and-graphs in a user-controlled manner.
To the best of my belief, there is no way to change font type and size of the Comment() function. If they are too small for you - you have to draw Labels on the chart yourself(even though it might be a bit inconvenient to parse the text looking for "\n" objects in order to go next line).
If you are happy to change the default font for everything (not just comments) you can modify
#define CONTROLS_FONT_NAME "Tahoma"
#define CONTROLS_FONT_SIZE (8)//changed from 12
in the defines.mqh file.
Related
In MetaTrader 4 the styles (e.g. arrows or lines) that are used in an indicator are not chart objects. ObjectsTotal() returns 0. Of course I can read this out via iCustom(). But what, if the EA should react to all indicators with such symbols. So without knowing the number of buffers and/or the settings of the indicator. Is there a way to automatically search for such indicator styles in the chart and use them? Or to automatically recognize the styles used and the associated buffers in an indicator?
Q : "Is there a way to automatically search for such indicator styles in the chart and use them?"
No, there is not.
As of 2020-10, having spent 13+ years with MetaTrader4 trading automation projects, there is no support for such an automated feature re-discovery.
The code-units of Custom Indicator type hard-code the composition of Indicator Buffers (having external access-method via an iCustom() procedural interface) and GUI-style properties, not accessible at all by the user-level MQL4-{ Script | EA | Custom Indicator }-code.
If this were changed in the future releases of MetaTrader4/5 terminal, you would find details inside the documentation.
maybe not exactly what u want but a oppurtunity
double ObjectGet(
string object_name, // object name
int index // object property
);
If a technical indicator works very slow, and I wish to include it in an EA ( using iCustom() ), is there a some "wrapper" that could cache the indicator results to a file based on the particular indicator inputs?
This way I could get a better speed next time when I backtest it using the same set of parameters, since the "wrapper" could read the result from file rather than recalculate the result from the indicator.
I heard that some developers did that for their needs in order to speed up backtesting, but as far as i know, there's no publicly available solution.
If I had to solve this problem, I would create a class with two fields (datetime and indicator value, or N buffers of the indicator), and a collection class similar to CArrayObj.mqh but with an option to apply binary search, or to start looking for element from a specific index, not from the very beginning of the array.
Recent MT4 Builds added VERY restrictive conditions for Indicators
In early years of MT4, this was not so cruel as it is these days.
FACT#1: fileIO is 10.000x ~ 100.000x slower than memIO:
This means, there is no benefit from "pre-caching" values to disk.
FACT#2: Processing Performance has HARD CEILING:
All, yes ALL, Custom Indicators, that are being used in MetaTrader4 Terminal ( be it directly in GUI, or indirectly, via Template(s) or called via iCustom() calls & in Strategy Tester via .tpl + iCustom() ) ALL THESE SHARE A SINGLE THREAD ...
FACT#3: Strategy Tester has the most demanding needs for speed:
Thus - eliminate all, indeed ALL, non-core indicators from tester.tpl template and save it as "blank", to avoid any part of such non-core processing.
Next, re-design the Custom Indicator, where possible, so as to avoid any CPU-ops & MEM-allocation(s), that are not necessary.
I remember a Custom Indicatore designs with indeed deep-convolutions, which could have been re-engineered so as to keep just a triangular sparse-matrix with necessary updates, that has increased the speed of Indicator processing more than 10.000x, so code-revision is the way.
So, rather run a separate MetaTrader4 Terminal, just for BackTesting, than having to wait for many hours just due to un-compressible nature of numerical processing under a traffic-jam congestion in the shared use of the CustomIndicator-solo-Thread that none scheduling could improve.
FACT#4: O/S can increase a process priority:
Having got to the Devil's zone, it is a common practice to spin-up the PRIO for the StrategyTester MT4, up to the "RealTime PRIO" in the O/S tools.
One may even additionally "lock" this MT4-process onto a certain CPU-core(s) and setup all other processes with adjacent CPU-core-AFFINITY, so that these two distinct groups of processes do not jump one to the other group's CPU-core(s). Hard, but if squeezing the performance to the bleeding edge, this is a must.
In SPSS, when defining the measure of a variable, the usual options are "Scale", "Ordinal", and "Nominal" (see image).
However, when using actual dialog boxes to do analyses, SPSS will often ask us to describe whether the data are "Continuous" or "Categorical". E.g., I was watching this video by James Gaskin (a great YouTube teacher by the way), and saw this dialog box (image below).
My Question: In the second image, you can see that the narrator put some "Ordinal" variables in the "Continuous" box. Is it okay to do that? How come?
For most procedures, the treatment of a variable is determined by how you use it. The measurement level is just a reminder, so you can treat a variable however it makes sense.
There are some procedures that automatically determine how to treat a variable based on the measurement level, including CTABLES, the Chart Builder, and TREE, but you can change the level temporarily in the dialog box or in syntax or change it persistently via VARIABLE LEVEL or in the Data Editor. Also, most of the statistical extension commands use the declared measurement level to determine whether a variable is continuous or a factor.
I am trying to write my first script in MQL4 and had hopefully a few basic questions.
1) I am aware that I can write a script and drag and drop it on a symbol window to execute the script. I was wondering though if there was a way to reference a symbol window through the code?
Is it just like the code below,
WindowHandle("EURUSD", PERIOD_M1)
2) Is there anyway to specify the time horizon of a symbol window. For example say I want the symbol window to show me the EURUSD 1 minute data from 4th March 2012 10:10 am to 4th December 2012 4pm? Can you also specify the number of bars to show on the chart at anyone time?
3) Can you draw a line on the chart using a script? I think I read you cannot - that you would need to write a custom indicator? I understand using a script however that you can annotate the chart with a text object though.
A3: Yes, you can
A2: No, any code is sub-ordinated to the pre-set MT4.Graph instance
In other words, your code ( any MQL4 ( well, valid as far as Build 711 )) cannot moderate the outer-container ( the MT4.Graph ), be it zoom, Y-scale, changing it's Period and other "given" features, some of which may be editable by user ( but not by the code )
A1: No, but ... might be you read about some
This is rather dangerous zone. Imagine a MT4 Terminal, that has a live-session, if there were such WindowHandle( "EURUSD", PERIOD_M1 ) and if there were six graphs for [EURUSD,M1]. Which way should the identification / execution follow? No, this is left intentionally as a "Human-step", because executing any kind of code is associated with risks and may create huge if not fatal losses ( as the code runs blind and deaf and VERY FAST ).
While there are some dirty techniques to identify/swap MT4-"window" these techniques are highly dependent on O/S services. For normal use, I would dare rely on any of those I have read about so far.
I am trying to print a load of Zweckform 4737 labels from a web page. From reading around it sounds like it's more robust to generate a PDF than to use print stylesheets.
There are various libraries out there in various languages for doing this...but unless your specific label is supported, you need to know the exact measurements of the label yourself. Unfortunately it seems the Zweckform 4737 is not widely supported. (I will be using a Ruby library at the end of the day, but that's by the by.)
I have looked online but I cannot find the Zweckform 4737's measurements. I know the basics: 29.6mm x 63.5mm, 3 per row, 27 per sheet. But I also need (I think) the sheet's left and bottom margins, and the horizontal gap between labels if any.
Does anyone know where I can find this information? Or should I simply trawl around office stationery shops looking for a pack of the labels and just measure them with a ruler?
Aimee Daniells showed me that the Open Office label wizard has all the information I need.
Thanks Aimee!