Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Indicators - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

 
 
LinkBack Thread Tools
 
Old 11-25-2006, 04:15 PM
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
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 :
Code:
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(res1<0 && res0>0)
   {
   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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 04:30 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Question

Quote:
Originally Posted by 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 :
Code:
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(res1<0 && res0>0)
   {
   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 !
PHP Code:
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
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 04:33 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Lightbulb 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!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 05:00 PM
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Quote:
Originally Posted by codersguru
PHP Code:
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 !
Attached Files
File Type: mq4 Fisher_Yur4ik.mq4 (2.0 KB, 32 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 05:10 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
Originally Posted by 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 bar
double res1 = iCustom(NULL,0,"Fisher_Yur4Ik",0,1); //Previous bar
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 05:46 PM
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Quote:
Originally Posted by 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 bar
double 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...
Attached Files
File Type: mq4 temp.mq4 (1.9 KB, 31 views)

Last edited by yaniv_av; 11-25-2006 at 05:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 07:23 PM
Senior Member
 
Join Date: Nov 2005
Posts: 169
mangman is on a distinguished road
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--)

Last edited by mangman; 11-25-2006 at 07:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 07:34 PM
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Quote:
Originally Posted by 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 ?
Attached Images
File Type: jpg jurick.JPG (122.2 KB, 217 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 09:01 PM
zupcon's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Malta
Posts: 205
zupcon is on a distinguished road
Quote:
Originally Posted by 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-25-2006, 09:07 PM
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Quote:
Originally Posted by 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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Bookmarks
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy iCustom and Alerts! codersguru Indicators - Metatrader 4 50 09-18-2008 01:02 PM
iCustom function homicida Questions 56 07-28-2008 09:57 AM
icustom maje Questions 24 12-05-2007 09:26 AM
I need help on creating an Icustom statement for my EA using this indicator as input! iscuba11 Expert Advisors - Metatrader 4 4 09-11-2006 07:18 PM
iCustom() problem billritz Indicators - Metatrader 4 5 08-23-2006 07:22 AM


All times are GMT. The time now is 07:00 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.