- How can I trigger the EA start() function from within a DLL?
- help! include, library, and script!
- Just want clarification...Is the only difference between an EA and a script, is the location of the "file" ?
After compiling an EA, is there a way have the EA run the start() function without having to wait for the next tick?
I think you can use refresh rates.
EA starts on tick.
Script starts without a tick.
there is a way.
save this code to script and run it on the chart with EA.
//+------------------------------------------------------------------+
//| IncomingTick.mq4 |
//| Copyright c 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright c 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#include <WinUser32.mqh>
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message");
int hWnd = WindowHandle(Symbol(),Period());
PostMessageA(hWnd,MT4InternalMsg,2,1);
//----
return(0);
}
//+------------------------------------------------------------------+
I had to add: int RegisterWindowMessageA(string lpString); to my WinUser32.mqh to get it to work, but it works great. Thanks.
For those who don't know... WinUser32.mqh is in the INCLUDE folder in the EXPERTS folder.
My question is... does this work for custom indicators?
What I want to do is have an indicator update every X seconds and not wait for ticks at all.
hi
for this problem, is there any other way?, that have no need to add an external script.
somethings like putting a simple function in EA itself.
my problem isو i draw some objects like Buttons using EA, when user click on a button, or just change something in EA setting, these objects need to re-draw by new calculations immediately, but it will wait until a new tick and during this time user may think EA stop working or thinks it is working very heavy.
i tried RefreshRates() and also WindowRedraw(). but not solved.
hi
for this problem, is there any other way?, that have no need to add an external script.
somethings like putting a simple function in EA itself.
my problem isو i draw some objects like Buttons using EA, when user click on a button, or just change something in EA setting, these objects need to re-draw by new calculations immediately, but it will wait until a new tick and during this time user may think EA stop working or thinks it is working very heavy.
i tried RefreshRates() and also WindowRedraw(). but not solved.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use