

This function is called by events (keyboard operation, mouse operation, object creation / modification / deletion) on the Chart. If there is no intended use, it is not necessary to include it in the program. OnTick () is not called if there is no price movement, so use this if you want to operate without price movement.

If there is an Event that needs to be stopped or information that you want to output at the end, I think it is better to process it here.Ī function that is called at new quote is received.īasically, implement the core of the automatic trading process here, or call the automatic trading function you created.Ī function that is called at a specified cycle. However, the processing in the function is the worst, and it is not necessary.Īnd also refer to other notes when implementing the OnInit () function.Ī function that is called at the end of the program. This function should be written as mandatory. I think it’s a good idea to perform external variable initialization processing and input parameter checking processing. The first function to be called after loading the program. The call timing of each function is described in the sample program. It is usually said that the fewer external variables, the fewer bugs.Ī group of functions called from the MT4 Event handler. Set global variables that can be referenced in all functions in program creation. It also seems to have a function to raise the warning level when compiling the program.(It is better to describe it because it will reduce unintended programming mistakes.)

It’s always a good idea to set it when you create a new compiler with Build 600 or later. #property strict : A property created to maintain compatibility due to a wide variety of large differences during the past MQL4 compiler updates. #property version : Program version, maximum 31 characters If(EventSetTimer(60) = false) Īlthough it is the sample program described above, the outline is described in the comments in the sample program, but the outline is also described here. after input parameters are changed from the setup window of an Expert Advisor financial instrument and/or chart timeframe is changed Function called at the following timing
