What a stupid problem, one symbol in a comment somewhere in that block caused it 
Posts made by fxDreema
-
RE: MQL5. check profit (unrealized)posted in Bug Reports
-
RE: Area resize disabledposted in Bug Reports
I will take a look. Probably I missed some JS script when I updated the website the last time.
-
RE: object on chart has no parameterposted in Bug Reports
Yea, this looks strange to me as well and I will fix it hopefully in minutes.
-
RE: FXDreema Expert Advisors not working since latest updates to code were made.posted in Bug Reports
Warnings are most probably not the reason. But can you tell me one of your projects that you know it should work? Meanwhile I will try the newest one for example...
-
RE: How to log variables to the console using Log Messageposted in Questions & Answers
Take a look at my answer here, I think it should be similar: https://fxdreema.com/forum/topic/4969/how-to-add-values-of-double-variable-to-string-variable/4
-
RE: Trying to move stop loss to the 50 EMAposted in Questions & Answers
For me it works for buys
I see errors in my logs such as "Invalid TP...". But I guess it depends on the position of the MA line relative to the current price. You may want to check that before modifying stops. Or you may try the Trailing Stop block, I think it is a little bit more clever and there was some option to follow such line.I see some bug in the way input parameters are displayed now in the "Modify stops" block, I will check this later.
-
RE: Momentum EA 1-2-3-4 Periods - Time Frame 1Hposted in Questions & Answers
Normally people got the same result with only one "Close trades", and you have soo many
Which I don't understand, because they are pretty much the same, you can probably use just one. But it's important to make sure that this block does not run on the next (or even the same) tick after the trade is created. Remember that these blocks are under "on Tick", so they run on every tick. Make sure that the conditions above "Buy now" and the conditions above "Close trades" are different and have no chance to be true at the same time. -
RE: Martin gale system - Just started coding so all this is new to meposted in Questions & Answers
I see common mistake that I tried to explain here - https://fxdreema.com/demo/mt4-wrong-closing-rule
Maybe you want to use that option for custom sequence in the Money Management options. Try it with just "No trade -> Buy now" and see what happens.
By the way the word is a whole word "Martingale". I think this is not a name of a person, it's something else - http://www.dictionary.com/browse/martingale
-
RE: Time optimizationposted in Questions & Answers
If something fails to work in some days, it should be because you use ==. Imagine that you never got a tick at 00:00, but you got ticks in 23:50 and 00:01 - in this case you missed a signal only because there is no tick modeled at exactly 00:00.
-
RE: How can I create trades in a row with diffrent Magic Numberposted in Questions & Answers
I think this works: http://prntscr.com/ikmyls
Note that the input field is actually a string and that's why the ++ method doesn't work. And it is a string, because I use the same input parameter in other blocks where you can write values such as 1,2,3,4,5. But I tried solution above and I think it works.
-
RE: How to add values of double variable to string variableposted in Questions & Answers
Don't use this c:: prefix, this is something from the EA and I might change this in future. In the blocks write just the name of the Constant, just Group.
Try this: "" + "Long Trade " + Group + ""
When you add "" + in the beginning and + "" at the end, this basically "opens" the input field to MQL code, otherwise everything you write is a string. Why that works? To be honest, it was never my intention, long time ago I just found that it works somehow and I think I will never change it, but who knows.
-
RE: Filter trades by age. Number of bars elapsed rather than minutes.posted in Questions & Answers
Let's say the age is 55 minutes. The age written in MQL4 is like this:
OrderCloseTime() - OrderOpenTime()If the period is 15 minutes, then you can just divide: 55 / 15. The result is 3.666. Now, you can use either MathFloor() or MathCeil(), the first function will give you 3 from 3.666 and the second will give you 4 from 3.666. Try this: http://prntscr.com/ikmrdw
-
RE: Filter trades by age. Number of bars elapsed rather than minutes.posted in Questions & Answers
I think once in the past someone asked the same question, I don't remember what solution I gave him. But I think that with some calculations you can get the number of minutes from the bars. I don't know what calculation and I am actually very very bad in mathematics, but here is some example that shows that you can do such things.
MathFloor((TimeCurrent() + 86400) / 86400) * 86400Here TimeCurrent() gives you the current time, the value that this function gives is going up with 1 each second, so the value is the number of seconds since 1 Jan 1970. More here: https://www.epochconverter.com/
And MathFloor() is a MQL function that is described like this "The function returns integer numeric value closest from below."
So, the whole calculation is giving you the time at 00:00 of the current day, no matter if TimeCurrent() is giving you the time at 02:10 or 18:45 of the day.
So there should be similar formula that turns the age of the trade into number of candles.
-
RE: How to get price range from highest price and lowest price in specific time rangeposted in Questions & Answers
Those long numbers are because of the way they are stored in the memory, this comes from the C programming language. I don't understand it very well, but they simply exists like that. There is a function NormalizeDouble() that should turn them into normal numbers, but even that sometimes doesn't work... I don't know why. I put that function all around the blocks, but still long numbers appear out of the blue.
-
RE: How to make an EA alert message before it is attached?posted in Questions & Answers
But you attach it, you probably want it do to something? Otherwise I think you ca make a Script instead, and try that block "Prompt", it's somewhere on the bottom of the list.
-
RE: How to get price range from highest price and lowest price in specific time rangeposted in Questions & Answers
You mean those long long numbers? They should be treated with NormalizeDouble(), but I found out that even this doesn't help all the time.
-
RE: Read Lines on Chart and close trades and no tradeposted in Questions & Answers
Well, lines are chart objects and as you probably know, all objects can be found in one "pool" of objects where each one has unique name. So here are the ways to find certain object - https://fxdreema.com/examples#Chart-Objects You either have its exact name and you can get it directly, or you search for the right object. Then, when you select the object you can also get its value - Price, Time, whatever.
You have some "For each Object" blocks in your project, but I don't see their purpose there. They would select each object, even if it is some arrow or label somewhere on the chart. So what these blocks do for you is only to slow down the backtest of the EA

-
RE: Making an EA to send email when any trade is closed.posted in Questions & Answers
Try something like this - http://prntscr.com/ij2lv3
-
RE: Error to load a custom indicatorposted in Bug Reports
The first indicator works for me. The second is saved in one of these ways that I always wonder how to read correctly. I will take a look later, but now I can tell you how to solve the problem easily. Just make an empty .txt file, paste the source code there and rename the extension to .mq5.
-
RE: How to get price range from highest price and lowest price in specific time rangeposted in Questions & Answers
I still don't recommend to anyone to use my functions, such as toPips(). One day I may rewrite the function or simply delete it. I'm very bad at planning, so very often when I look at my old work, I don't like it. So I change my code from time to time. toPips() in particular was never changed, but who knows.
What I don't like in this function is that it actually has second parameter, which is the symbol. In other native MQL function the symbol is the first parameter.