| New signals service! | |
|
|||||||
| 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 | Display Modes |
|
||||
|
Because a number divided by itself is equal to zero.
dResult = (dLow/(dHigh+0.0000001)); Is that what you want? zero.gif
__________________
|
|
|||
|
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); } |
|
|||
|
You should ensure the momentum lookback period has been accounted for, as well as the check-for-zero...........
PHP Code:
Last edited by omelette; 03-17-2007 at 05:15 PM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |