Theory of EA acceleration when using a custom indicator (function - iCustom) - page 7

 
Dennis Kirichenko:

No. There's a magic function that will shuffle all the attempts:

This mechanism is built into the language\terminal itself. Although the idea is interesting...

Sadly... We'll keep thinking.

Dennis Kirichenko:

What do you mean it's over? :-)

It means that the indicator started returning zeros instead of digits.

Dennis Kirichenko, Karputov Vladimir - thanks for the information about the functions!

Only I don't understand, what is the difference between TERMINAL_MEMORY_TOTAL and TERMINAL_MEMORY_AVAILABLE?

TERMINAL_MEMORY_TOTAL is the maximum available memory, and TERMINAL_MEMORY_AVAILABLE is the remaining memory, right?

 
-Aleks-:

Just don't understand the difference between TERMINAL_MEMORY_TOTAL and TERMINAL_MEMORY_AVAILABLE?

TERMINAL_MEMORY_TOTAL is the maximum available memory, and TERMINAL_MEMORY_AVAILABLE is the remaining memory, right?

Here is the best way to check it yourself: open the terminal; open Task Manager; run a script which prints out the values of TERMINAL_MEMORY_TOTAL, TERMINAL_MEMORY_AVAILABLE and compare with the readings in Task Manager.
 
In four, we will add a more aggressive automatic deletion of such indicator copies.
 
-Aleks-:
I tried it manually, changing the template with a lot of indicators to almost empty - the effect is there (but the cache remains - I think it's not critical). But how to make opening and closing through a template script - I do not know. I understood that the doubt is that as long as the script is running, the memory will not be cleared... Andrei, please help with the experiment.

What's not working out? What's to help? Where's the try? Where is the code?

ChartOpen to open chart. Then on it ChartApplyTemplate with the name of a pre-designed template (it will be the same all the time, there is no need to write it down). Then ChartClose.

Measure memory through the proposed function. Or you can download my free iMemory indicator, it was specially created for this purpose.

 
Renat Fatkhullin:
In four we will add a more aggressive automatic deletion of such indicator copies.

Hooray! How nice when those in power hear you!

And "such indicator copies" are those caused by the former when there is a shortage of memory for the latter, or something else?

 
Andrey Khatimlianskii:

What's not working out? What's to help? Where's the try? Where is the code?

ChartOpen to open chart. Then on it ChartApplyTemplate with the name of a pre-designed template (it will be the same all the time, there is no need to write it down). Then ChartClose.

Measure memory through the proposed function. Or you can download my free iMemory indicator, it was specially created for this purpose.

What kind of programmer am I? Here I started writing the script - the first command to open the chart gives no result. What's wrong?

//+------------------------------------------------------------------+

//|                                                      Scripts.mq4 |

//|                      Copyright © 2008, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property script_show_inputs

//--- input parameters

input int      Input1=0;

//+------------------------------------------------------------------+

//| Script program start function                                    |

//+------------------------------------------------------------------+



long  ChartOpen(string GBPUSD, ENUM_TIMEFRAMES  PERIOD_H1);

   

void OnStart()

  {

  }

//+------------------------------------------------------------------+

Автоматический трейдинг и тестирование торговых стратегий
Автоматический трейдинг и тестирование торговых стратегий
  • www.mql5.com
MQL5: язык торговых стратегий для MetaTrader 5, позволяет писать собственные торговые роботы, технические индикаторы, скрипты и библиотеки функций
 
-Aleks-:

What kind of programmer am I.... started writing the script - the first command to open the chart does not give results. What's wrong?

So you meant "do it for me", not "help me"? That's what you say.

Not so - almost everything: ChartOpen function must be called from the body of the OnStart function. The first parameter - string, must be in quotes. You do not need to specify the data type (string and ENUM_TIMEFRAMES) when calling.)

Start by searching examples of function usage or documentation (there are examples there too).

 
Andrey Khatimlianskii:

So you meant "do it for me", not "help me"? That's what you say.

Not so - pretty much everything: ChartOpen function should be called from the body of OnStart function. The first parameter - string, must be in quotes. You do not need to specify the data type (string and ENUM_TIMEFRAMES) when calling.)

Start by looking for examples of using the function or documentation (there are examples there too).

That's the thing, there is no proper example in the help.

According to your comments, I have redid it:

 //+------------------------------------------------------------------+

//|                                                      Scripts.mq4 |

//|                      Copyright © 2008, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property script_show_inputs

//--- input parameters

input int      Input1=0;

//+------------------------------------------------------------------+

//| Script program start function                                    |

//+------------------------------------------------------------------+



   

void OnStart()

  {

   long  ChartOpen("GBPUSD",   PERIOD_H1);

  }

//+------------------------------------------------------------------+


I get errors when clmping, what's wrong?

'Scripts.mq4' Scripts.mq4 1 1

'ChartOpen' - function can be declared only in the global scope Scripts.mq4 21 10

'GBPUSD' - declaration without type Scripts.mq4 21 20

'GBPUSD' - comma expected Scripts.mq4 21 20

'PERIOD_H1' - declaration without type Scripts.mq4 21 32

4 error(s), 0 warning(s) 5 1

Автоматический трейдинг и тестирование торговых стратегий
Автоматический трейдинг и тестирование торговых стратегий
  • www.mql5.com
MQL5: язык торговых стратегий для MetaTrader 5, позволяет писать собственные торговые роботы, технические индикаторы, скрипты и библиотеки функций
 
-Aleks-:

That's the thing, there's no proper example in the help.

I redid it according to your comments:

 //+------------------------------------------------------------------+

//|                                                      Scripts.mq4 |

//|                      Copyright © 2008, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property script_show_inputs

//--- input parameters

input int      Input1=0;

//+------------------------------------------------------------------+

//| Script program start function                                    |

//+------------------------------------------------------------------+



   

void OnStart()

  {

   long  ChartOpen("GBPUSD",   PERIOD_H1);

  }

//+------------------------------------------------------------------+


I get errors when clmping, what's wrong?

'Scripts.mq4' Scripts.mq4 1 1

'ChartOpen' - function can be declared only in the global scope Scripts.mq4 21 10

'GBPUSD' - declaration without type Scripts.mq4 21 20

'GBPUSD' - comma expected Scripts.mq4 21 20

'PERIOD_H1' - declaration without type Scripts.mq4 21 32

4 error(s), 0 warning(s) 5 1

It takes too long to explain what's wrong :)

void OnStart()

  {

   ChartOpen("GBPUSD",   PERIOD_H1);

  }
 
-Aleks-:

That's the thing: there's no proper example in the helpdesk.

In addition to the helpline, there is a codobase and a forum. Search works.

ps: ugh, the link insertion in the message broke =(

https://www.mql5.com/ru/search#!keyword=ChartOpen&page=2

Reason: