Go Back   BabyPips.com Forex Forum > Main Discussion > Forextown


Forextown The magical town where all traders can gather together to discuss anything and everything about the Forex. Also, check out our main Forex site for more Forex goodness.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-29-2007, 09:01 AM
Junior Member
 

Join Date: Jul 2007
Posts: 47
Question Mq4

I'm trying to figure out what to do with some data I've found.

When you have a file with an mq4 extension, does it always function the same way/go in the same folder in MT4?

I can't get a couple of files to work. To clarify, what I have is the text of the file. For instance, something that looks like this. This of course is the Alligator Just to show you what I'm dealing with. I don't have a file - what I have instead is text like this. Where do I put it? Is there something in the mq4 that tells me where to put it? Like for instance are some mq4's EA's and some custom indicators?



//+------------------------------------------------------------------+
//| Alligator.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Lime
//---- input parameters
extern int JawsPeriod=13;
extern int JawsShift=8;
extern int TeethPeriod=8;
extern int TeethShift=5;
extern int LipsPeriod=5;
extern int LipsShift=3;
//---- indicator buffers
double ExtBlueBuffer[];
double ExtRedBuffer[];
double ExtLimeBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- line shifts when drawing
SetIndexShift(0,JawsShift);
SetIndexShift(1,TeethShift);
SetIndexShift(2,LipsShift);
//---- first positions skipped when drawing
SetIndexDrawBegin(0,JawsShift+JawsPeriod);
SetIndexDrawBegin(1,TeethShift+TeethPeriod);
SetIndexDrawBegin(2,LipsShift+LipsPeriod);
//---- 3 indicator buffers mapping
SetIndexBuffer(0,ExtBlueBuffer);
SetIndexBuffer(1,ExtRedBuffer);
SetIndexBuffer(2,ExtLimeBuffer);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE);
//---- index labels
SetIndexLabel(0,"Gator Jaws");
SetIndexLabel(1,"Gator Teeth");
SetIndexLabel(2,"Gator Lips");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Bill Williams' Alligator |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- main loop
for(int i=0; i<limit; i++)
{
//---- ma_shift set to 0 because SetIndexShift called abowe
ExtBlueBuffer[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i) ;
ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i );
ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i) ;
}
//---- done
return(0);
}
//+------------------------------------------------------------------+

Last edited by Pipcrawler; 08-29-2007 at 10:30 AM. Reason: link violation
Reply With Quote
  #2 (permalink)  
Old 08-29-2007, 10:54 PM
Newbie
 

Join Date: Aug 2007
Posts: 4
Default

From my very brief experience with Metatrader, you take that file with the mq4 extension and put it in the /experts/indicators folder on your hard drive where you installed metatrader, then open up the MetaEditor, COMPILE the mq4 file and it should create a new file with an .ex4 extension.

The custom indicator should now be available in MT4.

Good Luck

Jason
Reply With Quote
Reply



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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:52 AM.
Content Relevant URLs by vBSEO 3.3.1
"Whether you think you can or think you can't, you're right."
Henry Ford
Feedback Form