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 the indicator creates graphical objects and then gets their parameters, no.
But it is still easier to solve everything through the use of an indicator. Calculations are performed in the indicator and their results are displayed via indicator buffers.
There is one more alternative. Create global variables with parameters of the line instead of lines, but in this case, the function GetValueByShift() will not work, you must write its analog.
I see. But how to draw a trend line in an indicator without any graphic drawing?
Two bar indexes are known, they should be connected with a line and drawn to the right.
I see. But how can I draw a trend line in the indicator without any graphical drawings?
Two bar indexes are known, they should be connected by a line and drawn to the right.
I had such an indicator in my code base. I do not have it now.
We should use calculations. Knowing coordinates of two points we can simply calculate coordinates of the third one.
I used to have such an indicator in my codebase. Now it's gone, gone.
You have to use calculations to do everything. Knowing the coordinates of two points, you can simply calculate the coordinates of the third.
Where to find a formula for this calculation?
In general, it looks a bit nouveau. The terminal has all sorts of channels, fibos and other geometric indices, but they are useless in the tester.
Where can I find the formula for this calculation?
In general, it's kind of nouveau riche. There are a lot of channels, Fibos and other geometric indices in the terminal, but they are useless in the tester.
x1, x2 - bar numbers. y1, y2 - price values. x3 - number of bar for which the calculation is conducted.
x1, x2 - bar numbers. y1, y2 - price values. x3 - number of bar for which the calculation is performed.
x1, x2 - bar numbers. y1, y2 - price values. x3 - number of bar for which the calculation is performed.
Made indicator based on the calculations, readings are the same as for the indicator on the graphical objects.
Optimization is going on. The only problem is that trades are not opened correctly.
When I apply the indicator to the chart the line is flat at first, but then it becomes as it should be and stays like that when I place it on a new tick.
Made an indicator based on the calculations, the readings are the same as the indicator on the graphical objects.
Optimisation is going on. The only problem is that trades are not opened correctly.
When I apply the indicator to the chart the line is flat at first, and then with a new tick it becomes as it should be and stays like that.
Try to test in visual mode. Using print, comment, look for the difference.
The visual mode will not help. I was able to make the indicator show only the current pattern.
The indicator itself prints the value of the first index (MQL4), the first print comes out with an incorrect value, and the others are correct on new ticks.
If you don't mind looking at the code, I sent it to you in your personal message.
Anyway, I transferred all the trendline calculations to the EA. It seems to be correct.
I cannot make an indicator, that would show on the whole range of the line. I do not have enough experience.
I actually need an indicator to visually see that trades are opened correctly.
I have decided to use graphical objects for visualization.
The problem is the error 4200 (the object already exists).
I tried to give a new name to the object each time. Same error.
Is it possible to call multiple objects? If so, how can I trim unnecessary parts of the ray?
Anyway, I transferred all the trendline calculations to the EA. It seems to be correct.
I cannot make an indicator, that would show on the whole range of the line. I do not have enough experience.
I actually need an indicator to visually see that trades are opened correctly.
I have decided to use graphical objects for visualization.
The problem is the error 4200 (the object already exists).
I tried to give a new name to the object each time. Same error.
Is it possible to call multiple objects? If so, how can I trim unnecessary parts of a ray?
Before creation, you can check if the object exists, function ObjectFind(). You don't have to do anything, it exists and it's OK, it's not a bad error.
A set of objects. You can add the bar time to the object name, it will have a unique name.
Trim the beam. Property ObjectSet(Name,OBJPROP_RAY,false);