Download MetaTrader 5
To add comments, please log in or register
Did you like the article? Share it with your friends!
Automated-Trading
Admin
88666
Automated-Trading 2014.07.10 10:59 

Forex Indicator Price Degrees with Trend Alerts:

This indicator will write value degrees of the lastest position of price at the current timeframes, and when position and condition of trend status was changed, the indicator will give an alerts.

 Forex Indicator Price Degrees with Trend Alerts

Author: 3rjfx

willgart
842
willgart 2014.07.10 22:47  

well...


there is a bug in the code...

for(j=limit; j>=0; j--)
     {
       //---
       double dayopp=iOpen(symbol,1440,j);
       double h4cls1=iClose(symbol,240,j+1);
       double m15cl1=iClose(symbol,15,j+1);
       double cc0=close[j];


you apply the same J index  to different time frames!!!

for example, J=10, so you get the D1 open value there is 10 days ago, the H4 value there is 11* 4 (44h) ago and the 11 * 15 (2h45) ago

so finally you compare values not occurring at the same time...

you should use the iBarShift function to get the correct index for each timeframe.

Roberto Jacobs
45172
Roberto Jacobs 2014.07.11 12:48  
willgart:

well...


there is a bug in the code...

for(j=limit; j>=0; j--)
     {
       //---
       double dayopp=iOpen(symbol,1440,j);
       double h4cls1=iClose(symbol,240,j+1);
       double m15cl1=iClose(symbol,15,j+1);
       double cc0=close[j];


you apply the same J index  to different time frames!!!

for example, J=10, so you get the D1 open value there is 10 days ago, the H4 value there is 11* 4 (44h) ago and the 11 * 15 (2h45) ago

so finally you compare values not occurring at the same time...

you should use the iBarShift function to get the correct index for each timeframe.

Well...

Thank you, my friend Willgart.

That's not a bug, and it is my intention, as you describe it.

And indeed, my indicator not made ​​a mistake in calculating the degrees in the chart.

But, I will try to use the code as you suggest, and then we will see the result.

Regards.

/
To add comments, please log in or register