How to CopyBuffer from an MTF indicator?

 

Say I have an indicator that generates values of higher time frame in lower time frame charts (A so-call MTF indicator). If I were to copy the values of that MTF for say creating a custom indicator at a lower TF. How do I copy the data from the MTF indicator?

I am using a code that does the job (see below), but when i use higher TF in the MTF indicator, the custom indicator becomes super slow... i presume I am copy this incorrectly.


MTF_Shift= PeriodSeconds(MTF_TimeFrame)/PeriodSeconds(Period()); 
   
if(!CopyBuffer(HandleMTFIndicator, 0, 0,  to_copy +VerySlowMA_Shift, BufferResults)) return(0);


I use the command :

to_copy +VerySlowMA_Shift


to offset the data that I want to copy by one candle of the MTF indicator, and avoid repainting.

 
Camilo Mora: How do I copy the data from the MTF indicator?

Same way you read any other indicator. Read the approprate buffer.