What is the function to set Alerts (not Alert() function) in MQL4 (metatrader)? - mql4

Confusing terms clarification:
Type 1: Alert() function in mql4
Type 2: Alerts that can be set on the UI of metatrader -see the image
My question is related to type 2 Alerts.
QUESTION:
Is there a way to set alert via MQL4? Just looking for the right function name.
My searches simply returned references to the type 1 alerts, nothing on type 2.
NOTE:
I am not looking for an indiactor solution.
Tnx in advance.

Related

Elmish.WPF type conflict: unit -> Model expected where Model provided?

My Elmish.WPF app combines the Elmish.WPF Sample projects ‘NewWindow’ + ‘NewWindow.Core’ which I am adding to a copy of ‘FileDialogsCmdMsg’ + ‘FileDialogsCmdMsg.Core’.
FileDialogsCmdMsg is the basis of this effort and provides the background processing features to which I am adding the ‘NewWindow’ popup window features.
I am stuck on two (2) type-conflicts when WpfProgram.mkProgramWithCmdMsg is called...
...errors on update and bindings calls.
The compiler reports that line has the following errors (see red underlines above)...
...saying that WpfProgram.mkProgramWithCmdMsg expects a unit -> Model but was given a Model where update and bindings are called in the larger type specification.
But here is the type information for the calling function, WpfProgram.mkProgramWithCmdMsg accepting these parameters…
... sorry that is so large.
As you can see, both ‘update’ and ‘bindings’ are producing the Model parameter types expected by WpfProgram.mdProgramWithCmdMsg. And yet we have a unit->Model expected where a Model has been provided type-conflict; why?
Here is more detail on the update type-conflict…
... see how here how here it is claimed a unit->Model is expected when previously you see that update is supposed to expect a Model? Why?
You see the same problem in this detail on the type-conflict with ‘bindings’...
..again showing unit-Model' expected when the correct Model` type parameter is passed.
Here the type information where update is defined…
...and here is the bindings type info…
QUESTION: Why is a "unit->Model expected error reported when the receiving function, WpfProgram.mkProgramWithCmdMsg, and both parameters, update and bindings both respectively provide Model parameters?
Please ask if more detail is needed to get to the bottom of this.
Thanks for your help!
I suspect the problem is with your init function, which (I'm guessing) is a function of type unit -> Model. If this is true, the lambda fun _ -> init, [] binds the concrete type unit -> Model to the 'model type variable. As result, update and bindings also expect the same concrete type, leading to the error message you're seeing.
If I'm correct, you have two choices:
Change init so it is a value of type Model, rather than a function.
Change init so it also returns an empty message list, and then pass init directly to mkProgramWithCmdMsg, rather than passing a lambda.
Note that when you hover over mkProgramWithCmdMsg, the compiler shows you that 'model is indeed bound to unit -> Model, presumably due to the init type mismatch:

Is it possible to do a "a href" in corona using lua

I am new to Corona and Lua.
is it possible to do something like an "a href" in Lua? I am having a button and I need it to link it to other page but I can't seem to find a way to do it. I am not trying to infuse HTML code to Lua. I just need a way to perform a function like this(in Lua language). I have googled and even look at the manual of Lua and corona docs but still unable to find anything similar to it.
To people who know this, please advice. Thankss
Clicking a button will cause an event. You can implement a function that handles this event and for example shows another page. Please read the Corona manual and do some basic tutorials. All information you need is there.
From: https://docs.coronalabs.com/api/library/widget/newButton.html
onPress (optional) Listener. An optional function to be called when
the button is pressed. The callback function does not require testing
for event.phase since it only honors "began".
https://docs.coronalabs.com/api/type/Listener.html
Events are dispatched to listeners. Event listeners can be either
functions or table objects.
In both cases, when an event occurs, the listener will be invoked and
be supplied with a table representing the event. All events have a
name property that corresponds to the name you use to register the
event.
For more information, see the Basic Interactivity and Event Detection
guide.
https://docs.coronalabs.com/guide/events/detectEvents/index.html
To find out how to switch "pages" or scenes read
https://docs.coronalabs.com/guide/system/composer/index.html
For adding a reference in a button:
local button =
div {
a{["data-toggle"]="modal",
["data-backdrop"]="static",
href="#refrence-modal",
}
Or, you may add button inside a form:-
define the action of the form
make the button type as submit

Is it possible to call Gdk.Seat.grab() in GJS?

It seems when I call Gdk.Seat.grab() in GJS I get an error:
Gjs-WARNING **: JS ERROR: TypeError: Gdk.Seat.grab is not a function
This function and class is listed in the GJS Docs, but maybe I'm calling it wrong? If I call typeof on Gdk.Seat.grab it comes back undefined. Is this not possible, or is there another way I can grab focus in this way?
My use case is gathering a keybinding from a user, for which I can use Gtk.CellRendererAccel, but I would prefer not to use a Gtk.TreeView. The docs say about CellRenderers that:
These objects are used primarily by the GtkTreeView widget, though they aren’t tied to them in any specific way.
and...
The primary use of a GtkCellRenderer is for drawing a certain graphical elements on a cairo_t.
Which implies I could use it outside of TreeView, but with no hints as to how.
grab() is a method of Gdk.Seat, so you need a Gdk.Seat object to call it on. It looks like you're calling it as a static method, Gdk.Seat.grab(). So, you'll need something like Gdk.DeviceManager.get().get_default_display().get_default_seat() or you can get a Gdk.Seat object from a Gdk.Event.
It's not clear from the described use case what you are trying to do with the grab, but there may be an easier way to accomplish it.

F# type inferrence issue

I have experienced the following problem while writing a test. Please find a picture bellow.
If I create validateGameExistance function in the unit test project then it works fine.
How could it be solved?
It is hard to give a definite answer (based just on the screenshot), but you can get this kind of error when some of the types involved in the type error are defined in multiple places (so, the type name would look the same, but they would actually be different types in different assemblies).
For example, if the Result<T> type is defined in multiple projects and the function you're calling returns one of them, but your annotation is referring to another one.

How do I activate code completion for case statements?

In more recent Delphi versions it is possible to use code completion to code all the cases in a case statement at once, for e.g. enumerated types.
But whatever I try, I can't get it to work. What should I start to type, then what hotkey to use? Maybe I'm missing a Tools/Options setting, although I don't suspect that, because it's a manual operation.
Exit the case variable field with a Tab and the IDE will auto-complete the case options if your variable is of a enumerated type.
In the proper place in the code editor Type case space
The IDE adds a case template and presents a blue rectangle field where you type the variable name for the case statement
Write the name of that variable and
Exit the field with the Tab key
The IDE adds all the enum values to the case template.

Resources