period.chart = Period(); #define CS_LIVE 0 market.pair = Symbol(); #define CS_VISUAL 1 if ( !IsTesting() ) status.chart = CS_LIVE; #define CS_OPTIMIZER 2 else if( IsVisualMode() ) status.chart = CS_VISUAL; else{ status.chart = CS_OPTIMIZER; ...
PICNIC. Alerts are not displayed in the tester, they become prints in the journal. You see the alert because you are not testing.
You think about Meta Trader 4 or Meta Trader 5 ?
My problem is under MT4 not MT5...
The problem is not only for Alert() function the problem is for IsTesting() function. I feel thaht MT4 Build 509 doesn't recognize if is the back tester started.
IsTesting() works properly on build 509. For following code:
int start() { static int currenthour = -1; if (Hour() > currenthour && Minute() == 0) { test_of_IsTesting(); currenthour = Hour(); } return(0) } void test_of_IsTesting() { if (!IsTesting()) Print ("Not in tester mode."); if (IsTesting()) Print ("In tester mode."); return; }
produces the following in the log/journal:
So, as you can see, IsTesting() works in build 509.
I have still the same problem:
int init() { if ( IsTesting() ) { Print("TESTUJĘ !!!"); return (0); } if ( !IsTesting() ) { Print("NIE TESTUJĘ !!!"); return (0); } }
I have still "NIE TESTUJĘ !!!" message under tester...
where I 've made the mistake in the above code?
I need this code in init() { } not under start() { } ... in init() the function IsTesting() is not recognized !
If you continue to type in RED I will assume you are angry are you ?
Did you try Thirteen's code ? perhaps you need a tick, move your code to the start() function and try again . . .
I need this code in init() { } not under start() { } ... in init() the function IsTesting() is not recognized !
Are you using the strategy tester built into MT4 or are you running an EA on broker's demo account by attaching the EA to an open chart?
IsTesting() works both in init() and start().
int init() { test_of_IsTesting(); return(0); } void test_of_IsTesting() { if (!IsTesting()) Print ("Not in tester mode."); if (IsTesting()) Print ("In tester mode."); return; }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Does the function IsTesting() work in MT4 platform Build 509 ?
When I use expression like the following, under tester there is no effect.
Under TESTER, when I make back tests I have still Alert displayed "This is not testing !!!". Why ?