[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 245

 
deyron:
Good afternoon. I have solved the issue of passing data from the indicator through the buffer to the Expert Advisor with some crunch. But again a mishap, the passed value comes with a delay of several bars ((.
In the indicator, from the place where I pass the flag to the buff (0,1,-1) I build trend lines in the indicator using these values. In the indicator everything is rendered as it should be, but the same calculations in the Expert Advisor draw the levels with a delay of several bars.
What may be the problem? Ask me a vector code.

Please give me the code
 
Good day! Could you please tell me if the indicator can switch timeframes?
 

In the indicator:

   
   Buff_Sign[];
   int init(){SetIndexBuffer(5,Buff_Sign);}

   int start(){
   Buff_Sign[i]=-1;
   /*Условие для Crit: Crit=0 Crit=1 */
   Buff_Sign[i]=Crir;     //это значене уходит в буфер
   
   if(Buff_Sign[i]==0 || Buff_Sign[i]==1){/* расчет для тренд. линий */ }}

in the EA:

 double Sign=iCustom(Symbol(),0,"Sign",5,5);     
   if(Sign==0 || Sign==1){/* тот же самый расчет для тренд. линий  только берется max и min*/ }

The end result is:

That's about it. What else to add?

 
Dimka-novitsek:
Good day! Could you please tell me if you can switch timeframes in the indicator?
Dima! I'll give you the link, of course, but don't blame me when all sorts of nonsense and glitches start to occur. This is not an standard solution for mql.
Software switching of TFs
 
Dimka-novitsek:
Good day! Could you please tell me if you can switch timeframes in the indicator?
Here is a library with functions that can switch timeframes and not only timeframes.
 

Good afternoon.

This is how I draw the line in the indicator

           string VLINE_PT=OBJECT_PREFIX+TimeToStr(iTime( NULL, 0, f));
           ObjectCreate(VLINE_PT, OBJ_VLINE, 0, T, 0);
           ObjectSet     (VLINE_PT, OBJPROP_TIME1, T);
           ObjectSet     (VLINE_PT, OBJPROP_WIDTH, 2);
           ObjectSet     (VLINE_PT, OBJPROP_STYLE, 0);
           ObjectSet     (VLINE_PT, OBJPROP_COLOR, Red);

I try to remove it like this

ClearVLine();

void ClearVLine() 
{ 
  for(int i=ObjectsTotal()-1;i>=0;i--) if(StringFind(ObjectName(i),OBJECT_PREFIX)==0) ObjectDelete(ObjectName(i)); 
}
it's not deleting, what's the problem?
 
THANK YOU all!!!!!!!!!!!!!!
 
Can you tell me if there are any standard functions used in MQL4. For example, if there is an iStochastic, is there any way to find out how the firm has described them?
 
Stells:

Good afternoon.

This is how I draw the line in the indicator

I try to remove it like this

ClearVLine();

It doesn't clear, what's the problem?
Where is OBJECT_PREFIX initialised?
 
paladin80:
Can you tell me if there are any standard functions used in MQL4. For example, if there is an iStochastic, is there any way to find out how the firm has described them?


https://www.mql5.com/ru/articles/1422

Reason: