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
If you know the time and dates of your points, you only need to callbool TrendCreate()
Thanks for the advice. It turned out to be easier than that.
I did it this way:
P.S. One thing I can't understand is why the numbers in the example are chosen like that:
From them the trend line goes somewhere in the middle of the range.
...
From them, the trend line is put somewhere in the middle of the range.
Now the next problem to solve is how to continue the line to the right and get the value of the line in the EA?
The script code has it all:
The script code has it all:
1.When called from the tester trades are opened. If I run optimization there are zeros everywhere. When I launch any optimization run, the deals are there. What to do?
2. How can I make a line be saved if a deal has occurred (on each deal), and if not, it is deleted?
You need to control the trades yourself. But for each trade to have its own line, you need to give each line a unique name when you create it.
How? Can I give you an example?
Graphic objects during testing
During visualization testing, the Expert Advisor interacts with the real chart. In normal testing, without visualization, the Expert Advisor operates with a "virtual" chart that is not rendered; in this case, some subtleties are possible. Graphical objects are not supported when the tester is in optimisation mode.
Two days to study, and it turns out it's impossible to perform optimization.
I wonder if I create an indicator. Will I be able to get the line value in my Expert Advisor through it?
Who has to say what? Perhaps, who has already studied this question?
...
I wonder if I could make an indicator? Would I be able to get the value of the line in the EA through it?
...
If the indicator creates graphical objects and then gets their parameters, no.
But anyway, it is easier to solve everything using the indicator. Calculations are performed in the indicator and their results are displayed through indicator buffers.
There is one more alternative. Create global variables with parameters of the line instead of lines, but then the function GetValueByShift() will not work, you must write its analog.