[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 40

 
Twilight:


Are you suggesting to shove the indicator code into the Expert Advisor and recalculate it there?

What if there are 5 such indicators?

Is there any way to recalculate them differently?

I attach all indicators to the Expert Advisor via iCustom

The indicator and its last value are called at every new bar, but it is not redrawn in the traded symbol window until you change the timeframe and go back.

If you click on the chart and press update, it does not re-draw, for some reason it re-draws only when you change timeframe.

I do not know your imagination. If you want to get a nice picture of the indicator, you should look around in its code. In particular, the variable limit. It is present in this indicator. By the way, judging by the comments to this indicator, its author has prohibited the indicator from rerizzing and you may do it as you want but you won't get what you want because the essence of rerizzing is the appearance of the signal a few bars ago.

Good luck.

 
silatyt:

I am not aware of your fantasies. To get a nice picture from an indicator, you have to dig around in its code. Particularly, with the limit variable. It is present in this indicator. By the way, judging by the comments to this indicator, the author prohibits the indicator from rerifting. You can do it as you want but you will not get what you want because the essence of rerifting is the appearance of the signal a few bars ago.

Good luck.

In Metatrader, in any tool window, if you right-click, there is a Refresh button

Is there a way to call this function programmatically?

RefreshRates doesn't seem to be it.

 

Can you tell me how to implement the EA code in two or three lines:

When a signal comes in (e.g. crossing of two MAs)

1. Expert Advisor detects the time of the signal (in hours, minutes), stores it;

2. counts down one minute.

Next, readiness to do something (e.g. open an order)

 
Twilight:
In Metatrader in any tool window, if you right click, there is an Update button

is there any way to call this function programmatically?

RefreshRates doesn't seem to be it.


Library. You need 4.7.7 ServiceTickIndicators().

 //=====================================================================================================================================================================
 // 4.7. Функции для управления обновлением графика.
 //=====================================================================================================================================================================
 // 4.7.1. Функция запускает обновление всех графиков с указанным периодом. Если обновление уже запущено, то функция меняет период обновления графиков.
 //        Останавливается обновление функциями "ServiceStopRefreshChart()" или "ServiceStopRefreshAllCharts()" или закрытием графика.
 void ServiceRefreshAllCharts(int nPeriodMilliSec); // Период обновления графика в миллисекундах.
 //=====================================================================================================================================================================
 // 4.7.2. Функция запускает обновление всех графиков однократно. Вызов функции при работающих других режимах останавливает обновление всех графиков.
 void ServiceRefreshAllOnceCharts();
 //=====================================================================================================================================================================
 // 4.7.3. Функция запускает обновление указанного графика с указанным периодом. Если обновление уже запущено, то функция меняет только период обновления графика.
 //        Останавливается обновление функциями "ServiceStopRefreshChart()" или "ServiceStopRefreshAllCharts()" или закрытием графика.
 void ServiceRefreshChart(int hwndChart,        // Системный дескриптор обновляемого графика.
                          int nPeriodMilliSec); // Период обновления графика в миллисекундах.
 //=====================================================================================================================================================================
 // 4.7.4. Функция останавливает обновление указанного графика.
 void ServiceStopRefreshChart(int hwndChart); // Системный дескриптор графика, на котором останавливается обновление.
 //=====================================================================================================================================================================
 // 4.7.5. Функция корректно останавливает обновление всех графиков при bTerminate = FALSE, иначе функция завершает обновление аварийно.
 void ServiceStopRefreshAllCharts(int bTerminate); // Флаг аварийной остановки потоков обновления графиков.
                                                   // FALSE - потоки останавливаются корректно, TRUE - потоки останавливаются аварийно.
 //=====================================================================================================================================================================
 // 4.7.6. Функция эммулирует тик для эксперта на указанном графике.
 void ServiceTickExpert(int hwndChart); // Системный дескриптор окна графика, для эмуляции тика для эксперта.
 //=====================================================================================================================================================================
 // 4.7.7. Функция эммулирует тик для индикаторов на указанном графике.
 void ServiceTickIndicators(int hwndChart); // Системный дескриптор окна графика, для эмуляции тика для индикаторов.

Only it's better to wait a little bit. Posted a new version. Maybe the moderators will post it today.

 
Zhunko:

Library. You need 4.7.7 ServiceTickIndicators().

Only it's better to wait a little longer. Posted a new version. Maybe the moderators will post it today.


Paid?

 
Twilight:
In Metatrader, in any tool window, if you right-click, there is a Refresh button

is there any way to call this function programmatically?

RefreshRates doesn't seem to be that way.


#import "user32.dll"
int PostMessageA (int hWnd, int  Msg, int wParam, int lParam);
#import

PostMessageA (WindowHandle (Symbol(), Period()), 0x0111, 33324, 0);

But it won't give you anything. :)

 
Twilight:


Paid?

No. Where does it say paid?
 
silatyt:

But it won't do you any good... :)

You have to redraw it visually.

Cycle through the last N bars and if there was a signal - signal=true.

After that you can do whatever you want with all other non re-drawing indicators.

PostMessageA (WindowHandle(Symbol(), Period()), 0x0111, 33324, 0);

Where to insert? At the beginning of Start?

Thank you.

 
Twilight:

It will be redrawn visually.

Cycle through the last N bars and if there was a signal then signal=true

And then you can do whatever you want with any other non redrawing indicators.

PostMessageA (WindowHandle(Symbol(), Period()), 0x0111, 33324, 0);

Where to insert? At the beginning of Start?

Thank you.

Before indicator call (you can do it at the beginning of start() as well).

P.S. Everyone is "running" from redrawing, and you are behind it - unconventionally... :))

 
silatyt:

Before calling the indicator (can also be at the beginning of start()).

P.S. Everybody is "running" from redrawing, while you are behind it... :))


For example, here's a variant. We redraw on m5 and check if there is a signal for the last 12 bars.

And on the new m15 m30 we check if there was a signal on m5 and if the price is still relevant, i.e. meets the requirements for entry.

And also it is possible to analyze how many times during the same hour the signal changed, disappeared, etc.

And the signal has a name and it is possible to analyze the chart visually by name =)

In general, a whole not ploughed field for experiments. But so far, such a result =)

With my modification

http://komplekt73.ru/forex/m5chastr.htm

Reason: