ICustom question ..

 

Hi,

I want to check if some indicator, let's say Fisher_jurik, is crossing the "0".

I have tried to use iCustom but I don't think I understand how to do it ...

the code is :

int start()

{

//----

int ticket;

if(Volume[0]>1) return;

double res0 = iCustom(NULL,0,"Fisher_Yur4Ik",0,0);

double res1 = iCustom(NULL,0,"Fisher_Yur4Ik",0,1);

if(res10)

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-SL*Point,Ask+TakeProfit*Point,"temp",16384,0,Green);

if(ticket>0)

{

if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());

}

else Print("Error opening BUY order : ",GetLastError());

return(0);

}

//----

return(0);

}

//+------------------------------------------------------------------+

But the results (the buying orders) are not match the graph at all...

I think the problem is maybe the "shift" parameter ?

10X !

 
yaniv_av:
Hi,

I want to check if some indicator, let's say Fisher_jurik, is crossing the "0".

I have tried to use iCustom but I don't think I understand how to do it ...

the code is :

int start()

{

//----

int ticket;

if(Volume[0]>1) return;

double res0 = iCustom(NULL,0,"Fisher_Yur4Ik",0,0);

double res1 = iCustom(NULL,0,"Fisher_Yur4Ik",0,1);

if(res10)

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-SL*Point,Ask+TakeProfit*Point,"temp",16384,0,Green);

if(ticket>0)

{

if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());

}

else Print("Error opening BUY order : ",GetLastError());

return(0);

}

//----

return(0);

}

//+------------------------------------------------------------------+

But the results (the buying orders) are not match the graph at all...

I think the problem is maybe the "shift" parameter ?

10X !
double res0 = iCustom(NULL,0,"Fisher_Yur4Ik",0,0); double res1 = iCustom(NULL,0,"Fisher_Yur4Ik",0,1);

Where are the paramters passed to Fisher_Yur4Ik?

They should be before 0,0); and 0,1); parameters

 

iCustom generator!

in www.xpworx.com they are building iCustom generator (which I'm helping them in with the mql4 language!)

The program takes .mq4 file and which line to use as parameters and return mql4 code generated!

I'll inform you when it's done and be online!

 
codersguru:
double res0 = iCustom(NULL,0,"Fisher_Yur4Ik",0,0); double res1 = iCustom(NULL,0,"Fisher_Yur4Ik",0,1);

Where are the paramters passed to Fisher_Yur4Ik?

They should be before 0,0); and 0,1); parameters

Hi !

There are no parameters passed to this indicator.

Attached here the indicator.

10X !

Files:
 
yaniv_av:
Hi !

There are no parameters passed to this indicator.

Attached here the indicator.

10X !

That's right! The indicator uses no parameters and has only one buffer (it has 3 buffers but 2 of them are disabled by SetIndexLabel(1,NULL)).

So your iCustom code is correct:

double res0=iCustom(NULL,0,"Fisher_Yur4Ik",0,0); //Current bardouble res1=iCustom(NULL,0,"Fisher_Yur4Ik",0,1); //Previous bar

 
codersguru:
That's right! The indicator uses no parameters and has only one buffer (it has 3 buffers but 2 of them are disabled by SetIndexLabel(1,NULL)).

So your iCustom code is correct:

double res0=iCustom(NULL,0,"Fisher_Yur4Ik",0,0); //Current bardouble res1=iCustom(NULL,0,"Fisher_Yur4Ik",0,1); //Previous bar

So why the results are seems not match the graph ??

Here is a simple EA that I wrote. It should buy when the indicator is crossing the zero up.

Try to backtest it with visual-mode, and you'll see that the buy's orders are not at the right place all over the graph... Or no order is made at a right place...

Files:
temp.mq4  2 kb
 

Maybe the last loop of the indicator has an error:

for(i=limit-2; i>=0; i--)

Maybe it should be

for(i=limit; i>=0; i--)

 
mangman:
Maybe the last loop of the indicator has an error:

for(i=limit-2; i>=0; i--)

Maybe it should be

for(i=limit; i>=0; i--)

I changed it - but I'ts not the problem.

Here is a screenshot of some visual backtest.

As you can see from the picture:

On the rectangles - Why it opens an order ?

On the triangles - Why dosn't it open an order ?

Files:
jurick.jpg  123 kb
 
yaniv_av:
On the rectangles - Why it opens an order ? On the triangles - Why dosn't it open an order ?

I havnt looked at this indicator for a while, but I do know that a lot of the original versions used to repaint the past. Are you 100% sure that this isnt happening ?

Regards

zup

 
zupcon:
I havnt looked at this indicator for a while, but I do know that a lot of the original versions used to repaint the past. Are you 100% sure that this isnt happening ?

Regards

zup

Oh, well I did'nt know that...

I'll check it live at monday.

Do you have a version of that indicator that dosn't repaint ?

 

Yaniv,

The Yurik version of the Fisher indicator does infact repaint the past. It is useless.

Please check this thread on this forum. Igorad and many other expert prgrammers were involved in trying to figure out this indicator in response Nina's original question about the repainting of some of the Fisher indicators available on the web.

https://www.mql5.com/en/forum/173169

Please download the Fisher_m11.mq4 indicator in that thread near the end and then change the code in your EA to reflect this and test it and let us know if it works.

Reason: