Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1889
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Please help me to write the code
Conditions for the indicator:
If the high (2) is greater than the previous high (1) and the low (2) is greater than the previous low (1), wait for the opposite situation (highs 3 and 4) and (low 3 and 4). At the maximum between the highs (2 and 3), set the mark of the maximum as a blue dot.
If the maximum (4) is lower than the previous maximum (3) and the minimum (4) is lower than the previous minimum (3), wait for the opposite situation (highs 5 and 6) and (lows 5 and 6). At the low between the highs (4 and 5), the low is set as the red dot.
Sorry, the picture doesn't fit.
The code itself:
int Handle = FileOpen("2022.02.01 12-00",FILE_ANSI|FILE_WRITE|FILE_COMMON,'-'); //open for writing
FileWrite(Handle, "1", "643", "USDCAD","[11-1.30-0.70]");//write dataset
FileSeek(Handle,0,SEEK_SET);//replaced the pointer to the beginning of the file (I think this is unnecessary, but still)
FileClose(Handle);//closed the file
Handle = FileOpen("2022.02.01 12-00",FILE_ANSI|FILE_SHARE_READ|FILE_COMMON,'-');//open for reading
Print(FileTell(Handle)," ",FileReadNumber(Handle)," ",FileReadNumber(Handle));
FileClose(Handle); //closed the file
The log entry must contain the current pointer position, a space, the first value read from the file (1), a space, the second value read from the file (643). Instead, the following is logged:
6 643.0 1.0
That is, for some reason I can't figure out, the file pointer is not at the beginning of the file, but six bytes away from it, at the second separator ("-"), while the next reading is from right to left. The attempts to move the pointer to the beginning of the file using the FileSeek function were unsuccessful.
My intellect is not enough to understand the reason for this. Please explain what the hell is going on.
Please help me to write the code
Conditions for the indicator:
If the high (2) is greater than the previous high (1) and the low (2) is greater than the previous low (1), wait for the opposite situation (highs 3 and 4) and (low 3 and 4). At the maximum between the highs (2 and 3), set the mark of the maximum as a blue dot.
If the maximum (4) is lower than the previous maximum (3) and the minimum (4) is lower than the previous minimum (3), wait for the opposite situation (highs 5 and 6) and (lows 5 and 6). At the low between the highs (4 and 5), the low is set as the red dot.
Sorry, the picture doesn't fit.
The code itself:
Don't look ahead
Please help me!
I'm not getting what I'm expecting at all. Need to read the log file
Good afternoon, all. I have an indicator that draws Fibonacci levels. I need the EA to place another EA with certain settings on this chart when the price reaches the 61.8 level on this Fibo grid and press the button to open an order.
Below is a screenshot of the indicator and the EA with its buttons. We do not have the source code of the Expert Advisor with the buttons. An EA for tracking the 61.8 level on the Fibo grid will not work in the tester; it will work on the demo account and then, if everything goes well, this combination can be installed on the real account.
Is it really possible to do? If so, how to implement it in words, and then in code? Please explain in detail and clearly.
Good afternoon, all. I have an indicator that draws Fibonacci levels. I need the EA to place another EA with certain settings on this chart when the price reaches the 61.8 level on this Fibo grid and press the button to open an order.
Below is a screenshot of the indicator and the EA with its buttons. We do not have the source code of the Expert Advisor with the buttons. An EA for tracking the 61.8 level on the Fibo grid will not work in the tester; it will work on the demo account and then, if everything goes well, this combination can be installed on the real account.
Is it really possible to do? If so, how to implement in words, and then in code? Please explain how you can more detail and clearly.
Do you have memory for 24 hours?
Do you have a 24-hour memory?
No. I haven't found out how to implement what I need - maybe I will with the second iteration;-)
Maxim Kuznetsov told you how. Have you read it?
Good day please help to solve the problem with wrong closing of orders
When a positive profit is earned, the Expert Advisor closes the first and the last order in the order grid
Everything is fine on a demo account but on a real account only the second-to-last order is closed. I faced such a problem when I had to close the whole grid of orders and the problem was in the requotes, then the flag was set and the problem is solved. Here I have done the same but the problem is not solved.
Flag:
Thanks!!!!
Flag:
Thanks!!!!