I've created an indicator that put automatically orizontal lines on the mt4 platform in oder to indentify targets. But, if later i draw a separated
trendline and then I change timeframe,the trendline and everythings else I have on the platforms (like comments) goes away... Is there
someone that knows how to solve this problem?
- Cycle Lines - Lines - Analytical Objects - Price Charts, Technical and Fundamental Analysis
- Lines - Objects - Charts - MetaTrader 5 for Android
- Lines - Objects - Chart - MetaTrader 5 for iPhone
You have code that deletes them in deinit/OnDeinit. Change your indicators/EA to only delete what they put on the chart.
William Roeder:
You have code that deletes them in deinit/OnDeinit. Change your indicators/EA to only delete what they put on the chart.
You have code that deletes them in deinit/OnDeinit. Change your indicators/EA to only delete what they put on the chart.
Thank you for your reply but
The onDenit function eliminate specified objects that I've created with codes.
void OnDeinit(const int reason)
{
//---
ObjectDelete(0,"Res1");
ObjectDelete(0,"Res2");
}
Why it eliminates also objects that are not related to the code? like the trendline that i draw later?
![Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions](https://c.mql5.com/36/34/documentation-on-mql5-constants__24.png)
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
GreenKobra: Why it eliminates also objects that are not related
to the code? like the trendline that i draw later?
That code doesn't.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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