Pls what step should I apply in writing a code that can draw support and resistance level in a chart using mql4
You achieve drawing a support or resistance line by creating an OBJ_HLINE type graphical object at some given price. Here is an example:
ObjectCreate(0, "Support1", OBJ_HLINE, 0, 0, Price);
where Support1 is just some text name, and Price is some price level.
Related
In OpenLayers I use ol.style.Text to add a text label to federal states polygons. The states have names of different length and also polygons of different sizes. It looks like this:
Is it possible to only print the text marker if it fits inside its polygon (e.g. after zooming in)? For instance, in the above example Hessen, Thüringen, Sachsen and Bayern would be printed, but Rheinland-Pfalz, Saarland and Baden-Württemberg would be omitted because the text goes beyond its feature's geometry...
I know I can set the font property of an ol.style.Text to a particular size based on the resolution but this does not help here as text would still overlap the borders sometimes...
This is currently not possible with help from the library. But you can use CanvasRenderingContext2D#measureText() in your vector layer's stlyeFunction to get the width of the label, and compare that with the extent's width of the polygon at a certain resolution, and decide based on that whether to render or not. You can also get smarter than using the extent's width, but it is probably a good enough approximation for many cases.
I'm trying to put two labels side-by-side using Autolayout--the left label is the field name while the right label is the value. I'm writing the constraints in Visual Language Format.
However, I don't want the left label to grow beyond its intrinsic width, and I want the right label to fill the remaining width in the screen. I know that I simply need to assign a higher content hugging priority on the left label's intrinsic width, but how do I write the intrinsic width in VLF?
I'm expecting my VLF string to look something like this:
H:|-20-[leftLabel(==intrinsicContentWidthGoesHere#1000)]-20-[rightLabel]-20-|
You can't do it. There are many things that can't be done in the visual format syntax; this is just one of them. The visual format syntax is good for what it's good for, but it can perform only quite a small subset of the most commonly needed settings of which constraints are capable. Just to give another example, you can't use it to set a center constraint.
There's nothing wrong with mixing and matching visual format syntax constraints with single constraints or other constraint commands. In your case, just send the view the setContentCompressionResistancePriority:forAxis: command or the setContentHuggingPriority:forAxis: command, and move on.
I am using buttons to display product names in a matrix using TGridLayout.
The problem is that commonly Items contains 3 or 4 words and in my language (Portuguese) some words tend to be long.
I would like that somehow I could calculate the size of the font, decreasing it, in order to make all the text show up automatically (of course there is also a decrease limit, anything below 9 or 8 point for the font turn to be difficult to read).
The wordwrap property is turned on to have many lines, and use the most possible space for the text.
I don't know if you're programming for an Android/iOS app, but you can't change the fontsize of a button. I've had the same problem, my solution was to make an abbreviation of the words. And then i put labels above it to explain the abbreviations.
Of course you can adjust the font size of a button:
TButton.TextSettings.Font.Size
I'm using Latex to write my resume, however the default margins for the resume doc type are too wide. The best way to correct this is using the anysize package then setting the margin size, however doing so causes the "=.5=.75" to display before my title in the pdf. Here is the header code
% LaTeX resume using res.cls
\documentclass[margin]{res}
% \usepackage[margin=0.75in,bottom=.5in,top=.5in]{geometry}
\usepackage[none]{hyphenat}%%%%
\usepackage{anysize}
\setlength{\textwidth}{5.8in} % set width of text portion
\begin{document}
\marginsize{.5}{.5}{.75}{.75}
% Center the name over the entire width of resume:
\centerline{\large\bf John Doe}
You need to specify the lengths using some unit of measure. For example:
\marginsize{.5in}{.5in}{.75in}{.75in}
However, as mentioned in the anysize README
This package is obsolete. Use the package typearea to define your
margins typographically correct. Use the package geometry or vmargin
for everything else.
My suggestions would be to stick to geometry package for setting your document layout. Also, not to use resume for setting a resumé. There's moderncv as an alternative, or you could do just as well in the default article class.
I'm puzzling how to divine more font metrics from iOS. I can accomplish my very long single line of text by paging UIViews while scrolling. I can determine where to break the strings between views by iteratively calculating it with sizeToFont, but I need the inter-character spacing (i.e. advance width) to space them accurately.
Any ideas short of full fixed or monospaced fonts? Thanks.
The Core Text class CTFont gives you some access to glyph metrics. But really, you should try to just use Core Text to do your text rendering instead of asking it for measurements and calculating positions yourself.
CTFont Reference
Core Text Programming Guide