советник работает только ордерами на той паре на какой он установлен?Почитайте внимательно: opentraders.ru/downloads/699/ Я же там специально жирным отметила.
если я тут оч.многого нажелал...не то, чтобы вы много нажелали… вы книжки писать не пробовали?
//+------------------------------------------------------------------+
//| Ind_bySchaffTrendCycle.mq4 |
//| Oxy |
//| http://oxy.opentraders.ru/bio/ |
//+------------------------------------------------------------------+
#property copyright "Oxy"
#property link "http://oxy.opentraders.ru/bio/"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
//---- plot Line
#property indicator_label1 "ARROW_UP"
#property indicator_color1 clrGreen
#property indicator_label2 "ARROW_DN"
#property indicator_color2 clrRed
//------- Внешние параметры -----------------------------------------+
extern string name1 = "__________SchaffTrendCycle__________"; // Параметры SchaffTrendCycle
extern int MAShort = 23; // MAShort - SchaffTrendCycle
extern int MALong = 50; // MALong - SchaffTrendCycle
extern int Cycle = 10; // Cycle - SchaffTrendCycle
extern string name2 = "________параметры_индикатора________"; // Параметры индикатора
extern bool showAlert = true; // Показывать алерт
extern int arr_thickness = 1; // Размер стрелок
extern int otstup = 50; // Отступ для стрелки в пунктах
extern int level1 = 25; // level1 у SchaffTrendCycle
extern int level2 = 75; // level2 у SchaffTrendCycle
//------- Глобальные переменные -------------------------------------+
//--- indicator buffers
double arrow_Buffer_UP[], arrow_Buffer_DN[];
string nameInd = "SchaffTrendCycle";
string Symb = Symbol();
datetime alertTime = -1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if(arr_thickness<1) arr_thickness=1;
SetIndexBuffer(0, arrow_Buffer_UP);
SetIndexStyle (0, DRAW_ARROW, STYLE_SOLID, arr_thickness);
SetIndexArrow (0, 233);
SetIndexBuffer(1, arrow_Buffer_DN);
SetIndexStyle (1, DRAW_ARROW, STYLE_SOLID, arr_thickness);
SetIndexArrow (1, 234);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
if(prev_calculated==0) {
int _total = rates_total-(MALong + Cycle * 2)-2;
for(int i=_total; i>0; i--) {
draw_arrows (i);
}
}
if(prev_calculated>0 && prev_calculated<rates_total) {
RefreshArrows(0);
}
if (showAlert && alertTime!=Time[1]) {
double _ind_0 = iCustom (Symb, 0, nameInd, MAShort, MALong, Cycle, 0, 0);
double _ind_1 = iCustom (Symb, 0, nameInd, MAShort, MALong, Cycle, 0, 1);
bool _alert = false;
if (_ind_1<level1 && _ind_0>=level1) {
alertTime=Time[1];
Alert(Symb, ": индикатор SchaffTrendCycle level = ", level1);
_alert = true;
}
if (_ind_1>level2 && _ind_0<=level2) {
alertTime=Time[1];
Alert(Symb, ": индикатор SchaffTrendCycle level = ", level2);
_alert = true;
}
if(_alert) RefreshArrows(0);
}
return(rates_total);
}
//+------------------------------------------------------------------+
void RefreshArrows (int j=0) {
for(int i=5; i>=j; i--) {
draw_arrows (i);
}
}
//+------------------------------------------------------------------+
void draw_arrows (int i) {
arrow_Buffer_UP [i] = EMPTY_VALUE;
arrow_Buffer_DN [i] = EMPTY_VALUE;
double _ind_0 = iCustom (Symb, 0, nameInd, MAShort, MALong, Cycle, 0, i);
double _ind_1 = iCustom (Symb, 0, nameInd, MAShort, MALong, Cycle, 0, i+1);
if (_ind_1<level1 && _ind_0>=level1) {
arrow_Buffer_UP[i] = Low[i]-otstup*Point;
}
if (_ind_1>level2 && _ind_0<=level2) {
arrow_Buffer_DN[i] = High[i]+otstup*Point;
}
}
//+------------------------------------------------------------------+
Oxy