Êîä:
Äåðæèò ðàáî÷èé êîä
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DarkGreen
#property indicator_color2 Red
//----
extern string Commen="-- Futures Ticker or AUTO";
extern string Instrument="AUTO";
extern int Update_in_sec=60;
extern string MetaTrader_GTM="AUTO";
//----
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
ObjectsDeleteAll();
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexBuffer(0,ExtBuffer1);
SetIndexBuffer(1,ExtBuffer2);
IndicatorShortName("TEST CVD");
return(0);
}
int deinit()
{
//----
ObjectsDeleteAll();
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{ // START
int i, limit;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
//----
for(i=0; i<limit; i++)
{ // FOR
//#################################################################
double negative =iCustom(Symbol(),0,"ClusterDelta_CumDelta","__", Instrument,Update_in_sec,MetaTrader_GTM,0,i);
double positive; ///=iCustom(Symbol(),0,"ClusterDelta_CumDelta","__", Instrument,Update_in_sec,MetaTrader_GTM,1,i); // error
//#################################################################
ExtBuffer1[i] = negative;
//ExtBuffer2[i] = positive;
//**********************************************************************************
}
Comment("\n\n TEST CVD \n",
"\n@@@@@@@@ KETRON82 @@@@@@@@ \n",
"@ testnegative: ",DoubleToStr(negative,8)," @\n",
"@ testpositive: ",DoubleToStr(positive,8)," @\n",
"@@@@@@@@ KETRON82 @@@@@@@@ \n");
//#################################################################
return(0);
} // START
//+-------------------------------