Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 439

 
STARIJ:

Try right clicking on the symbols, character set, ... Or call your broker - may or may not have

STARIJ:

Try right clicking on symbols, character set, ... Or call your broker - may or may not have

Thank you! It didn't work with the right button. But, I made the order online on webtrader and of course it appeared in MT, and was added to the list of charts!
 
Vladislav Andruschenko:


I used to get the same kind of E's when I was a kid, when I was dabbling with a calculator. After I started programming I remembered the calculator, everything fell into place.


Try converting to a string if you want to see the number in a string.

Thank you)

 

Maybe someone has stumbled over this: I record ticks: I divide files by days for convenience of further processing. If FileOpen at initialization - success; in any other place of program (which is exactly what I need to catch occurrence of a new day) - error 5008.

The code is as follows:

 string FN=IntegerToString(TimeYear(TimeCurrent())*10000+TimeMonth(TimeCurrent())*100+TimeDay(TimeCurrent()));
 Print("Creating new file for new day: ",FN);
 
 fileHandle=FileOpen((ID+ID=="current"?Symbol():"")+"\\"+FN+".ticks",FILE_READ|FILE_WRITE|FILE_ANSI|FILE_SHARE_READ|FILE_BIN);
 FileSeek(fileHandle,0,SEEK_END);
 
 if(fileHandle!=INVALID_HANDLE) Print("Opened file: ",ID+(ID=="current"?Symbol():"")+"\\"+FN+".ticks");
 else Print("Error opening file ",ID+(ID=="current"?Symbol():"")+"\\"+FN+".ticks : ",GetLastError());
 
Igor Zakharov:

Maybe someone has stumbled over this: I record ticks: I divide files by days for convenience of further processing. If FileOpen at initialization - success; in any other place of program (which is actually what I need to catch new day) - error 5008.

First, form the file name separately, otherwise you do it many times.

Secondly, you first try to use the file in the FileSeek function - and then check it later.

Drop +"\" from file name - file is created

you put BIN in the file parameters - you can hardly open such a file in a text editor or load it into Excel

FN=TimeToStr(TimeCurrent(),TIME_DATE); - almost the same as yours but with dots - well, let them be

 
STARIJ:

Firstly, form the file name separately, otherwise you do it many times.

Secondly, you first try to use the file in the FileSeek function - and then check later

I removed +"\\" from the file name and the file is now created

1) Before this block:

if(LastDay==iTime(NULL,PERIOD_D1,0)) return;

LastDay== iTime(NULL,PERIOD_D1,0);

i.e. once for one day.

2) But it does not cancel that fileHandle==INVALID_HANDLE, moreover, it does not interfere with OnInit. I can see the point though: 5008 is an error from FileSeek. Thank you!

3) does not fit, because otherwise we will litter in the root folder. There will be a lot of files, it would be nice to put them in folders. Again - it doesn't cause an error in OnInit().

Thanks for the direction to dig! :)

 

is there any way to intercept mouse scrolling?


totally forgot that the help in the terminal is rarely updated,

found it. Thanks

CHARTEVENT_MOUSE_WHEEL

Clicking or scrolling mouse wheel (if chart'sCHART_EVENT_MOUSE_WHEEL=true property is set)

 

Thank you very much :)

True error code: 5002

Corresponding solution: move the opening parenthesis:FileOpen((ID+ID=="current"?Symbol():"")+"\"+ ---->FileOpen(ID+(ID=="current"?Symbol():"")+"\\"+

 
If you want a folder for example aaa and then "aaa\\\"
 
Vladislav Andruschenko:

is there any way to intercept mouse scrolling?


totally forgot that the help in the terminal is rarely updated,

found it. Thanks

CHARTEVENT_MOUSE_WHEEL

Clicking or scrolling mouse wheel (if chart'sCHART_EVENT_MOUSE_WHEEL=true)



I have understood that it does not work in mt4. :-(

 
Vladislav Andruschenko: I understand it doesn't work in mt4. :-(

it works for me - it tracks mouse movements. and you want the wheel? well, it's around here somewhere

Files:
Lines.mq4  4 kb
Reason: