FX Instructor Forums UserCP Disabled - Please Log In!
Chatbox Disabled - Please Log In!
Contact Us
Search
FX Instructor Forums
Live Trading Room
Become a Member - Just $29.95 per month!
Live Trading Room - Connect to Room
Live Trading Room - Weekly Schedule
Live Trading Room - FREE Sessions
Free Services
Free Daily Market Commentaries
BBC News
Forex News
Educational Partner: I-Trade FX
Educational Partner: FX Open
Strategic Partner: IBT FX Center

Go Back   FX Instructor Forums > Tools of the Trade > MetaTrader 4 Tools and Indicators

MetaTrader 4 Tools and Indicators Discuss MT4 indicators, expert advisers, templates, and everything to do with their development and usage.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2007, 09:25 PM
yarns90401 yarns90401 is offline
Junior Member
 
Join Date: Nov 2007
Posts: 3
Activity Longevity
0/20 14/20
Today Posts
ssssssss3
Default iCustom

EugeneFXI,

Can you or one of the other instructors help me out with creating the code for this indicator to let me know when an arrow has been detected? I've been trying for two weeks and I can't get this thing to work.

Much thanks in advance,

Y
Attached Files
File Type: mq4 LWMA-Crossover_Signal.mq4 (5.3 KB, 22 views)
Reply With Quote
  #2  
Old 12-13-2007, 02:37 PM
EugeneFXI's Avatar
EugeneFXI EugeneFXI is offline
What's a forex?!
FXI Administrator
Location: New York City, USA
 
Join Date: Jun 2007
Location: New York City, USA
Posts: 519
Activity Longevity
5/20 20/20
Today Posts
ssssss519
Send a message via Skype™ to EugeneFXI
Default

Hi Yarns,

Try something like this:

PHP Code:
if(iCustom(NULL,0,"LWMA-Crossover_Signal",5,6,0,0) > || iCustom(NULL,0,"LWMA-Crossover_Signal",5,6,1,0) > 0)
Alert("We have a crossover!"); 
Parameters for iCustom:
parmeter 1 :the symbol - NULL for current symbol.
parmeter 2 : time frame - 0 for current time frame.
parmeter 3 : indicator name - "LWMA-Crossover_Signal".
parmeter 4 : LWMA parameter 1, FasterLWMA = 5.
parmeter 5 : LWMA parameter 2, SlowerLWMA = 6.
parmeter 6 : buffer number (0 to 7) = 0 or 1 (CrossUp or CrossDown buffers).
parmeter 7 : bar index - 0 for the current bar.

Let me know how it goes!
__________________

Reply With Quote
  #3  
Old 12-15-2007, 02:52 PM
yarns90401 yarns90401 is offline
Junior Member
 
Join Date: Nov 2007
Posts: 3
Activity Longevity
0/20 14/20
Today Posts
ssssssss3
Default

Eugene,

I figured it out, this is how you use icustom as is:

double LWMACrossup = iCustom(NULL, 0, "LWMACrossoverSignal",5,6,0,1);
double LWMACrossdown = iCustom(NULL, 0, "LWMACrossoverSignal",5,6,1,1);

(I did change the name of the file so I wouldn't have to use dashes in the iCustom command.)

Thanks,

Y
Reply With Quote
  #4  
Old 05-31-2008, 03:53 PM
perfx perfx is offline
Junior Member
Live Trading Room Member
 
Join Date: May 2008
Posts: 3
Activity Longevity
0/20 8/20
Today Posts
ssssssss3
Send a message via Skype™ to perfx
Thumbs up Re: iCustom

Good indicator,

I guess that the MA used is on the "close", is it possible to choose the "open" price?

perfx
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump


Sponsored Links

All times are GMT. The time now is 07:52 PM.

FOREX RISK DISCLAIMER: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
© 2008, FX Instructor, LLC