[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 335
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
Then do some digging in your own place! You have a function for every word of your code, and you have to make do with variables. That's what makes the code heavy. You should use functions when you can't do without them! I commented everything in Kim's code that I don't need, and it all works very fast! Remember, I asked everyone how to make the program run faster under many conditions. Now testing runs for a year on all ticks in 5 minutes! I combed through all the conditions and functions and threw out everything unnecessary.
Of course I remember. I'll keep it up for a while. In fact, I need to change my habits. It's not the first programmer to say that my code is not easy to understand. Apparently it is...
So dig in your own place! You have a function for every word of your code, and you have to make do with variables. That's why your code is heavy. You should use functions when you can't do without them! I commented everything in Kim's code that I don't need, and it all works very fast! Remember, I asked everyone how to make the program run faster under many conditions. Now testing runs for a year on all ticks in 5 minutes! I combed through all the conditions and functions and threw out everything unnecessary.
Variables can only be dispensed with if we test the strategy in the tester.
For the real, every necessary value to execute the logic must be calculated at the right moment in time, because the values of these variables are very easy to lose, for example during a restart.
Good day to you all.
I already figured out how to write indices, but I have problems with the first robot. It seems to be logical, the compiler does not complain, the journal has no errors, but the Expert Advisor in the tester does not work - the chart opens, but there is no movement on this graph (the chart does not move).
The idea is as follows: The indicator produces a point (always at the opening and the opening price of the candle) from which to buy or sell, the task of the robot at the same time, after receiving a point to buy or sell, close the opposite order, open a new or modify an old order in the same direction (stops and TP are issued by another indicator)
I would be very grateful to you for hints where it is wrong.
The code itself (changed indices names according to their functionality, removed declaration of variables and error handling section):
The essence of the problem is as follows: it is not clear what to put in curly brackets in the body of operators #1,2 in fact there is checked compliance of trading conditions and no more actions.
(There are four trading signals, number 1 triggers, we pass control to processing signal number 2, number 2 triggers, we pass it to processing signals number 3 and 4 and perform trading operations there).
Is it worth adding it to the end? Logically, if signals #3,4 do not trigger, then I need the Expert Advisor to start again.
Variables can only be used when testing the strategy in the tester.
For the real world, every value needed to execute the logic must be calculated at the right time, because the values of these variables are very easy to lose, for example during a restart.
Good day to you all.
I already figured out how to write indices, but I have problems with the first robot. It seems to be logical, the compiler does not complain, the journal has no errors, but the Expert Advisor in the tester does not work - the chart opens, but there is no movement on this graph (the chart does not move).
The idea is as follows: The indicator produces a point (always at the opening and the opening price of the candle) from which to buy or sell, the task of the robot at the same time, after receiving a point to buy or sell, close the opposite order, open a new or modify an old order in the same direction (stops and TP are issued by another indicator)
I would be very grateful to you for hints where it is wrong.
The code itself (changed indices names according to their functionality, removed declaration of variables and error handling section):
If you have changed the names of the indicators only in the EA, and not in the codes of indicators themselves, which are displayed in the corresponding windows on the charts, then the EA will not receive anything from them and will not give an error, because everything is presented in the EA, but it does not receive signals from indicators. Check if the names of the indicators are spelled the same way!
Thanks for the tip, I have checked everything once again, there are no mistakes in the writing. I have only changed the names of indicators in the text of the first message on the forum, in order to make their task clear, in the text of the Expert Advisor the names of indices are written exactly as they are named in the folder "indicators". For example: "3.0_figuri_2.3_rasshirenie".
In addition, I have selected another EA (from the tutorial) and entered the names of non-existing indicators in the iCustom function. What happened was the following - the EA really stopped trading (which is, by the way, understandable), but when I start the tester, the chart was moving from the set start date to the set end date, I should remind you that my problem is that the chart is not moving.
Maybe someone else has faced this problem?
Thanks for the tip, I have checked everything once again, there are no mistakes in the writing. I have only changed the names of indicators in the text of the first message on the forum, in order to make their task clear, in the text of the Expert Advisor the names of indices are written exactly as they are named in the folder "indicators". For example: "3.0_figuri_2.3_rasshirenie".
In addition, I have selected another EA (from the tutorial) and entered the names of non-existing indicators in the iCustom function. What happened was the following - the EA really stopped trading (which is, by the way, understandable), but when I start the tester, the chart was moving from the set start date to the set end date, I should remind you that the problem is that the chart is not moving.
Maybe someone else had such a problem.
Thanks for the tip, I have checked everything once again, there are no mistakes in the writing. I have only changed the names of indicators in the text of the first message on the forum, in order to make their task clear, in the text of the Expert Advisor the names of indices are written exactly as they are named in the folder "indicators". For example: "3.0_figuri_2.3_rasshirenie".
In addition, I have selected another EA (from the tutorial) and entered the names of non-existing indicators in the iCustom function. What happened was the following - the EA really stopped trading (which is, by the way, understandable), but when I start the tester, the chart was moving from the set start date to the set end date, I should remind that the problem is that the chart is not moving.
Maybe someone else had such a problem?