помогите в коде советнике правильно указать ссылку на индикатор

 

Пытаюсь написать советника, который будет открывать ордера по сигналу советника - стрелке вверх или вниз. Но появилась проблема как правильно вызвать в советнике указание на стрелку.

То что смог написал код, может кто подскажет что не так?



параметры:::::::::::::::::::::::::::::::::::::::::::::


#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1  Lime
#property indicator_color2  Lime
#property indicator_color3  Red
#property indicator_color4  Red
#property indicator_color5  DodgerBlue
#property indicator_color6  Red
#property indicator_width1  2
#property indicator_width3  2
#property indicator_width5  2
#property indicator_width6  2
#property indicator_level1  0
#property indicator_level2   76.4
#property indicator_level3  -76.4
#property indicator_levelcolor Gold





extern string TimeFrame                 = "Current time frame";
extern double Period1                   =   8;//32
extern double Period2                   =   5;
extern double Period3                   =   5;
extern int    Price                     = PRICE_CLOSE;
extern bool   divergenceVisible         = true;//********* NB
extern bool   divergenceOnValuesVisible = true;
extern bool   divergenceOnChartVisible  = true;
extern color  divergenceBullishColor    = LimeGreen;
extern color  divergenceBearishColor    = OrangeRed;
extern string divergenceUniqueID        = "Blau tsi divergence1";
extern bool   Interpolate               = true;
extern bool   ShowArrows                = true ;//****
extern string ArrowsIdentifier          = "BlauTSI arrows";
extern double ArrowsUpGap               = 0.15;//0.75
extern double ArrowsDownGap             = 0.55;//*********
extern color  ArrowUpColor              = Yellow;//LimeGreen;
extern int    ArrowUpWidth              = 2;
extern color  ArrowDownColor            = Yellow;//PaleVioletRed;
extern int    ArrowDownWidth            = 2;
extern bool   ShowHistogram             = false;


double tsi[];
double tsihuu[];
double tsihud[];
double tsihdd[];
double tsihdu[];
double signal[];
double slope[];
double trend[];

//
//
//
//
//

string shortName;
string indicatorFileName;
bool   returnBars;
bool   calculateValue;
bool   calculateMa;
int    timeFrame;




встевляем в в инт int init()::::::::::::::::::::::::::::::::::::::::::::::
int type = DRAW_NONE; if (ShowHistogram) type = DRAW_HISTOGRAM;
   IndicatorBuffers(8);
   SetIndexBuffer(0,tsihuu); SetIndexStyle(0, type);
   SetIndexBuffer(1,tsihud); SetIndexStyle(1, type);
   SetIndexBuffer(2,tsihdd); SetIndexStyle(2, type);
   SetIndexBuffer(3,tsihdu); SetIndexStyle(3, type);
   SetIndexBuffer(4,tsi);
   SetIndexBuffer(5,signal);
   SetIndexBuffer(6,slope);
   SetIndexBuffer(7,trend);


      indicatorFileName = WindowExpertName();
      returnBars        = (TimeFrame=="returnBars");     if (returnBars)     return(0);
      calculateValue    = (TimeFrame=="calculateValue");
      if (calculateValue)
      {
         int s = StringFind(divergenceUniqueID,":",0);
               shortName = divergenceUniqueID;
               divergenceUniqueID = StringSubstr(divergenceUniqueID,0,s);
               return(0);
      }           
      timeFrame = stringToTimeFrame(TimeFrame);
     
      //
      //
      //
      //
      //
     
      shortName = divergenceUniqueID+": "+timeFrameToString(timeFrame)+" true strength index ("+DoubleToStr(Period1,1)+","+DoubleToStr(Period2,1)+","+DoubleToStr(Period3,1)+")";
      IndicatorShortName(shortName);  
   return(0);
}

вставляем в функцию старт:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


double d=iCustom(NULL, timeFrame, Blau -ergodic -tsi & divergence 2.01, Period1, Period2, Period3, Price, divergenceVisible, divergenceOnValuesVisible, divergenceOnChartVisible, divergenceBullishColor, divergenceBearishColor, divergenceUniqueID,  Interpolate, ShowArrows, ArrowsIdentifier, ArrowsUpGap, ArrowsDownGap, ArrowUpColor, ArrowUpWidth, ArrowDownColor, ArrowDownWidth, ShowHistogram.0,1);


double d1=iCustom(NULL, timeFrame, Blau -ergodic -tsi & divergence 2.01, Period1, Period2, Period3, Price, divergenceVisible, divergenceOnValuesVisible, divergenceOnChartVisible, divergenceBullishColor, divergenceBearishColor, divergenceUniqueID,  Interpolate, ShowArrows, ArrowsIdentifier, ArrowsUpGap, ArrowsDownGap, ArrowUpColor, ArrowUpWidth, ArrowDownColor, ArrowDownWidth, ShowHistogram.1,1);





 
Для начала в кавычки возьмите имя индикатора. И проверьте правильность написания его имени (лучше взять копипастом из редактора).
double d1=iCustom(NULL, timeFrame, "Blau -ergodic -tsi & divergence 2.01",...
 
d124:

Пытаюсь написать советника, который будет открывать ордера по сигналу советника - стрелке вверх или вниз. Но появилась проблема как правильно вызвать в советнике указание на стрелку.

То что смог написал код, может кто подскажет что не так?



параметры:::::::::::::::::::::::::::::::::::::::::::::


#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1  Lime
#property indicator_color2  Lime
#property indicator_color3  Red
#property indicator_color4  Red
#property indicator_color5  DodgerBlue
#property indicator_color6  Red
#property indicator_width1  2
#property indicator_width3  2
#property indicator_width5  2
#property indicator_width6  2
#property indicator_level1  0
#property indicator_level2   76.4
#property indicator_level3  -76.4
#property indicator_levelcolor Gold





extern string TimeFrame                 = "Current time frame";
extern double Period1                   =   8;//32
extern double Period2                   =   5;
extern double Period3                   =   5;
extern int    Price                     = PRICE_CLOSE;
extern bool   divergenceVisible         = true;//********* NB
extern bool   divergenceOnValuesVisible = true;
extern bool   divergenceOnChartVisible  = true;
extern color  divergenceBullishColor    = LimeGreen;
extern color  divergenceBearishColor    = OrangeRed;
extern string divergenceUniqueID        = "Blau tsi divergence1";       <----имя индюка
extern bool   Interpolate               = true;
extern bool   ShowArrows                = true ;//****
extern string ArrowsIdentifier          = "BlauTSI arrows";
extern double ArrowsUpGap               = 0.15;//0.75
extern double ArrowsDownGap             = 0.55;//*********
extern color  ArrowUpColor              = Yellow;//LimeGreen;
extern int    ArrowUpWidth              = 2;
extern color  ArrowDownColor            = Yellow;//PaleVioletRed;
extern int    ArrowDownWidth            = 2;
extern bool   ShowHistogram             = false;


double tsi[];
double tsihuu[];
double tsihud[];
double tsihdd[];
double tsihdu[];
double signal[];
double slope[];
double trend[];

//
//
//
//
//

string shortName;
string indicatorFileName;
bool   returnBars;
bool   calculateValue;
bool   calculateMa;
int    timeFrame;




встевляем в в инт int init()::::::::::::::::::::::::::::::::::::::::::::::
int type = DRAW_NONE; if (ShowHistogram) type = DRAW_HISTOGRAM;
   IndicatorBuffers(8);
   SetIndexBuffer(0,tsihuu); SetIndexStyle(0, type);
   SetIndexBuffer(1,tsihud); SetIndexStyle(1, type);
   SetIndexBuffer(2,tsihdd); SetIndexStyle(2, type);
   SetIndexBuffer(3,tsihdu); SetIndexStyle(3, type);
   SetIndexBuffer(4,tsi);
   SetIndexBuffer(5,signal);
   SetIndexBuffer(6,slope);
   SetIndexBuffer(7,trend);


      indicatorFileName = WindowExpertName();
      returnBars        = (TimeFrame=="returnBars");     if (returnBars)     return(0);
      calculateValue    = (TimeFrame=="calculateValue");
      if (calculateValue)
      {
         int s = StringFind(divergenceUniqueID,":",0);
               shortName = divergenceUniqueID;
               divergenceUniqueID = StringSubstr(divergenceUniqueID,0,s);
               return(0);
      }           
      timeFrame = stringToTimeFrame(TimeFrame);
     
      //
      //
      //
      //
      //
     
      shortName = divergenceUniqueID+": "+timeFrameToString(timeFrame)+" true strength index ("+DoubleToStr(Period1,1)+","+DoubleToStr(Period2,1)+","+DoubleToStr(Period3,1)+")";
      IndicatorShortName(shortName);  
   return(0);
}

вставляем в функцию старт:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


double d=iCustom(NULL, timeFrame,  "имя индюка -->Blau -ergodic -tsi & divergence 2.01", Period1, Period2, Period3, Price, divergenceVisible, divergenceOnValuesVisible, divergenceOnChartVisible, divergenceBullishColor, divergenceBearishColor, divergenceUniqueID,  Interpolate, ShowArrows, ArrowsIdentifier, ArrowsUpGap, ArrowsDownGap, ArrowUpColor, ArrowUpWidth, ArrowDownColor, ArrowDownWidth, ShowHistogram.0,1);


double d1=iCustom(NULL, timeFrame, "имя индюка -->Blau -ergodic -tsi & divergence 2.01", Period1, Period2, Period3, Price, divergenceVisible, divergenceOnValuesVisible, divergenceOnChartVisible, divergenceBullishColor, divergenceBearishColor, divergenceUniqueID,  Interpolate, ShowArrows, ArrowsIdentifier, ArrowsUpGap, ArrowsDownGap, ArrowUpColor, ArrowUpWidth, ArrowDownColor, ArrowDownWidth, ShowHistogram.1,1);







несоответствие имени индюка , издесь непонятно .... ShowHistogram"  .  "1,1); правильно  .....ShowHistogram,1,1); параметры разделяются не точками

extern string TimeFrame                 = "Current time frame"; здесь тоже не правильно 

timeframe  -  Период. Может быть одним из периодов графика. 0 означает период текущего графика.

 

double val=iCustom(NULL, 0, "SampleInd",13,1,0);