Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-04-2007, 06:31 PM
Member
 
Join Date: Jan 2006
Posts: 31
bluefish is on a distinguished road
iMAonArray problem

Hi guys!

I´m learning mq4 and I´m following the various articles I find on the web. I´m now playing with iMAonArray function, but I can´t get it work right. I wrote/changed my first indicator, but when I view chart, which doesn´t include the very last bar, everything works fine. But when I scroll forward to the latest bar, moving average lines change the scale, so that I can´t use them. Refresh helps, but only until the next tick comes.
It is really simple, Moving average, thant MA of that first MA and histogram shows the difference between those two.
Anybody has any ideas?
Maybe, if anybody could share some learning material or mq4 code, where I could dive into it and understand the inner workings of MQ4 language, I would appreciate it a lot.

Thanks in advance

Bluefish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 08-04-2007, 07:41 PM
mobdeep386's Avatar
Junior Member
 
Join Date: Sep 2006
Posts: 17
mobdeep386 is on a distinguished road
when you write iMAOnArray on the editor ,just type "F1" an help box below will appear
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 08-07-2007, 12:23 PM
DanielTyrkiel's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 176
DanielTyrkiel is on a distinguished road
Hey Blue,
how did you like the tutorial posted by CodersGuru on this forum?


ps. any chance for updating the st2w diary ?
__________________
Think for Yourself, Question Authority

SKYPE: danieltyrkiel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 09-07-2008, 05:58 PM
Member
 
Join Date: Jan 2008
Posts: 47
Pussy Galore is on a distinguished road
Strange behaviour using iMAOnArray

I have modified an indicator which has 2 existing buffers to include iMAOnArray on 1 of the buffers. I have coded the first 2 buffers to DRAW_NONE and the 3 iMAOnArray buffers to DRAW_LINE.

If I add the indicator to a chart it does not plot the iMAOnArray buffers and instead returns a strange value for them as in the image.



If I then compile the indicator with it already attached to the chart it will plot as intended as in this image.



If I then try to alter the indicator inputs, it will fail to plot again.

This is the code:

PHP Code:
int start()
  {
                                
   
// UPBuffer[0] = Trend_UP;
   // DOWNBuffer[0] = Trend_DOWN;
   
//---- Result of the trend

   
   
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>0counted_bars--; 
//  limit=Bars-counted_bars; 

   
if(counted_bars>0limit=Bars-counted_bars;
   
limit--; 

int maxvalue;
if (
firstrun) {maxvalue=lookback;firstrun=false;} else {maxvalue=2;}


{
       for(
int i=maxvaluei>=0i--)   
//       for(int i=0; i<=maxvalue; i++)   
       
{
        
calcola(i);
        
RANGEBuffer[i]        = StrToDouble(Trend_UP) ;
        
RANGEBuffer1[i]       = StrToDouble(Trend_DOWN) ;
        
RANGEBufferfast[i]    = iMAOnArray(RANGEBuffer,0,Fast_ema,0,MODE_EMA,i);
        
RANGEBuffermedium[i]  = iMAOnArray(RANGEBuffer,0,Medium_ema,0,MODE_EMA,i);
        
RANGEBufferslow[i]    = iMAOnArray(RANGEBuffer,0,Slow_sma,0,MODE_SMA,i);
       } 
// for 
}
      
   return(
0);

Could somebody please explain what I'm doing wrong?

Last edited by Pussy Galore; 09-07-2008 at 07:33 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
imaonarray


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
any one know the problem here? gm6510 Expert Advisors - Metatrader 4 10 07-07-2007 01:06 AM
Is iMAOnArray() 'broken'.....? omelette General Discussion 6 04-30-2007 01:28 AM
Problem with .ex4................. EFX General Discussion 4 10-21-2006 08:23 AM
Urgent: iMAOnArray and IMA? alanlaw Questions 2 12-20-2005 06:58 PM
I've a Problem here hellkas Metatrader 4 6 11-04-2005 01:30 AM


All times are GMT. The time now is 10:18 PM.



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