minta tunjuk/betulkan untuk belajar
MTF AC ada x? mintak satu..

Olahan sendiri guna template Keris2112; nak dwn file tak boleh!
Mana Sifu tolong betulkan kalau terdapat kesalahan @ bug
//+-------------------------------------------------------------+
//| THANKS to Keris2112 for the #MTF-TEMPLATE code
//|
//| Accelerator converted to MTF format by Bear N Bull
//+-------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Red //Lime
#property indicator_color3 Lime //Red
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_level1 0.000
#property indicator_levelcolor RoyalBlue //Black
#property indicator_levelwidth 1
#property indicator_levelstyle 0
//---- input parameters
/*************************************************************************
PERIOD_M1 1
PERIOD_M5 5
PERIOD_M15 15
PERIOD_M30 30
PERIOD_H1 60
PERIOD_H4 240
PERIOD_D1 1440
PERIOD_W1 10080
PERIOD_MN1 43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
****************************************************************/
//---- indicator buffers
extern int TimeFrame=0;//
double ExtBuffer0[];
double ExtBuffer1[];
double ExtBuffer2[];
double ExtBuffer3[];
double ExtBuffer4[];
//+------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(5);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);//Histogram
SetIndexStyle(2,DRAW_LINE);//Histogram
IndicatorDigits(Digits+2);
SetIndexDrawBegin(0,38);
SetIndexDrawBegin(1,38);
SetIndexDrawBegin(2,38);
//---- 4 indicator buffers mapping
SetIndexBuffer(0,ExtBuffer0);
SetIndexBuffer(1,ExtBuffer1);
SetIndexBuffer(2,ExtBuffer2);
SetIndexBuffer(3,ExtBuffer3);
SetIndexBuffer(4,ExtBuffer4);
//---- name for DataWindow and indicator subwindow label
// IndicatorShortName("AC");
SetIndexLabel(1,NULL);
SetIndexLabel(2,NULL);
//---- initialization done
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Ctf";
}
IndicatorShortName("MTF_AC: ("+TimeFrameStr+")");
}
//----
return(0);
//+------------------------------------------------------------+
//| MTF |
//+------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
for(i=0,y=0;i<limit;i++)
{
if (Time
<TimeArray[y]) y++;
/***********************************************************
Add your main indicator loop below. You can add the full
indicator code or you can just reference an existing
indicator with its iValue or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
**********************************************************/
ExtBuffer1=iCustom(NULL,TimeFrame,"Accelerator",0,y);
ExtBuffer2=iCustom(NULL,TimeFrame,"Accelerator",1,y);
ExtBuffer3=iCustom(NULL,TimeFrame,"Accelerator",2,y);
ExtBuffer4=iCustom(NULL,TimeFrame,"Accelerator",3,y);
}
return(0);
}
//+--------------------