wont close order properly

 

can any one help me with this please...


I am doing a iCustom on a indy called i-Regr ...I have identified the 3 lines that the i-Regr indicator places on the chart and i take trades

off the high line and the low line and the Ea is supposed to close the trade if the bid price hits the mid line.


The EA takes trades off the high/low line perfectly BUT it wont close off the mid line.


can any one help me see why it wont close the trade when bid hits the mid line? thanx

I have attached the i-Regr and my EA

Files:
myswing.mq4  8 kb
 
here is the i-Regr indy
Files:
ieregr.mq4  5 kb
 

can some one help with this? any ideas?

thanx

 

look at yr log file and see what is the error eg if price has changed then put a RefreshRates() before OrderClose(.)

 
ronaldosim:

look at yr log file and see what is the error eg if price has changed then put a RefreshRates() before OrderClose(.)



thanx will try

 
ronaldosim:

look at yr log file and see what is the error eg if price has changed then put a RefreshRates() before OrderClose(.)



ronaldosim,

I had a look...there is no reference to anything in the journal. its as if it is not even seeing the midline...I saw it dip below the mid line a few times and it does nothing even after I added the RefreshRates() function.

Im really not sure why it simply ignores the midline

 
23510 wrote >>

ronaldosim,

I had a look...there is no reference to anything in the journal. its as if it is not even seeing the midline...I saw it dip below the mid line a few times and it does nothing even after I added the RefreshRates() function.

Im really not sure why it simply ignores the midline

iCustom is used wrongly ; u need to put in the extern variables defined for the i-Regr

extern int degree = 3;
extern double kstd = 2.0;
extern int bars = 250;
extern int shift = 0;

so the red parameters are missing

highline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,1,1);
lowline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,2,1);
midline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,0,1);

 
ronaldosim:

iCustom is used wrongly ; u need to put in the extern variables defined for the i-Regr

extern int degree = 3;
extern double kstd = 2.0;
extern int bars = 250;
extern int shift = 0;

so the red parameters are missing

highline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,1,1);
lowline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,2,1);
midline = iCustom(Symbol(),0,"i-Regr",3,2.0,250,0,0,1);

I thought you could leave them out??? it says you only have to put them in if you want to...here :

1: Parameters:
2:symbol   -   Symbol the data of which should be used to calculate indicator. NULL means current symbol. 
3:timeframe   -   Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. 
4:name   -   Custom indicator compiled program name. 
5:...   -   Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator. 
6:mode   -   Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. 
7:shift   -   Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). 

Notice number 5 ...did Imisunderstand this? so what determines that it is neccessary is the fact that there are externals?

thanx for the help

 
23510 wrote >>

I thought you could leave them out??? it says you only have to put them in if you want to...here :

Notice number 5 ...did Imisunderstand this? so what determines that it is neccessary is the fact that there are externals?

thanx for the help

if necessary - > some indicators do not need parameters so it is not necessary but for i-Regr the parameters are indeed determined by extern;

u can make i_Regr go without parameters by removing the extern statement - then it becomes inflexible shld u need to change any variables;

 
ronaldosim:

if necessary - > some indicators do not need parameters so it is not necessary but for i-Regr the parameters are indeed determined by extern;

u can make i_Regr go without parameters by removing the extern statement - then it becomes inflexible shld u need to change any variables;

Thank you I understand perfectly now!

Thank you very much for the insight...you truly are very generous with your knowledge and expertise...thank you!

Reason: