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
I am sorry to bring this post up, I just couldn't find the answer here and it bothered me to see answers like "it can't be done" etc.
So, it CAN be done, using my example below.
First I will explain what needs to be done, since we all agree that the angle cannot be determined if your coordinates are (price,time), so :
1. First challenge is that you need to change them to the chart's (x,y), so we'll get what we see visually.
2. Second challenge is that (x,y) are also not on the same scale, so you need to multiply your resulted slope by the width/height ratio.
So the code should be something like:
1. First challenge is that you need to change them to the chart's (x,y), so we'll get what we see visually.
2. Second challenge is that (x,y) are also not on the same scale, so you need to multiply your resulted slope by the width/height ratio.
1. is necessary
2 . (x,y) are in pixel coordinates system so they are in same scale : 1 pixel in x-direction is equal to 1 pixel in y-direction. So no need to get a ratio
--------------------------
Another point : no also need "to flip Y coord. from upper-leftmost to lower-leftmost"
1. is necessary
2 . (x,y) are in pixel coordinates system so they are in same scale : 1 pixel in x-direction is equal to 1 pixel in y-direction. So no need to get a ratio
--------------------------
Another point : no also need "to flip Y coord. from upper-leftmost to lower-leftmost"
Thanks, actually about the flipping you are correct. I did write it in another forum but forgot to add it here. You are absolutely correct.
Regarding the scale - trial and error will tell you if you need to or not. Actually 1 pixel up is not the same as 1 pixel right, on my charts. I have almost twice as many Y-pixels than X-pixels, so it is advised to do the scaling, even if in your charts the ratio is 1, on other screen configurations it may not be so.
You can try and minimize the chart and play with its size, you'll see immediately what I mean regarding the angle calculations, it just will not appear right if you do not add the scaling.
You can try and minimize the chart and play with its size, you'll see immediately what I mean regarding the angle calculations, it just will not appear right if you do not add the scaling.
to understand what you are mentioned,
submit scaling pb to this attached indicator : does the pb still persist
to understand what you are mentioned,
submit scaling pb to this attached indicator : does the pb still persist
What is a "pb" ?
to understand what you are mentioned,
submit scaling pb to this attached indicator : does the pb still persist
Your code works well indeed, but you do not address the problem of a downtrend line. You indicator has a flow that it only shows positive angles.
So, that is why I flipped the Y axis, but then you also need to check some conditions on the angle itself.
to understand what you are mentioned,
submit scaling pb to this attached indicator : does the pb still persist
I change the angle calculation section to include also negative angles:
neg values ,tan and arctan conditions must be tested ,of course.
it was only beta version that i'm testing for that purpose (posts 5718 & 5719)
------------------------------------------------
here angle goes from -180° to 180°
I am sorry to bring this post up, I just couldn't find the answer here and it bothered me to see answers like "it can't be done" etc.
So, it CAN be done, using my example below.
First I will explain what needs to be done, since we all agree that the angle cannot be determined if your coordinates are (price,time), so :
1. First challenge is that you need to change them to the chart's (x,y), so we'll get what we see visually.
2. Second challenge is that (x,y) are also not on the same scale, so you need to multiply your resulted slope by the width/height ratio.
So the code should be something like:fridayda13,
tku for your code...
I think that this code works in mt5 too, because I compiled and get no errors...
1) First I get when "bbollinger" opens (this part is simple and I know the code)
2) when bbollinger is "opened" I need to get the "angle" formed between the two bands... (this is the complex part that I need)
I am sorry to bring this post up, I just couldn't find the answer here and it bothered me to see answers like "it can't be done" etc.
So, it CAN be done, using my example below.
First I will explain what needs to be done, since we all agree that the angle cannot be determined if your coordinates are (price,time), so :
1. First challenge is that you need to change them to the chart's (x,y), so we'll get what we see visually.
2. Second challenge is that (x,y) are also not on the same scale, so you need to multiply your resulted slope by the width/height ratio.
So the code should be something like:
instead of
To reference it to my 2nd indicator in the indicator window, do I
ChartTimePriceToXY(1,1,time1,price1,x1,y1);
ChartTimePriceToXY(1,1,time2,price2,x2,y2);
?