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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2007, 05:38 PM
Junior Member
 
Join Date: Feb 2007
Posts: 4
savio12 is on a distinguished road
why division don't works??

it's impossible to calculate this:

why??????
Attached Files
File Type: mq4 indicatore base2.mq4 (1.8 KB, 39 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-15-2007, 01:37 PM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 2,814
Blog Entries: 31
Linuxser has disabled reputation
Because a number divided by itself is equal to zero.

dResult = (dLow/(dHigh+0.0000001));

Is that what you want?

zero.gif
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-17-2007, 11:29 AM
Junior Member
 
Join Date: Mar 2007
Posts: 1
skero6 is on a distinguished road
it's no the same number because dlow is the previous imomentum value and dhigh is the present(today) value of imomentum. previous\present is my purpose but it 's impossible to calculate.


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


//| My_First_Indicator.mq4 |
//| Codersguru |
//| http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Codersguru"
#property link "http://www.forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,ExtMapBuffer1);
string short_name = "Your first indicator is running!";
IndicatorShortName(short_name);
//----
return(1);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
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--;
int pos=Bars-counted_bars;
double dHigh , dLow , dResult,dresult2;
Comment("Hi! I'm here on the main chart windows!");
//---- main calculation loop
while(pos>=0)
{
dHigh = iMomentum(NULL,0,5,PRICE_CLOSE,pos);
dLow = iMomentum(NULL,0,5,PRICE_CLOSE,pos+1);
dResult = (dLow/(dHigh));\\\ previous/today value

ExtMapBuffer1[pos]= dResult ;
pos--;
}
//----
return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-17-2007, 05:11 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
You should ensure the momentum lookback period has been accounted for, as well as the check-for-zero...........

PHP Code:
//--------------------------------+


//| My_First_Indicator.mq4 |
//| Codersguru |
//| http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Codersguru"
#property link "http://www.forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int Momentum_Period 5;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,ExtMapBuffer1);
string short_name "Your first indicator is running!";
IndicatorShortName(short_name);
//----
return(1);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars Momentum_Period)
 
int pos=Bars-Momentum_Period-1;
else 
pos=Bars-counted_bars-1;
double dHigh dLow dResult,dresult2;
Comment("Hi! I'm here on the main chart windows!");
//---- main calculation loop
while(pos>=0)
{
dHigh iMomentum(NULL,0,Momentum_Period,PRICE_CLOSE,pos);
dLow iMomentum(NULL,0,5,PRICE_CLOSE,pos+1);
dResult dLow/dHigh// previous/today value

ExtMapBuffer1[pos]= dResult ;
pos--;
}
//----
return(0);


Last edited by omelette; 03-17-2007 at 05:15 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Really Works From One Professional 006 General Discussion 1007 02-23-2008 01:30 AM
could someone tell me *AT LEAST ONE* EA which works? giraia_br Post and compare Trades 54 06-28-2007 04:46 PM
Does anyone have an EA that Works???? blewsky Metatrader 4 48 05-12-2007 01:48 PM
what works ? ligerny General Discussion 3 07-12-2006 11:44 PM
EA works on some charts not on others? cardio Setup Questions 2 06-13-2006 10:54 AM


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



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