Best way to read info from separate indicator into chart window

 

In a perfect world MT4 would let me draw buffers from one indicator into both a separate window and the chart window.  I have an indicator in a separate window that does some calcs and draws a modified MACD.  But I also need to do some calcs on the chart window and display stuff there.  I tried using iCustom, but i need 3 pieces of data from the separate window for the chart window.  each iCustom call takes about 10 seconds for 65k bars on the chart.  so the total load time is 30 seconds.  way too slow.

I know I could just draw objects on the chart window, but I prefer having it in buffers so that my EA can easily extract the information.

Are there any good workarounds to this?

 
cre8able:

In a perfect world MT4 would let me draw buffers from one indicator into both a separate window and the chart window.  I have an indicator in a separate window that does some calcs and draws a modified MACD.  But I also need to do some calcs on the chart window and display stuff there.  I tried using iCustom, but i need 3 pieces of data from the separate window for the chart window.  each iCustom call takes about 10 seconds for 65k bars on the chart.  so the total load time is 30 seconds.  way too slow.

I know I could just draw objects on the chart window, but I prefer having it in buffers so that my EA can easily extract the information.

Are there any good workarounds to this?

If you have the source codes for all indicators, you can merge/optimise them into one, so you'll only be calling one indicator. Or even better, merge them all into your EA.

 
cre8able: each iCustom call takes about 10 seconds for 65k bars on the chart.  so the total load time is 30 seconds.  way too slow.
if it takes too long to compute, reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.) Or, as a last resort, use my segmented OnCalculate include file.
          Your indicator is too slow... - Indices - MQL4 and MetaTrader 4 - MQL4 programming forum #1 № 6
 
Seng Joo Thio:

If you have the source codes for all indicators, you can merge/optimise them into one, so you'll only be calling one indicator. Or even better, merge them all into your EA.

I wrote the code so I could combine, but I need some info in chart window and some in separate window so combining wont work.  It would be nice if MQL4 let me choose the window for a buffer just like it does for objects rather than being global to the indicator
 
William Roeder:
if it takes too long to compute, reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.) Or, as a last resort, use my segmented OnCalculate include file.
          Your indicator is too slow... - Indices - MQL4 and MetaTrader 4 - MQL4 programming forum #1 № 6
I've been doing that for testing, but there are times when i need a long lookback.   I will check out your OnCalculate file.  thanks
Reason: