If you want the current values, you have to indicate bar index = 0 :
double up1 = iCustom(NULL,0,"Trix",TRIX_Period,Signal_Period,Signals,CountBars,2,0);
Also, please note that:
SetIndexBuffer(1,ind_buffer2); // ind_buffer2's index = 1. Therefore ind_buffer2[0] = iCustom(NULL,0,"Trix",TRIX_Period,Signal_Period,Signals,CountBars,1,0); SetIndexBuffer(2,ind_buffer3); // ind_buffer3's index = 2. Therefore ind_buffer3[0] = iCustom(NULL,0,"Trix",TRIX_Period,Signal_Period,Signals,CountBars,2,0); SetIndexBuffer(3,ind_buffer4); // ind_buffer4's index = 3. Therefore ind_buffer4[0] = iCustom(NULL,0,"Trix",TRIX_Period,Signal_Period,Signals,CountBars,3,0); // In general: iCustom(NULL,0,"Trix",TRIX_Period,Signal_Period,Signals,CountBars, buffer index, bar index);
Regards.
Jose Francisco Casado Fernandez:
If you want the current values, you have to indicate bar index = 0 :
Also, please note that:
Regards.
I see. When I have been looking in the tutorial videos it always showed "1" there. I will try that right now. If this will work, I will respond again to make sure my question was answered. Thank you!
Budzzza:
You are welcome. Regards.
I see. When I have been looking in the tutorial videos it always showed "1" there. I will try that right now. If this will work, I will respond again to make sure my question was answered. Thank you!
Jose Francisco Casado Fernandez:
You are welcome. Regards.
You are welcome. Regards.
Everything worked. Thank you so much again.
SOLVED
Budzzza:
I'm glad everything was fine. Regards.Everything worked. Thank you so much again.
SOLVED
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
Hi everyone. I have been trying to use several values from the custom indicator, called "Trix", in my expert advisor. I was wondering if anyone can help me with what am I doing wrong and how I should get the values that I need.
Brief explanation: I have been trying to get the 'double' value for ind_buffer3[0] , ind_buffer2[0] , ind_buffer4[0] and use them in my expert advisor (in order to get these values from the indicator, i used iCustom command). I have tried to check if I am receiving the same values, both from the indicator and expert advisor (using Alert() function), however the values for ind_buffer3[0] and ind_buffer4[0] appear to be different when Trix is telling me that there is a signal to Buy or Sell. Basically the values that I get from my expert advisor (using Alert() function) stay the same and never change, but the values that i get from the indicator do change (I understand that this happens during the "if" statements in the code).
Code for TRIX indicator:The question: How can i get the values from the indicator in my expert advisor so that they also change during the Buy or Sell signal?
My expert advisor code to get the values from the indicator:
I apologize if it's a noob question. I have been trying to look up several topics, but didn't find anything that helped me. Thank you.