Clear all indicator

 

Anyone knows any way or something on marke that can clear all indicators for an instant to see the graph clear and return all indicators on graph? Something like on/off. If on, all indicators are visible, if off, just price on graph.

 
Jhennifher:

Anyone knows any way or something on marke that can clear all indicators for an instant to see the graph clear and return all indicators on graph? Something like on/off. If on, all indicators are visible, if off, just price on graph.

You can open a new chart, or use empty template.

Things only get tricky when you have graphical objects not belonging/handled by the indicators - you'll need a way to ensure they don't get erased permanently - e.g. write to file.


Edit: I should ask whether you're using MT4 or MT5... the above applies to MT4. For MT5, you can easily write a script to do add/remove indicators using ChartIndicatorAdd() and ChartIndicatorDelete().

Edit: For MT4, I found this thread: https://www.mql5.com/en/forum/73391.
Documentation on MQL5: File Functions / FileWrite
Documentation on MQL5: File Functions / FileWrite
  • www.mql5.com
//|                                               Demo_FileWrite.mq5 | //|                        Copyright 2013, MetaQuotes Software Corp. | //|                                              https://www.mql5.com | //| Script program start function                                    | //
 
Jhennifher:

Anyone knows any way or something on marke that can clear all indicators for an instant to see the graph clear and return all indicators on graph? Something like on/off. If on, all indicators are visible, if off, just price on graph.

You can use a script to save the template.

First save a template of a clear chart and call it "Basic". you will only have to do this once, not every time.

This script will save the current template and apply the Basic template.

//+------------------------------------------------------------------+
//|                                                 SaveTemplate.mq4 |
//|                                                    Keith Watford |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Keith Watford"
#property link      ""
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   ChartSaveTemplate(0,"Temporary Template");
   ChartApplyTemplate(0,"Basic");
  }
//+------------------------------------------------------------------+

Once you have done what you want, use this script to re-apply the original template.

//+------------------------------------------------------------------+
//|                                                ApplyTemplate.mq4 |
//|                                                    Keith Watford |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Keith Watford"
#property link      ""
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   ChartApplyTemplate(0,"Temporary Template");
  }
//+------------------------------------------------------------------+

You can set hotkeys for the scripts.

Just remember that this can only work with one template at a time. So you must re-apply the template before using the script on another chart as the file will be overwritten.

The code is exactly the same for MT4 or 5.

 
Seng Joo Thio:

You can open a new chart, or use empty template.

Things only get tricky when you have graphical objects not belonging/handled by the indicators - you'll need a way to ensure they don't get erased permanently - e.g. write to file.


Edit: I should ask whether you're using MT4 or MT5... the above applies to MT4. For MT5, you can easily write a script to do add/remove indicators using ChartIndicatorAdd() and ChartIndicatorDelete().

Edit: For MT4, I found this thread: https://www.mql5.com/en/forum/73391.

thank you, I will take a look.

 
Keith Watford:

You can use a script to save the template.

First save a template of a clear chart and call it "Basic". you will only have to do this once, not every time.

This script will save the current template and apply the Basic template.

Once you have done what you want, use this script to re-apply the original template.

You can set hotkeys for the scripts.

Just remember that this can only work with one template at a time. So you must re-apply the template before using the script on another chart as the file will be overwritten.

The code is exactly the same for MT4 or 5.

thank you, I will check it

 
Keith Watford:

You can use a script to save the template.

First save a template of a clear chart and call it "Basic". you will only have to do this once, not every time.

This script will save the current template and apply the Basic template.

Once you have done what you want, use this script to re-apply the original template.

You can set hotkeys for the scripts.

Just remember that this can only work with one template at a time. So you must re-apply the template before using the script on another chart as the file will be overwritten.

The code is exactly the same for MT4 or 5.

It works, but I have a question.


After I call basic, graph goes to current price and escape from price I was checking in the past.


Auto scroll is off.


Have you any idea if It is possible call basic and graph stay at point I´m checking? 

 
Jhennifher:

Have you any idea if It is possible call basic and graph stay at point I´m checking? 

Did you have auto-scroll off when you saved the basic template?

 
Keith Watford:

Did you have auto-scroll off when you saved the basic template?

I save auto-scroll off as default; then, I open a new graph and It has auto-croll on : /


The same for you? Here is mt5

 
Keith Watford:

You can use a script to save the template.

First save a template of a clear chart and call it "Basic". you will only have to do this once, not every time.

This script will save the current template and apply the Basic template.

Once you have done what you want, use this script to re-apply the original template.

You can set hotkeys for the scripts.

Just remember that this can only work with one template at a time. So you must re-apply the template before using the script on another chart as the file will be overwritten.

The code is exactly the same for MT4 or 5.

Thanks, very good idea. It works great!!!

 
Marco Montemari:

Thanks, very good idea. It works great!!!

"It works, but I have a question.


After I call basic, graph goes to current price and escape from price I was checking in the past.


Auto scroll is off.


Have you any idea if It is possible call basic and graph stay at point I´m checking? "

 
Jhennifher:

"It works, but I have a question.


After I call basic, graph goes to current price and escape from price I was checking in the past.


Auto scroll is off.


Have you any idea if It is possible call basic and graph stay at point I´m checking? "

I do not think so....

If you go back and then you change TF it will reset anyway to current price

Reason: