NOTHING working on .EX5
-
Hi, I'am working with stocks and MT5. Stocks have a maximum 2 digits after dot. I don't know why but, one pip into my stocks graphs mean 0.01 change. As you can see, I did the same as you, but for a stock, and it work as well:
http://prnt.sc/ac3oh7
http://prnt.sc/ac3pp9My EA is working PERFECTLY when I don't use the "Set Market for next block" box. Look:
you can test it:
https://fxdreema.com/shared/fuoMjJEldnow, I put the "Set market for next blocks" box:
https://fxdreema.com/shared/I3nZctoTand I Get:
*FQ 0 20:09:19.336 Startup MetaTester 5 x64 build 1241 (22 Dec 2015)
FD 0 20:09:19.339 Server MetaTester 5 started on 127.0.0.1:3001
HO 0 20:09:19.340 Startup initialization finished
LM 0 20:09:19.817 127.0.0.1 login (build 1241)
NK 0 20:09:19.830 Network 38760 bytes of account info loaded
PL 0 20:09:19.830 Network 1490 bytes of tester parameters loaded
LK 0 20:09:19.830 Network 8388 bytes of input parameters loaded
LQ 0 20:09:19.860 Network 35110 bytes of symbols list loaded
PK 0 20:09:19.861 Tester expert file added: Experts\setup_pedrina99.ex5. 178939 bytes loaded
EF 0 20:09:19.861 Tester initial deposit 8000.00 BRL, leverage 1:1
DM 0 20:09:19.863 Tester successfully initialized
KS 0 20:09:19.863 Network 201 Kb of total initialization data received
HR 0 20:09:19.863 Tester Intel Core i7-2620M @ 2.70GHz, 3656 MB
MH 0 20:09:19.868 Symbols VALEC44: symbol to be synchronized
JQ 0 20:09:19.868 Symbols VALEC44: symbol synchronized, 3384 bytes of symbol info received
EJ 0 20:09:19.872 History VALEC44: load 29 bytes of history data to synchronize
CL 0 20:09:19.872 History VALEC44: history synchronized from 2007.02.12 to 2016.03.03
GM 3 20:09:19.873 Tester VALEC44: start time changed to 2008.02.16 00:00 to provide data at beginning
PF 0 20:09:19.873 History VALEC44,H1: history cache allocated for 63702 bars and contains 106 bars from 2007.02.12 16:00 to 2008.02.15 17:00
JH 0 20:09:19.873 History VALEC44,H1: history begins from 2007.02.12 16:00
DD 0 20:09:19.873 Tester VALEC44,H1 (XPMT5-PRD): every tick generating
QN 0 20:09:19.873 Tester VALEC44,H1: testing of Experts\setup_pedrina99.ex5 from 2007.02.12 00:00 to 2016.03.05 00:00 started with inputs:
DQ 0 20:09:19.873 Tester lowest_price=1.20000005
NJ 0 20:09:19.873 Tester objective=true
IH 0 20:09:19.873 Tester trailing_stop=true
JO 0 20:09:19.873 Tester start_hour=11
MG 0 20:09:19.873 Tester open_order_hour=16
RP 0 20:09:19.873 Tester open_order_min=30
GQ 0 20:09:19.873 Tester tp_hour=17
PG 0 20:09:19.873 Tester tp_min=40
KP 0 20:09:19.873 Tester end_hour=17
DL 0 20:09:19.873 Tester end_min=50
QI 0 20:09:19.873 Tester sl=0.15000001
LD 0 20:09:19.873 Tester tp=0.25
LQ 0 20:09:19.873 Tester sl_trailing_per=0.15000001
QJ 0 20:09:19.873 Tester adjust_entrance_per=0.05
JM 0 20:09:19.873 Tester break_even_per=0.10
QP 0 20:09:19.873 Tester MagicStart=1116
RG 0 20:09:19.909 Symbols VALEC22: symbol to be synchronized
LQ 0 20:09:19.909 Symbols VALEC22: symbol synchronized, 3384 bytes of symbol info received
IP 0 20:09:23.114 History VALEC22: load 29 bytes of history data to synchronize
FF 0 20:09:23.114 History VALEC22: history synchronized from 2014.12.17 to 2016.03.04
DP 2 20:09:23.114 setup_pedrina99 (VALEC44,H1) 2008.02.18 11:02:00 zero divide in 'tmp.mq5' (5842,50)
FN 2 20:09:23.114 Tester OnTick critical error
JD 0 20:09:23.117 Tester VALEC44,H1: 1 ticks (1 bars) generated in 0:00:03.245 (total bars in history 107, total time 0:00:03.307)
FD 0 20:09:23.117 Tester 221 Mb memory used
EI 0 20:09:23.117 Tester log file "C:\Users\zenega\AppData\Roaming\MetaQuotes\Tester\FB9A56D617EDDDFE29EE54EBEFFE96C1\Agent-127.0.0.1-3001\logs\20160306.log" written
CP 0 20:09:23.240 Tester tester agent shutdown started
QJ 0 20:09:23.262 Tester shutdown tester machine
ML 0 20:09:23.285 Tester tester agent shutdown finished[/list:u:25measrt]Any Ideas?
-
__DP 2 20:09:23.114 setup_pedrina99 (VALEC44,H1) 2008.02.18 11:02:00 zero divide in 'tmp.mq5' (5842,50)[/quote:2qplqgbj]
At this row I have:
CandleID = (int)MathCeil((double)mins_diff/(double)mins_tf);mins_tf is some timeframe that is calculated and normally it should be different than 0. I can get the same error if I use symbol that does not exists. But what is wrong with this VALEC44, I don't know exactly. And I prefer to try to fix things when I can experience the problem by myself, I don't really want to try changing something in the code just like that - I can break something else.
Is there something strange in the candles around that time 2008.02.18 11:02:00? Missing candle maybe... What if you only use VALEC44?
Or is there a way for me to check how this thing works? Broker name, demo account, TeamViewer, something... -
2008.02.18 11:00:00 candle is OK
http://prnt.sc/acnv90Here goes the Demo account:
BTW, if I only use VALEC44, it works. My only problem is with the "Set market for next blocks" Box.
Please, let me know if you need anything else.
Thanks
-
I think I fixed one of the problems!
But the history data of these symbols is so weird, too much is missing. I have days without a single candle and then 1 or 2 candles for the whole day in H1. I don't see even a single day with all it's candles. And you want to work with 4 symbols of these... How?
-
Yes, the history quality of those are urgh! There are 1000 symbols like theese I want to test my EA. They're not stocks, but options. My EA will work on Options. And as you may know, options have a time expiring, and when they expire, no one trades it. That answers the missing candle days, and all the weird things.
So, can you be more specific for the problem you've just fixed? I'am facing more one right now with the "Break Even Point" box, let me put it down:
here is the setup:
https://fxdreema.com/shared/m6hl7wyMbI have a trailing stop and a break even point on my program:
http://prnt.sc/ad1qc0Those "indicator testers" boxes show the break even point calculated in block 31. Just for you to know, as the variable "break_even_pips" is of type unsigned int, I then put it inside a float one "break_even_pips_float" at the block 31, Ok?. You can see in the below SS that the BEP get printed in the chart perfectly. The green dot with a yellow circle around it is the BEP (5.76). Now, take a further look on the SS. The entrance of the last short trade was 6.41. Then the price went down below the green dot but the SL didn't move to the 6.41. It didn't activate the BEP. BUT, the Trailing stop loss was activated 4 times. Why the BEP was not activated?
http://prnt.sc/ad1qqkAnother question: what is the parameter that I have to change in my TSL box which will change the cadency of the refreshment of my SL level? I mean, for exemple: I got a TSL that allow a maximum distance of 15% between the actual price and the SL. If for exemple the price goes 1 PIP above that 15%, the TSL should refresh the SL level. This would be perfect, but it's not happening in my EA. The price is going like 15 pips above the 15% for the TSL to refresh the SL level. How can I adjust that for just ONE pip cross above?
-
I used some custom code turn PERIOD_CURRENT into seconds and obviously in some specific situations it produced some errors. But now I found one native function PeriodSeconds(), which is probably new, and I replaced my code with this function. All this is needed when I want to finc candle by time - if you input 00:00 to find which candle stands around this time. But with your Options where most of the data is missing, I don't know how can you do that. Even if the closest candle is get, it's totally wrong. And I guess MetaTrader also don't know what to do, because when I don't see "zero divide" errors, I see nothing at all, like MetaTrader just hangs. What can I say, when you want to work with specific times of the day when most of the days there is not even a single candle... I can't see how this can ever work.
Unsigned int it integer, it's a whole number in any case. There are weird transformations when you work with with double and float, but when you put everything in integer, everything behind the dot is lost. What maters is how it's lost and I will suppose to check that value with "Comment" or something like that. I'm also confused with all these data types

-
Trailing Step is for the frequency of SL modifications. If this is 1 pip, then the price needs to move at least 1 pip and then SL is moved at Trailing Stop pips behind the current price. And by default the current price is Ask for buys and Bid for sells.
So, relative to SL, the current price must be at distance at least TrailingStop + TrailingStep from SL and then SL is put at TrailingStop distance from the current price.
-
I still don't understand what you are trying to do, at least I can't recoglize the idea looking at your project, but here is something from me.
3 in 1
- Comment in the upper left corner - Equity price that is stored at the first moments of every new day
- Comment in the upper right corner - The total profit (in $) of al trades closed after 00:00 at the current day. In the moment of the screenshot the value is 50, because 2 trades (with TP = 25 pips) were closed at profit.
- In the middle you can see the Open Price of the latest running trade with continuous blue line. And also the equity value of 1), but as vertical lines and text labels.
https://fxdreema.com/shared/TyXlLl6Db
http://prntscr.com/ada3jq
http://i.imgur.com/xOxERGl.png -
was this last reply for me?
-
Dreema, about the BEP. There is something going wrong. The EA: https://fxdreema.com/shared/cpQuMbEMd
Tried a BEP with fixed scalar number "30 pips" http://prntscr.com/admfty. Didn't work. The value which is inserted into the BEP Box "pips on profit" isnt getting recognized by the EA. I mean, Dreema, I already tried to put a numeric value there, and it didn't work. What the heck should I do now? o.o Please, try yourself with the demo account I provided you, on the market I'am trying right now: VALEC44 -
__And I guess MetaTrader also don't know what to do, because when I don't see "zero divide" errors, I see nothing at all, like MetaTrader just hangs. What can I say, when you want to work with specific times of the day when most of the days there is not even a single candle... I can't see how this can ever work.[/quote:bmzh24cd]
Ok, you are telling me that the probable cause of the hanging MT5 is the leck of liquidity or candle informations, or anything else. So take a look at my setup right now:
http://prntscr.com/adx841
https://fxdreema.com/shared/TJN9DFb9
I'am using normal stocks:OIBR3,USIM5,GOAU4 they have all candles and no leck of liquidity at any time.
I even put boxes which are conditions to make de EA only trade when there are real trading conditions on the market: volume>10.000 / spread<0.03 /last deal price != 0. This setup would prevent the MT5 from just hanging right? Wrong. The EA is doing nothing at all, even for a "Last month" back-test. Does nothing after downloading GOAU4 historical http://prntscr.com/adxcbe it just hangs, no matter what symbol, conditions, etc. Dreema, are you sure this "Set market for next blocks" box work? Can I expect to see something like this image below from my EA's built from fxDreema?
http://2.bp.blogspot.com/_n3zFhUAFFR8/TEsLy3x52lI/AAAAAAAAAXI/AatZ4V0ICTQ/s1600/Multi-Currency+Strategy+Testing+with+MetaTrader+5_5.PNG -
There was a problem in Break Even, I fixed it.
I checked "Set market for next blocks" before in a simpler project and it worked for me. I will have to test your EA more, I still don't get what is it's problem...
-
Fixed. It was some while loop that never ends.
But now tell me something:
http://prntscr.com/ae4p85
http://i.imgur.com/P8zWbMI.pngBetween these two bars there are few days. I am searching for the Candle ID at 00:00 and it doesn't exists. So which one of these two is more correct? Candle 0 or Candle 1?
If Candle 0, then this is the current candle and it's Candle Close value changes. So we want to get Close at 00:00, but instead we are getting Close of the current candle, which also changes all the time...What is more sad is that candles from this black hole doesn't exists in lower or higher timeframes, so from where can we get the value we want?