We don't know whether Var_b[] is an indicator buffer or an array
If it is an array, have you sized it?
Hi guys,
Thanks for chipping in. I have defined Var_a and Var_b globally at the beginning of my code. Apologies, I should have included it.
So I define the the variables globally as an array (without sizing them), then look to use those arrays as a buffer for my custom indicator.
#property indicator_separate_window #property indicator_buffers 5 #define NEGATIVE_VALUE -1 #define THRESHOLD 0 #include <Functions.mqh> extern int Lookback = 5; int file_handle; int file_result; double Var_a[]; double Var_b[];
SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Var_a); SetIndexLabel(0,"Variable A"); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Var_b); SetIndexLabel(1,"Variable B");
We don't know whether Var_b[] is an indicator buffer or an array
If it is an array, have you sized it?
Forgive my stupid question GumRai, can it be both? My understanding is that I have defined Var_b[] as an array. I then call on this array to populate my indicator buffer.
Thank you kindly for your help, I am truly stumped on this one.
Ah, gents I've solved it.
My problem was that I was actually using 5 buffers, and I had Var_b[] being called using the 5th buffer. So there was a few blank buffers before Vab_b[]. Changing the buffer to the next available free one has worked.
Can I thank you both for taking the time to help, I thought that I had tried this solution before but obviously I'd done something incorrectly.
Thanks again for your time.
Paddy.
- 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 Guys,
I'm stumped on some code...can you help?
I've got two functions in an include file (GetA and GetB). I want to use these two functions to populate two arrays that will later be used in two custom indicator buffers.
But for some reason, I can only get one array to populate. Please see my MWE below:
Am I missing something about only being able to populate one custom indicator at a time within the special function start?