Forum

Assignment to an inherited structure

I don't know which version introduced the change, but until relatively recently it was possible to create a descendant of a structure and assign the "value" of its ancestor to this descendant: struct ExtDateTime : public MqlDateTime { void Set( const MqlDateTime& value ) { this = value

Graphic overlay and label name overlay

I have an indicator that plots 3 buffers. The first is a line ( buffer number 0) and the other two are arrows (bufer numbers 1 and 2) that lie on that line (see picture). With this order of the buffers, the indicator is plotted in a desirable way (the arrows overlap the line). Unfortunately, when

Is it possible to "omit" the output parameter of a function?

For example, I have a defined function: int Func(int &result) In some cases I don't care about the "result" reference, yet I need (maybe not) to define it like this: int res, ret; ret = Func(res); Is it possible to use some placeholder instead of the "result" reference? Something like this: Func(*);

10015 Invalid price

I got stuck trying to BUY/SELL STOP LIMIT orders. When I send this type of order, it always comes back with error 10015 (Invalid price). I've been looking at this for a few hours now and still can't figure out where the problem is. The problem is not in the "normalization" of the prices, because I

Deprecated behavior, hidden method calling will be disabled in a future MQL compiler version

I create an inherited class from class CSymbolInfo . I overwrite the Name( const string name ) method, not the Name( void ) method. Than I call the Name( void ) method in the script and it says (warning) "deprecated behavior, hidden method calling will be disabled in a future MQL compiler version"

Is there an universal solution for Tick value?

I wonder how you manage the Tick value in your code. For some Symbols it is in the deposit currency but for some Symbols it is in another currency. In my opinion it depends on the value of MARGINCALCMODE. If it is 0 (Forex) the Tick value is in the deposit currency. If the MARGINCALCMODE is 1 (CFD)

Incorrectly displayed indicator

If I have only one chart open in the terminal (build 4755) and add any indicator to the chart that should be displayed in the terminal window, it will be displayed correctly: If I open another chart and try to add an indicator, the indicator will open in a separate window above the price chart: In

Strange behaviour of an indicator at weekends (without ticks)

If I need to have synchronized data in the indicator, I perform a synchronization check. Unfortunately, if there is no next tick coming (e.g. on weekends), there is no further call to OnCalculate and the indicator is not calculated. I helped myself by calling the ChartSetSymbolPeriod function . In

Disable chart scaling

I try to disable chart scrolling and scaling by the ChartSetInteger function with the property CHART_KEYBOARD_CONTROL (in MT4). Disabling scrolling is successful in this way, but unfortunately scaling cannot be disabled in this way. Every time you press "+" or "-" on the numeric keypad, the chart

Price scale changing

Can we detect that the scale of the price axis has changed when the price rises/falls outside the original interval on the price axis? I thought this should be handled by a function OnChartEvent with id CHARTEVENT_CHART_CHANGE, but unfortunately not