Вывод на экран Arrows - страница 2

 

а не все уже вышло я просто успел натупить в коде)))

спс Techno за идею и за помощь!!!

 
стер в коментарии обнуление масивов)))
 
))
 

хм...только кажеться он выводит не первый арровс а последний)

 
выложи код, разберемся. не хочешь сюда, можешь в персональные сообщения
 

//+------------------------------------------------------------------+
//| MA.mq4 |
//| Виктор В. |
//| |
//+------------------------------------------------------------------+
#property copyright "Виктор В."
#property link ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 Red
//---- input parameters
extern int barsToProcess=1000;
extern int work=3;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,108);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,108);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexEmptyValue(1,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int limit;

if(counted_bars>0)
counted_bars--;

limit=Bars-counted_bars;
if(limit>barsToProcess)
limit=barsToProcess;

for(int i=0;i<limit;i++)
{
double CurMa=iMA(NULL,0,26,0,MODE_EMA,PRICE_CLOSE,i);
double PrevMa=iMA(NULL,0,26,0,MODE_EMA,PRICE_CLOSE,i+1);

ExtMapBuffer1[i]=0.0;
ExtMapBuffer2[i]=0.0;

if ((CurMa>PrevMa) && (work==3 || work==2))
{
ExtMapBuffer1[i]=Low[i];
work=1;
}
if ((CurMa<PrevMa) && (work==3 || work==1))
{
ExtMapBuffer2[i]=High[i];
work=2;
}
}
//----
return(0);
}
//+------------------------------------------------------------------+

 
дальность определяется велечиной extern int barsToProcess=1000; замени 1000 на 100000 ну и радиус действия расширится
 

та нет дело не в дальности это понятно а в том что индикатор начинает рисовать арровс от последнего бара к 1000му т.е.:

МА начал падать ---> падает падает ----> закончил падать и мне нарисовался арровс а мне надо в начале падения МА выводить красный арровс

Причина обращения: