[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 268

 
Bora:

Hello!

Please advise, if it's not difficult: how to write EA results to file without deleting previous entries. I use function FileHandle=FileOpen(FileName,FILE_CSV|FILE_READ|FILE_WRITE,";"); but only last record is saved, at new tick the old record is reset or deleted.


After opening move pointer to the end of the file:

FileSeek(handle, 0, SEEK_END);

 
Vovo4ka:

I want to write an indicator to display the closing price ratio with a period of 51 and 34 ... but something got confused ... how to display what would be visible on the entire history ... look at pliz ...


#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Teal

//---- input parameters
extern int Nom1=51;
extern int Nom2=34;
extern int CountBars=3000;

double MomBuffer[];
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator line
   SetIndexBuffer(0, MomBuffer);
   SetIndexStyle(0,DRAW_LINE);
   
//----
   return(0);
  }

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
   if (CountBars>Bars) CountBars=Bars;

   int i,counted_bars=IndicatorCounted();
   double Sum,Sum1,Sum2, otn;
   int limit=Bars-counted_bars-1;
   if (limit>1) limit = CountBars
     
   for (i=limit;i>=0; i--)
   { 
      sum1=iMA(NULL, 0, Nom1, 0, MODE_SMA, PRICE_CLOSE, i);
      sum2=iMA(NULL, 0, Nom2, 0, MODE_SMA, PRICE_CLOSE, i);
      MomBuffer[i]=0;
      if (sum2>0) MomBuffer[i]=sum1/sum2;
   }
   return(0);
}
//+------------------------------------------------------------------+
 
zatro:
I have the following question: How to switch timeframes simultaneously on several currency pairs (simultaneously). Thank you in advance.
There is no such a button. But it can be done programmatically. However, it will never happen literally at the same time. It will always happen in different clock cycles of the processor.
 

Dear professionals!

What am I doing wrong again? I want to try this indicator in my EA, but it doesn't give any readings in the comments or in the printout, or rather it does, but nothing:

  double Roc = iCustom(NULL,0,"ROC",12,1,0);
Please check it!
 
borilunad:

Dear professionals!

What am I doing wrong again? I want to try this indicator in my EA, but it doesn't give any readings in the comments or in the printout, or rather it does, but nothing:

Please check it!

which indicator?
 
sergeev:

which indicator?


Price Rate of Change

But it's already working! Put 1 at the end as the EA works on bar opening. Sorry for the inconvenience! Thank you!

 

The indicator forms several hundreds of OBJ_TRENDsegments on the history interval .You need to output the difference of values (OBJPROP_TIME2 - OBJPROP_TIME1) for each object into an array.

Question: is there a direct access to the object property storage or should I loop through all the objects to get the required data? Thanks for the answer, sorry if it's a silly question!

 
Vinin:



Thank you very much)))
 
ilunga:

after opening, move pointer to end of file:

FileSeek(handle, 0, SEEK_END);


Thank you
 
Again I am unable to register on mql5, what should I do?