Petr Nosek / Publications
Forum
Colored arrows and line
I have an indicator that combines the drawing of colored arrows and colored lines. The logic for determining colors and the colors themselves are exactly the same for both arrows and lines. Does each colored plot need to have its own color buffer ? Or is it possible to use one color buffer for all
Applied price in the visual tester
I have programmed my own indicator, whose values are calculated from the price[] buffer. The indicator code contains the line: #property indicator_applied_price PRICE_MEDIAN When I insert the indicator into the chart, I can select the desired applied price on the Parameters tab, based on which the
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