how pass all parameter from custom indicator to ea? - page 2

 

thx qjol and 7bit...

qjol, your method ==0.0 can open position buy after red arrow appear and continues open untill appear new arrow.. but i want after blue arrow open buy and not continues open....

so i change to ==1, but still can not too..

and i change a,c,e,g, can not too..


and 7bit..

your method using != EMPTY_VALUE, direct open position with arrow appear and continues to untill last bar.. almost all bar open postion..

using if (a != EMPTY_VALUE)

and using (a != EMPTY_VALUE && c != EMPTY_VALUE && e != EMPTY_VALUE && g!= EMPTY_VALUE) have same result..



i want to open buy after display blue arrow..

this blue arrow appear if:

w1 blue or red

d1 blue

h4 blue

h1 blue



i think the important is d1, h4 and h1 blue.. so the w1 even red, it can show blue arrow too.. because w1 rare change color, often red color..

a=up color -->w1

b=down color -->w1

c= up color -->d1

d= down color -->d1

e=up color -->h4

f=down color -->h4

g= up color -->h1

h= down color -->h1

is like that or not?


because i want open buy after blue arrow, i use code:

if ( a==00 || a !=0.0 && c==00 && e ==0.0 && g==0.0) --> display result on red arrow, not blue..

or using

( a==EMPTY_VALUE || a !=EMPTY_VALUE && c != EMPTY_VALUE && e != EMPTY_VALUE && g!= EMPTY_VALUE)

display result on all arrow..

so still wrong..

i have think about condition like this:

if(w1=blue or red and d1[1],h4[1],h1[1] =blue and d1[2] != d1[1] color or h4[2] != h4[1] color or h1[2] != h4[1] color), then open buy..

maybe like that the condition.. but how about the code?

thx.. :)

 

to tell you the truth, I did not told you exactly how to do it, just wanted to give you the idea how to do it

 

if so...

i only want to know about the value of this:

in below of chart,will see this indicator display...

w1 color color color color

d1 color color color color

h4 color color color color

h1 color color color color


d1 color= red

what this mean ?

a. c==00

b. c!=00

c. d==00

d. d!=00

e. c==EMPTY_VALUE

f. c!=EMPTY_VALUE

g. d==EMPTY_VALUE

h. d!=EMPTY_VALUE


which is the correct answer?

 

i dont c Different colors between W1 & D1 & ....

 

u nee to check any TF Separately

double w_a = iCustom(NULL, PERIOD_W1, "4BARS",0,1); //get weekly TF indicator buffer 0 bat shift 1
double w_b = iCustom(NULL, PERIOD_W1, "4BARS",1,1); //get weekly TF indicator buffer 1 bat shift 1
double d_a = iCustom(NULL, PERIOD_D1, "4BARS",0,1); //get daily  TF indicator buffer 0 bat shift 1
double d_b = iCustom(NULL, PERIOD_D1, "4BARS",1,1); //get daily TF indicator buffer 1 bat shift 1
double h4_a = iCustom(NULL, PERIOD_H1, "4BARS",0,1); //get 4 hour TF indicator buffer 0 bat shift 1
double h4_b = iCustom(NULL, PERIOD_H1, "4BARS",1,1); //get 4 hour TF indicator buffer 1 bat shift 1

//etc.

// & Do what you want with them
 

oh yes... thx boss qjol..

it's work..

yesterday using double a = iCustom(NULL, 0, "4BARS",0,1);

the first time, i test, i think that a is for period W1 function... so be confusious..

because the real the a is period H1..

and i am using your code like

double w_a = iCustom(NULL, PERIOD_W1, "4BARS",0,1); //get weekly TF indicator buffer 0 bat shift 1
double w_b = iCustom(NULL, PERIOD_W1, "4BARS",1,1); //get weekly TF indicator buffer 1 bat shift 1
double d_a = iCustom(NULL, PERIOD_D1, "4BARS",0,1); //get daily  TF indicator buffer 0 bat shift 1
double d_b = iCustom(NULL, PERIOD_D1, "4BARS",1,1); //get daily TF indicator buffer 1 bat shift 1
double h4_a = iCustom(NULL, PERIOD_H1, "4BARS",0,1); //get 4 hour TF indicator buffer 0 bat shift 1
double h4_b = iCustom(NULL, PERIOD_H1, "4BARS",1,1); //get 4 hour TF indicator buffer 1 bat shift 1

so it more quickly, can know which function is for certain period... so no need many testing..

and i see buf 0 with 1 is only have opposite value..

so i only using w_a,d_a,h4_a,h1_a.

o ya, after testing backtest, the position can open normally, but in the log have

2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:13     2010.01.04 01:11  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)
2010.09.28 00:57:11     TestGenerator: unmatched data error (volume limit 1024 at 2010.05.07 21:00 exceeded)

what is that means?

thx..

 

I am currently looking into it and I notice that I made a mistake

 

ok, here we go

If you put the indicator on 1H TF chart then

double a = iCustom(NULL, 0, "4BARS",0,1); //represent the current TF (H1), indicator buffer 0, bat shift 1 (Green Box)
double b = iCustom(NULL, 0, "4BARS",1,1); //represent the current TF(H1), indicator buffer 1, bat shift 1 (Red Box)
double c = iCustom(NULL, 0, "4BARS",2,1); //represent 1 TF higher from the current TF (H4), indicator buffer 2, bat shift 1 (Green Box)
double d = iCustom(NULL, 0, "4BARS",3,1); //represent 1 TF higher from the current TF (H4), indicator buffer 3, bat shift 1 (Red Box)
double e = iCustom(NULL, 0, "4BARS",4,1); //represent 2 TF higher from the current TF (D1), indicator buffer 4, bat shift 1 (Green Box)
double f = iCustom(NULL, 0, "4BARS",5,1); //represent 2 TF higher from the current TF (D1), indicator buffer 5, bat shift 1 (Green Box)
double g = iCustom(NULL, 0, "4BARS",6,1); //represent 3 TF higher from the current TF (W1), indicator buffer 6, bat shift 1 (Green Box)
double h = iCustom(NULL, 0, "4BARS",7,1); //represent 3 TF higher from the current TF (W1), indicator buffer 7, bat shift 1 (Green Box)


// & Do what you want with them
 
thx gjol..
double a = iCustom(NULL, 0, "4BARS",0,1); //represent the current TF (H1), indicator buffer 0, bat shift 1 (Green Box)
double b = iCustom(NULL, 0, "4BARS",1,1); //represent the current TF(H1), indicator buffer 1, bat shift 1 (Red Box)
double c = iCustom(NULL, 0, "4BARS",2,1); //represent 1 TF higher from the current TF (H4), indicator buffer 2, bat shift 1 (Green Box)
double d = iCustom(NULL, 0, "4BARS",3,1); //represent 1 TF higher from the current TF (H4), indicator buffer 3, bat shift 1 (Red Box)
double e = iCustom(NULL, 0, "4BARS",4,1); //represent 2 TF higher from the current TF (D1), indicator buffer 4, bat shift 1 (Green Box)
double f = iCustom(NULL, 0, "4BARS",5,1); //represent 2 TF higher from the current TF (D1), indicator buffer 5, bat shift 1 (red Box)
double g = iCustom(NULL, 0, "4BARS",6,1); //represent 3 TF higher from the current TF (W1), indicator buffer 6, bat shift 1 (Green Box)
double h = iCustom(NULL, 0, "4BARS",7,1); //represent 3 TF higher from the current TF (W1), indicator buffer 7, bat shift 1 (red Box)

double a2 = iCustom(NULL, 0, "4BARS",0,2); 
double b2 = iCustom(NULL, 0, "4BARS",1,2);
double c2 = iCustom(NULL, 0, "4BARS",2,2); 
double d2 = iCustom(NULL, 0, "4BARS",3,2); 
double e2 = iCustom(NULL, 0, "4BARS",4,2); 
double f2 = iCustom(NULL, 0, "4BARS",5,2); 
double g2 = iCustom(NULL, 0, "4BARS",6,2); 
double h2 = iCustom(NULL, 0, "4BARS",7,2); 

even using like that, the list in the log still :

2010.09.28 18:24:34     2010.01.04 11:02  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 18:24:34     2010.01.04 11:02  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 18:24:34     2010.01.04 11:02  4BARS EURUSD,H1: unknown subwindow number -1 for ObjectCreate function
2010.09.28 18:24:33     TestGenerator: unmatched data error (volume limit 867 at 2010.09.07 20:00 exceeded)
2010.09.28 18:24:33     TestGenerator: unmatched data error (volume limit 867 at 2010.09.07 20:00 exceeded)
2010.09.28 18:24:33     TestGenerator: unmatched data error (volume limit 867 at 2010.09.07 20:00 exceeded)


i got some answer from forums babypips that said the error " testgenerator :unmatched data error" is not problem and not effect for position.. because it's caused by when the chart timeframe you are using for the test has prices which do not match those of the lowest timeframe chart. For instance if you are testing on the 15 minute chart and the 15 minute chart has a high of 1.2727 but the history data on your 1 minute chart at the same time does not reach the same high this causes the unmatched data error.

and about eurousd,h1 : unknown subwindow number -1, still not found the way of solve it..i don't know what that effect, if that does not have effect, so not problem..

but i see from my backtest result, there is 90% open based of condition, and other not open position even have touch based of condition...

is this problem caused by that error or not?

or every ea can not fully open position based of condition?

this mission almost complete..

 

hardyyanto:

....

and about eurousd,h1 : unknown subwindow number -1, still not found the way of solve it..i don't know what that effect, if that does not have effect, so not problem..

......

I think...(but not positive) that you get that error if you are making an icustom call in the ea from an indicator that is looking to put objects onto the chart... but the indicator window can't be found... because you haven't loaded the indicator onto your chart. AFAIK, it doesn't impact your EA... but you may be better, if there are switches in the indicator externs to display the objects to make those false in your icustom call....as I say, not sure 100% but hth

V