Forum

After one successful copy buffer, following ones fail unintentionally

My intention of the code below is to display 3 periods of moving average lines for the range of bars specified by chart window width. Although first period of line is drawn properly, succeeding 2 period lines fail to draw due to CopyBuffer error (4806 : Requested data not found). I cannot figure out

Indicator issue - Plotted Arrows disappear unintentionally when a new tick comes in

While converting my MT4 indicator code to MT5, I came across a strange issue where the arrows disappeared when a new tick came in. Could anyone help with this? When I hit [z] key to activate indicator display, peak high and low arrows appear on chart, but soon after when a new tick comes in, they

How to get handle of line object drawn on the horizontal canvas band

I drew a long transparent horizontal band with canvas from the left to the right end of chart. Then I created a horizontal line object. When the line is outside the canvas band, I can get line handle with either CHRARTEVENT_OBJECT_CLICK or CHARTEVENT_CLICK and move around by mouse. However, once the

MQL4 How to change chart zoom level from 1 to 32 one by one ?

MT4 has a total 32 step of chart zoom levels, but we usually can change only 6 zoom levels( 1 > 2 > 4 > 8 > 16 > 32) from chart menu. I tried the script below, but only the above 6 zoom levels are shown. //------------------------------------------------------------------ void OnStart () { for (

How to trigger event by for example "Shift + z" key ?

I've been looking for the answer to the captioned question, but been unable to find it so far. CHARTEVENT_KEYDOWN can only pass code of a(one) pressed key by lparam. Thus it can not tell "shift + z" key input from "z" key input. Is there any way to capture a set of two key inputs, like "Ctrl + a"

MQL4: "array out of range" error in the strategy tester with my personal Expert Advisor

I am having a difficulty in solving " array out of range " error, which occurs constantly when I perform strategy tester with my EA under development. I tried to figure out the cause and fix it by referring to MQL4 reference and other sources available in cyber network, but so far no progress for