Code Error Kindly Guide New comment Preet Kanwaljit Singh 2009.11.17 21:57 Kindly Guide on what could be wrong with the following code snipet, ------------------------------ //+------------------------------------------------------------------+ //| spread.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red double ExtMapBuffer[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,0,5,Red); SetIndexBuffer(0,ExtMapBuffer); SetIndexBuffer(1,ExtMapBuffer2); ObjectsDeleteAll(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- for (int i=0;i<Bars;i++) { ExtMapBuffer2[i] = iMomentum(Symbol(),0,14,PRICE_CLOSE,i); } for (i=0;i<Bars;i++) { ExtMapBuffer[i]=iMAOnArray(ExtMapBuffer2,Bars,5,0,MODE_SMA,i); } //---- return(0); } //+------------------------------------------------------------------+ Help on RSI please. Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. How to plot Profit & Loss? Nobody know? meikel 2009.11.17 22:18 #1 the code snippet is perfect, because it works like the programmer has coded it. if you are the programmer and expected other results, we should at least know what you expected and what the real results are... Taskin Osman 2009.11.17 22:54 #2 looks like quiz ;) New comment
Kindly Guide on what could be wrong with the following code snipet,
------------------------------
//+------------------------------------------------------------------+
//| spread.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
double ExtMapBuffer[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,5,Red);
SetIndexBuffer(0,ExtMapBuffer);
SetIndexBuffer(1,ExtMapBuffer2);
ObjectsDeleteAll();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
for (int i=0;i<Bars;i++)
{
ExtMapBuffer2[i] = iMomentum(Symbol(),0,14,PRICE_CLOSE,i);
}
for (i=0;i<Bars;i++)
{
ExtMapBuffer[i]=iMAOnArray(ExtMapBuffer2,Bars,5,0,MODE_SMA,i);
}
//----
return(0);
}
//+------------------------------------------------------------------+