Hi there,
I am using the function CopyBuffer inside OnCalculate this way:
I understand that the programming sentence above generates an array with the info of all the rates (MN, month). But is it possible to call CopyBuffer in order to fill DEMABuffer with as many elements as the total number of rates of a given time frame (H1, H4, etc.)? In other words, how can you ask for the number of rates of a given time frame? Thks a lot in advance!
You have to use an other handle for DEMA with requested Period as parameter.
Then you can use Bars() function. That gives something like :
int count = Bars(_Symbol, RequestedPeriod); if(CopyBuffer(DEMAHandler_RequestedPeriod,0,0,count,DEMABuffer_RequestedPeriod)<=0) return(0);
You have to use an other handle for DEMA with requested Period as parameter.
Then you can use Bars() function. That gives something like :
You're a truly expert! Thank you for this detail.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
I am using the function CopyBuffer inside OnCalculate this way:
I understand that the programming sentence above generates an array with the info of all the rates (MN, month). But is it possible to call CopyBuffer in order to fill DEMABuffer with as many elements as the total number of rates of a given time frame (H1, H4, etc.)? In other words, how can you ask for the number of rates of a given time frame? Thks a lot in advance!