Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 772

 

Please help with history on CopyClose

I have been working with A for several years now, and I have no problems

I've heard a lot about the innovations on the fourth, and I've started to create an Expert Advisor and immediately encountered a problem with

   double History[];
   for(i=0;i<20;i++)
     {
   int hist=CopyClose(_Symbol,PERIOD_CURRENT,0,20000,History);
   Alert("hist:",i,"|",hist);Sleep(1000);
      if (hist==20000) break;
     }

I tried to use it with tester, it gets only 1001 candles and of course"array out of range".

2014.11.11 09:46:29.714 2014.10.01 00:00 array out of range in 'Attraction_v2.mq4' (85,38)

2014.11.11 09:46:29.714 2014.10.01 00:00 Attraction_v2 EURUSD,M1: Alert: hist:18|1001

history is enough, what's wrong?

 
OlegTs:

Please help with history on CopyClose

I have been working with A for several years now, and I have no problems

I've heard a lot about the innovations on the fourth, and I've started to create an Expert Advisor and immediately encountered a problem with

I tried to use it with tester, it gets only 1001 candles and of course "array out of range".

2014.11.11 09:46:29.714 2014.10.01 00:00 array out of range in 'Attraction_v2.mq4' (85,38)

2014.11.11 09:46:29.714 2014.10.01 00:00 Attraction_v2 EURUSD,M1: Alert: hist:18|1001

history is enough, what's wrong?

a tester can only look that deep
 
advise if there is an analogue of the program mt4mm or a solution to the problem with its freezing on Win7 64 bit ?
 
evillive:
The tester can only look this deep

i.e. the same as usual, test on a five, redo for a four? it looks like we'll have to forget about a four again for a few years)

Thank you!

 
Escapee:
What command would the script copy the value to the clipboard?
Evillive:
There aren't any ready-made ones. It's easier to write to a file, at least there are functions for that(FileWrite).

Valuable advice, it worked for me. How do I make it not rewrite the information in the file, but add a new line?

void OnStart()
{

int filehandle;

filehandle=FileOpen("1.txt",FILE_WRITE|FILE_CSV);

FileWrite(filehandle,AccountProfit();

FileClose(filehandle);

}

 

FileSeek(file_handle, 0, SEEK_END) - to move the place of record to the end of file

and probably open file with FILE_READ | FILE_WRITE flag.

 
ALXIMIKS:

Oh, great! Thanks

p.s. yes - about the FILE_READ|FILE_WRITE flag

 
Alexandr24:
any idea if there is an analogue of mt4mm or a solution to the problem with it freezing on Win7 64 bit ?
Does everyone set lot size manually? :(
 
Alexandr24:
Does everyone set the lot size manually? :(
Why manually, everyone calculates the lot according to their own taste.
 

Hello!

I need an RSI crossing impulse of a certain value, say 70.

The usual condition iRSI (shake, shake, shake) >70 does not work for me, because on subsequent bars, if the RSI is higher than this value, the "ringing" continues.

And I need exactly the moment of crossing and further silence.

The structure does not seem to

if(iRSI(NULL,0,14,PRICE_CLOSE,0)>70 && iRSI(NULL,0,14,PRICE_CLOSE,1)<70) Comment("1!!!!!!!!!!!");

  else Comment("0...");

does not work.

What am I doing wrong? Please advise!

Reason: