Why compute price angle is always incorrect in mt4/mt5, what had happen? WHAT IS TRUTH ABOUT HIDING PRICE ANGLE AND WHY IT IS IMPORTANT?
Bug solved. Case closed. the code- "Symbol()" io variable have been changed and inconsistent and changeable during programming environment(No sure why it change when user first open a new chart because open a new chart = current chart). Encourage to direct-use of string variable of symbol instead of using Symbol() or _Symbol. This is a significant weakness of mql4 programming. EA developer take noted.
There is no weakness. Your code is the one that has several bugs and using the functions incorrectly.
For example, you are using a string for the period instead of an enumeration:
// This is incorrect string LLS_Period="PERIOD_H1"; // ... long a = ChartOpen(symbol,LLS_Period); // ... CopyTime( ChartSymbol(a),LLS_Period,0,bars2,date2)==-1)
// Use enumeration (not string) ENUM_TIMEFRAMES eLLS_Period = PERIOD_H1; // ... long a = ChartOpen( symbol, eLLS_Period ); // ... CopyTime( ChartSymbol( a ), eLLS_Period, 0, bars2, date2 )
There are several other problems with your code, so don't go complaining about it before you properly understand how to code in MQL.
Also, please stop using UPCASE text. It is equivalent to SHOUTING and not considered polite.
Thank you Fernando Carreiro. You are a smart guy. Respect you as you are older. But there are more than 1 way to write code of mql4 programming. Symbol() refer to current chart and it is changeable. A variable changeable in programming environment is highly unstable. At least at the end, my code to compute angle work without changing price data of symbol anymore. Also, thank you for your patient to read my post and improve my code-"Period".
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
THIS SCRIPT USING TWO POINT TO COMPUTE ANGLE OF TREND AND TREND RESULT. HOWEVER, THE MT4/MT5 SOFTWARE IS INCONSISTENT TO PROVIDE A CORRECT TREND VALUE. THE FIRST ANSWER ALWAYS A REVERSE ANSWER!!! IS MT4/MT5 A PIRATE SOFTWARE AND STOP USER FROM FINDING PRICE ANGLE? WHY ALWAYS GIVE FALSE OUTPUT?
SAME SCRIPT PROGRAM, IS IT POSSIBLE TO CHANGE THE PRICE TREND 3 TIME WITHIN A MINUTE? MAKE SENSE? is it funny all the false computing???