Tshidiso Ephraim Mpakanyane:
In MQL5, as far as I know, you can archive this by creating 2 separate indicator scripts
In MQL5, as far as I know, you can archive this by creating 2 separate indicator scripts
one thing you can already do today: an indicator that lives in a seperate window can still draw on the main chart using objects. if you create them in sub window 0, the boxes, lines or arrows go on the price chart while the buffers stay below.
the buffers are fixed to one window when you compile, so for plotted lines you still need two files, but for range boxes like that script, objects are enough. good suggestion anyway, it would save alot of double work.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone,
I was studying the open-source TradingView script Z-Score Range Boxes Breakout [BigBeluga].
Both script versions for TV and ProRealTime can create indicators/draw buffers in both windows using only one script. This is extremely convenient.
In MQL5, as far as I know, you can archive this by creating 2 separate indicator scripts then main chart script communicate with the separate window script, or use #resource to compile them together. Both solutions work, but they feel heavier than necessary.
Would it be a long-shot to suggest an improvement so that an indicator no longer has to declare its window type, number of buffers and number of plots at compile time? In other words, could these three directives become optional or overridable at runtime?
As someone who approached MQL5 from a C++ background, i think this would be a big improvement, here is an example of a simple RSI script and some screenshot using c++, indicator buffers are drawn at any window at runtime.