Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 04-26-2006, 10:21 AM
alosh alosh is offline
Junior Member
 
Join Date: Nov 2005
Posts: 6
alosh is on a distinguished road
Exclamation can you please help...



hi

can you please help me with these...

i do not get any lines in the main chart !!!



Code:
//+------------------------------------------------------------------+
//|                                                      testing.mq4 |
//|                                                        bbb|
//|                                                    aaa 
//+------------------------------------------------------------------+
#property copyright "bbb"
#property link      "aaa"

#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 3
/*#property indicator_color1 
#property indicator_color2 
#property indicator_color3 */
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DASH,3,Red);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH,3,Blue);
   SetIndexBuffer(1,ExtMapBuffer2);
      SetIndexStyle(2,DRAW_LINE,STYLE_DASH,3,Yellow);
   SetIndexBuffer(2,ExtMapBuffer3);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;





   double ExtMapBuffer1=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,0);
   double ExtMapBuffer2=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,0);
   
   double ExtMapBuffer3=iMomentum(NULL,0,12,PRICE_CLOSE,0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-26-2006, 10:35 AM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 350
elihayun is on a distinguished road
the buffers u assign value to, missed the index

ExtMapBuffer1[idx]=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer2[idx]=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,idx);

ExtMapBuffer3[idx]=iMomentum(NULL,0,12,PRICE_CLOSE,idx);


you have to have loop to accomplish this. something like



int limit=Bars-IndicatorCounted();

for (int idx = 0; idx < limit; idx++)
{
ExtMapBuffer1[idx]=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer2[idx]=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,idx);

ExtMapBuffer3[idx]=iMomentum(NULL,0,12,PRICE_CLOSE,idx);
}



by using double ExtMapBuffer1 ... u are creating new variables and not using the original buffers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-26-2006, 11:08 AM
alosh alosh is offline
Junior Member
 
Join Date: Nov 2005
Posts: 6
alosh is on a distinguished road
elihayun

elihayun an a 1000000.99 thanx for you...

and a for me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



All times are GMT. The time now is 02:39 PM.