Need help with iCustom

 
I have read all I can find about the iCustom function, but I cannot get my code to work.

I have found an indicator on the internet which I have attached, called the 4TF HAS BAR. This indicator shows 4 timeframes as bars in two different colours (blue for up and red for down).

In my EA,
I want to know what the colour of each of the bars is, but only the last bar column. So I want to know whether timeframe M30 is red or blue, M15 is red or blue, M5 is red or blue and M1 is red or blue.
Using the below code and attached file, all I get in MyValue1 to MyValue4 are long strings of numbers.

Can somebody please complete the code pieces here that I need for my EA as well as that has to go into the indicator. I think it is something like this, but I cannot get it to work:

In the EA this code
MyValue1 = iCustom(NULL,0,"HAS Lower",MaMetod,MaPeriod,MaMetod2,MaPeriod2,0,0) ;
MyValue2 = iCustom(NULL,0,"HAS Lower",MaMetod,MaPeriod,MaMetod2,MaPeriod2,1,0) ;
MyValue3 = iCustom(NULL,0,"HAS Lower",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0) ;
MyValue4 = iCustom(NULL,0,"HAS Lower",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,0) ;


-----------------------------------------------------------------------------------------------------------------------------------------------------------------


In the indicator this code
....
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
....
ExtMapBuffer1[0] = buf1_down[0];         
ExtMapBuffer2[0] = buf1_up[0];         
ExtMapBuffer3[0] = buf2_down[0];         
ExtMapBuffer4[0] = buf2_up[0];    
Files:
hasnlower.mq4  10 kb
 
Hello, I have following working successfully:
int modeH4_graph2_up = 0;
double graph2_up = iCustom(NULL,0,"N4 TF HAS Bar",MaMetod,MaPeriod,MaMetod2,MaPeriod2,BarWidth,BarColorUp,BarColorDown,TextColor, modeH4_graph2_up, 1) ;
 
mike2tango:
Hello, I have following working successfully:
int modeH4_graph2_up = 0;
double graph2_up = iCustom(NULL,0,"N4 TF HAS Bar",MaMetod,MaPeriod,MaMetod2,MaPeriod2,BarWidth,BarColorUp,BarColorDown,TextColor, modeH4_graph2_up, 1) ;


I tried writing an EA to use the iCustom indicator to call "N4 TF HAS Bar" just as you have done.

I noticed, in the journal when I am running the EA in the Strategy Tester (15 min tf) that I get these problems:

The Heiken_Ashi_Smoothed,M30 loads over and over again for several minutes before the candles start moving.

I am not getting any values (0) when I send 30 as the timeframe.

I am seeing "unknown subwindow number -1 for ObjectCreate function".

Can you help? I kept my EA simple so that it would be easier for you to focus on the iCustom indicator.

Larene

Files:
 
larenespitler:


I tried writing an EA to use the iCustom indicator to call "N4 TF HAS Bar" just as you have done.

Larene


I figured it out.

Larene

Files:
Reason: