I need it to stay minimized when switching instr. or TF. Does anyone know how to do this?
-
When switching, OnDeinit is called, indicators are unloaded, a new chart is drawn, indicators are reloaded, and OnInit is called. Your code runs as if it has just been placed on a chart; it draws a new panel. Why does this surprise you?
-
In OnDeinit, check the UninitializeReason and if it is REASON_CHARTCHANGE, remember the state (open or minimized) in a Global Variable. In OnInit after creating the pane, check again, read the GV, and minimize it when necessary.
-
When switching, OnDeinit is called, indicators are unloaded, a new chart is drawn, indicators are reloaded, and OnInit is called. Your code runs as if it has just been placed on a chart; it draws a new panel. Why does this surprise you?
-
In OnDeinit, check the UninitializeReason and if it is REASON_CHARTCHANGE, remember the state (open or minimized) in a Global Variable. In OnInit after creating the pane, check again, read the GV, and minimize it when necessary.
Thank you very much for the answer, I probably understand what you mean, but I don't know two things and I can't find it.
1. I know save only a variable of type double in the Global Variable, I don't know how to save the state of minimize/maximize of the object from CAppDialog, or maybe the position on chart.
2. I don't know how to find out the status of the Dialog, to be able use it in OnDeinit. I tried everything I could think of, but I can't figure it out.
Can you please direct me? I'm trying, but I can't mov.
Thank you
-
It's a boolean; cast it to a double; cast it back.
-
Perhaps you should read the manual. MQL5 Reference → Standard Library → Panels and Dialogs → CAppDialog → Minimized(const bool) - CAppDialog - Panels and Dialogs - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Have a nice day. I use the Dialog object of the CAppDialog class in the indicator and I can minimize it by the minimize button, but when switching the instrument or changing the time frame, it is automatically maximized again.
I need it to stay minimized when switching instr. or TF. Does anyone know how to do this?
I am attaching the code. Thanks