[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 323

 
Diubakin:
So... HOW DOES THAT work? if it's not a secret...
There is one way, but don't tell anyone. This is a terrible secret.
Run a google search on the site - trading on nonstandard TF site:mql4.com and variants like "advisor on equi (stand-alone) chart, etc.".
Or wait until Junko can't stand it and will personally explain it to you :))
 
Diubakin:
So... HOW TO DO IT?

It's no secret. There's a lot written about it. It doesn't matter what tool was used to create the story. The point is to update the chart so that the Expert Advisor works on it.

This can be done by means of WinAPI. It has been described here many times. I have written a library. I posted it here.

It contains functions to control autonomous update of the chart. It does not require any script or expert. But it is not for everyone. There are also functions available to all to update the chart from an Expert Advisor, a script or an indicator. It is more difficult to use them. Because you have to think out which of your programs will update the chart. The examples are in the test script.

 

Dear programmers.

Can you advise how to configure the values of moving average levels displayed on the current bar?

I do not mean the value of the moving average itself, but the values of its levels (deviations from it upwards and downwards, which are set in the "Levels" tab of МА menu).

These values will follow the MA levels and change by themselves.

The figure is one of possible variants.

Thanks in advance.



 
Diubakin:


I already understood about the mystery). I read the articles and looked through the forum, and looked through the search. I can't find the description of how to use non-standard charts in the Strategy Tester, but I haven't found an example, what should I do to enable the Expert Advisor to work in real time on such a chart.

WinAPI is a dark forest for me. Is there a way to do something in mql4 inside the builder or its Expert Advisor, or to combine the builder and the Expert Advisor?

I have no idea how to use it as an Expert Advisor in the future.

When I said mystery, I meant the great mystery of searching. It lies in the fact that you have to READ the material it will show you. I'm afraid to give you the links, so I'm giving you the text as it is.

nickbilac 03.09.2007.

...For an Expert Advisor to work on an autonomous chart, you need to add:

at the beginning of the start:

int MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message"); //incoming tick for EAs

after the first PostMessageA

PostMessageA(hwnd,MT4InternalMsg,2,1); //incoming tick for EAs

and in WinUser32.mqh in the function descriptions of user32.dll:

int RegisterWindowMessageA(string lpString);

(this solution was suggested by Slava on English forum)

 
From the correspondence with the broker - "The charts are used in order to give an idea about the market. He cannot blame ..... for the updates because these are set by default for all brokers who use the MT4 platform. What MT4 feature are we talking about? In what cases the price that is currently displayed on the chart and in the market overview cannot be simultaneously market and executable? Please help me to understand the essence of this statement. I am preceded by links to the OrderSend function and give you the code from MTS used for opening a trade:

RefreshRates();

ticket=OrderSend(Symbol(),OP_SELL,0.1,NormalizeDouble(Bid,Digits),0,NormalizeDouble(Ask+15*Point,Digits),0, "test",8,0, red);

I would be very grateful for comments from developers.
 

granit77:
Когда я говорил о тайне, то имел в виду великую тайну поиска. Она заключается в том. что надо ПРОЧИТАТЬ материалы, на которые он покажет. Ссылки уже боюсь давать, привожу готовый текст.

nickbilac 03.09.2007

... in order for the experts to work on a standalone schedule, you need to add:

at the beginning of the start:

int MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message"); //incoming tick for EAs

after the first PostMessageA

PostMessageA(hwnd,MT4InternalMsg,2,1); //incoming tick for EAs

And in WinUser32.mqh in the function descriptions user32.dll add:

int RegisterWindowMessageA(string lpString);

In my library there is one function instead of this code.
 
Would RefreshRates();; before a tick help to reduce requotes even slightly?
 
Shniperson:
Will RefreshRates(); before the ticket help to reduce the requotes a bit?


It depends on the situation. If you have two orders in a row, it makes sense to call RefreshRates() before setting the second order. Look, you send an order to the server to open an order. A certain amount of time will pass while the server reacts. During this time, quotes can change, so as soon as the server has responded, we need to call RefreshRates(), which updates the data in the terminal. Now we can give an order to open the next order. If we simply check for a signal and immediately place an order, there is no reason to call RefreshRates(). The reason is that the start function is called at the arrival of a new tick and we may neglect the time until the EA checks for the signal.

What does the ticket have to do with it? The ticket is the order number on the server...

 
Well I meant ticket=OrderSend(......)
 
Shniperson:
Well, I meant ticket=OrderSend(......)

And what did they tell you? ...
Reason: