Run script through Expert Advisor - page 4

 

If there is a way to send signals to the broker's server by EA, so that the EA opens and closes orders

in the way like the server closes SL and TP (immediately, without delay, on the point),

please let me know!

I do not mean by that, that I want to set TP at my broker's minimum TP level.

I do not want to set any TP, I want my EA to close reliably @ my own profit levels (anything from 0.1 - 1 Pips depending on broker 4 or 5 digits) .

And, do not tell me that I must open a professional account with a $ milion on it !

P.S. I know that the problem lies in the way programs run. I have had some experience with PHP coding. PHP runs serverside.

The mql programs which are on my computer run clientside, that is on my computer, sending signals to the broker's server.

I am not a professional coder, though! I can think, and I know, that when an order is opened, the info is on the broker's server,

and that is why the execution of TP and SL is so good. I want the same execution from my EA - is that asking too much?

I think it is just fair! Otherwise the broker has more advantage over me than he should!

 
The MACD Sample program does this with a bit of editing. By the way you do realise that "offline" means you are not connected to the internet and therefore not connected to the broker and hence to place a trade you phone them.
 
Ickyrus:
The MACD Sample program does this. By the way you do realise that "offline" means you are not connected to the internet and therefore not connected to the broker and hence to place a trade you phone them.


Of course I do!

But that is not what I want.

I want to trade live, online, at the moment.

I am not interested in long timeframe trading.

I am interested in heavy scalping with my EA!

 

You edit the program to behave the way you do. Progams are consistant and persistant and don't usually care about news or whats happening in the world of finance. If the way you trade is consistant and persistant then an EA is the answer

 
Dadas:


Enlighten me, please!

How can I do realtime live trading on an offline chart?

Very simple . . .

First you need to "tick" the offline chart with synthetic ticks, this enables your EA to run start(), then when your EA places trades it cannot use symbol() it must use the correct symbol name, e.g. "EURUSD" . . it also cannot use Bid, Ask, etc . . but you can get these values using MarketInfo().

 
Ickyrus:
The MACD Sample program does this with a bit of editing. By the way you do realise that "offline" means you are not connected to the internet and therefore not connected to the broker and hence to place a trade you phone them.


Actually, in the context that I used it in this thread, no it doesn't.

An offline chart is one that is not receiving live data directly from your Broker, for example a Renko chart that is fabricated by some other code that is using the live data from the Broker.

 
Dadas:


Thanks a lot!

It is so simple, I should have thought of it myself...

Tired, I quess....... Like my old computer - LOL!

Though, you know, I was thinking of smth a little bit different.

I am thinking of how to override the ticking in MT4 live trading!



Have a read of this: https://www.mql5.com/en/forum/124688
 
RaptorUK:

Have a read of this: https://www.mql5.com/en/forum/124688

Now that is something i must study on!

Finally, some useful stuff!

Thanks a lot, RaptorUK!

 

OK, so did the following:

int init()
{
   int hWnd = WindowHandle(Symbol(),Period());
   PostMessageA(hWnd,WM_COMMAND,33232,1);
}

This does not make the start() to run, so how will this help my EA in better execution of close?

#define MT4_WMCMD_UPDATE_DATA     33324 /* This doesn't cause experts start() to run */
 


So, how can any of this help solve my situation?

How does any of this override the broker's tick, force the server to close my order?

I need a command, which causes experts start() to run.

 
Dadas:

OK, so did the following:

This does not make the start() to run, so how will this help my EA in better execution of close?

So, how can any of this help solve my situation?

How does any of this override the broker's tick, force the server to close my order?

Use a script running in an infinite loop to "tick" the chart that your EA is on . . . every 100 ms, every 50 ms . . . whatever your PC can handle, just make sure when you tick it that it isn't requesting data on each tick or your Broker will get a little annoyed with you.

The script doesn't even have to be on the same chart . . .

Reason: