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

 
Is there some simple example of overwriting a string?
 
VOLDEMAR:
Is there some simple example of rewriting a string?
What's not to like about the example in the help?
 
AlexeyVik:
What's wrong with the example in the help?
Either it's complicated or it doesn't work ...
 

Help edit the script to transfer the report to the chart. I can't find the reason why it doesn't render...

Link to codebase.

Slightly tweaked version I have in the trailer. |

\ | /

\ /

\/

Files:
 

int RegisterWindowMessageA (string param);

there's probably a problem with this, we'll have to fiddle with it.

 
Heroix:

Help edit the script to transfer the report to the chart. I can't find the reason why it doesn't render...

The link is to the codebase.

Slightly tweaked version by me in the trailer.

1. There is no PostMessageA in the import, but there is one in the code.

2. Format has changed in communication with api (here is an example workingPavlick28.07.2014 17:24#)

 

Good afternoon please help. I am using a CCI indicator with period 34 and with period 170. I need to check if the CCI 170 crosses the nought line of the CCI 34. In other words, I want to see when the CCI 34 crosses the nought line first, and the CCI 170 crosses the nought line after it. At that moment, CCI 170 can have any value, and the zero lines of these indicators do not coincide on the chart.

How do I do this? Do I need to use graphic operators? Which ones and how? Thank you very much in advance.

 
VOLDEMAR:
Either it's complicated or it doesn't work.

What is the difficulty? Put a file pointer at the beginning of the string? Or replace line reading with writing?

Here, you got a hint.

r772ra:

FileSeek() to help.

Fetch from help:

//--- откроем файл
   int file_handle=FileOpen(InpDirectoryName+"//"+InpFileName,FILE_READ|FILE_TXT|InpEncodingType);
//////////////////////////////////

//--- получим позицию начала для каждой строки в файле
      GetStringPositions(file_handle,pos);
// Эту функцию возьми в справке.
///////////////////////////////////////

//--- сдвинем позицию на начало этой строки
      if(FileSeek(file_handle,pos[ind],SEEK_SET)==true)
// Здесь надо pos[ind] заменить на ArrayMaximum(). Это будет последняя строка.

////////////////////////////////////

//--- прочитаем и распечатаем строку с номером ind
         PrintFormat("Текст строки с номером %d: \"%s\"",ind,FileReadString(file_handle));
// А это замени на uint  FileWrite()
///////////////////

 
Zeta:

Good afternoon please help. I am using a CCI indicator with period 34 and with period 170. I need to check if the CCI 170 crosses the nought line of the CCI 34. In other words, I want to track the moment 1.when the CCI 34 crosses the nought line first, and then the CCI 170 crosses the nought line. At this point CCI 170 can have any value, the zero lines of these indicators on the chart do not coincide.

How do I do this? 2. doi need to use chart operators? Which ones and how? Many thanks in advance.


2. Why ?iCCI(......);

One option is:

1. Starting a counter. One or two is optional.

Next the algorithm for one counter:

1. Initialise 0.

Determine when the CCI(34) zero crossing occurs and initiate a counter. For example, if crossing UP, then +1, if DN -1.

3. If counter = 0 - wait for the next bar.

4. If the counter value is different from 0 - Check for CCI(170) crossing.

4.1 If there was no crossover, increase counter value UP/Decrease counter value DN.

4.1 If UP - Check counter value: if different from zero and less than the required value (e.g., we expect a CCI(170) crossing within 5 bars of a CCI(34) crossing - then a value of 5 is required).

4.1.2 If all conditions are met on the current bar or if more than the expected number of bars have passed - we reset the counter to 0 .

4.1.3 If the conditions are not met - increase the counter value.

4.2 If DN - similarly, only for negative values.

 
AlexeyVik:

What is the difficulty? Put a file pointer at the beginning of the string? Or replace line reading with writing?

You've been given a hint.

It's a selection from the help:

smart uncle, what if the new string is shorter than the old one?
Reason: