Oh no, I'm leaving this for someone else. I'm already tired of trying to trick MQL4 to do what I want today. But if you have some specific problems (bugs and crazy situations), I will check them 
Posts made by fxDreema
-
RE: How to put pending order in dreema?posted in Questions & Answers
-
RE: GTCposted in Questions & Answers
To be honest, I have no idea what will help. MT5 is full of problems by itself, so what happens when we add fancy market name. At least tell me what is this broker that you are using.
-
RE: crossoverposted in Questions & Answers
Looping in candles is hard to do with blocks. Not impossible with some Variables, but it doesn't look very good. If you want, compare candle X with candle X+10.
-
RE: Fibonnacciposted in Questions & Answers
No. I use the word "Condition" to point to all these... things that you can find there. They are also accessible from other blocks.
Some objects have 1 price (arrow, horizontal line), others have 2 prices (trendlines, rectangles, fibonacci...), others have 3 prices (triangles..). In the blocks where you create objects, you can see how many prices and times it uses. This is different for each object.
-
RE: GTCposted in Questions & Answers
For pending orders you can change this.
For positions the expiration is always set to 0, because there is no expiration for positions anyway. There is another property for the request type_time, but according to the documentation this is only used for pending orders https://www.mql5.com/en/docs/constants/ ... aderequest
I'm not really convinced to change something in the code only because some weird market name with weird rules
-
RE: Fibonnacciposted in Questions & Answers
Mmmmm yes. Somewhere in Condition, where Object attributes are, search for Fibonacci attributes (somewhere at the bottom of the list of attributes) But it can be tricky, especially if you use some of these fancy looking fibonacci

-
RE: Memory stuffposted in Questions & Answers
Flags are similar to Variables. You can't display their state and I don't remember even thinking about this, but this is a good idea. Where to print such information is another question
You can try this "Change Status to" thing that each block has.Yes, in "For each Trade" you can put multiple Group numbers, separated with comma, like this "1,2,3". This also works for market names.
If you use the Comment attributes of trades, note that if you have SL or TP and the trade is closed by SL or TP, some information can be appended to the comment by the broker. For example [sl] or [tp].
-
RE: How to put pending order in dreema?posted in Questions & Answers
Not so much
You can look at these examples, they cover some basic stuff: https://fxdreema.com/examples -
RE: How to put pending order in dreema?posted in Questions & Answers
If I am not missing something... https://fxdreema.com/shared/YjPgwx5Nb
-
RE: Memory stuffposted in Questions & Answers
Also you are looking for troubles when using "on Trade" event to count something. This will only work fine if the EA is working without interruptions. This can be desired sometimes, but in most cases we don't want that and we restart/close EAs many many times. Here you decided to store this information in some persistent memory. What happens now if you lost connection for 1 hour? The market will continue working and everything in the world will change. Your variables are still available, because they are stored in a file, but now they are 1-hour old. They represent a snapshot that is 1-hour old, but now the picture is totally different. There are movements of 400 pips in 1 hour

Magic Number, SL, TP, Lot size, Comment - these are also storage areas and what's best is that they are stored on the server. Magic Number will work best in your case I think. Let's say that the presence of a trade with Group # = 3 means that you are in stage X of the strategy (Group # is related to the Magic Number). You don't need to write and read files, use Variables, and GVariables, and have 200 extra blocks only to keep things in some order.
When the EA is added to the chart, it can detect if trade with Group # = 3 exists, which means that the EA is in stage 3 (for example). If there is a trade with Group # = 4, then the EA is in stage 4. You can collect data from closed trades as well. Also from currently running trades. Also from pending orders. So I believe that you can do everything in a much simpler way. And when you stop believing that "hedging" leads to success, even simpler way

-
RE: Memory stuffposted in Questions & Answers
I think it's all fine with GV. Yes, if the requested GV does not exists, it returns EMPTY_VALUE (the biggest 32 bit integer), not 0. This value is also used by indicators to say that there is no value. I also decided that this value will be returned from requested graphical object that does not exists. So, in short, EMPTY_VALUE means that the thing you are looking for does not exists.
But how this can be used? I recently modified "Condition" block, so if one of it's operands equals to EMPTY_VALUE, the block will not pass. The idea is that if you are searching for something (GV, indicator value, object) that does not exists, there is no reason for the Condition block to pass, one of it's operands is missing and everything should stop at this point. When the thing that you are searching for is available, Condition will do it's work normally.
Well, not all blocks care if some value is EMPTY_VALUE, so most of the other blocks will do their job normally. -
RE: Memory stuffposted in Questions & Answers
There are 2 things that I really don't like in trading strategies - Zig Zag and the idea of "hedging". Now I'm sure that your project is overcomplicated, starting with the idea to "hedge". You will eventually realize that it's not a good idea to use reverse trades instead of SL and that "hedging" is just a way to make things progressively complicated. By "hedging" I mean opening reverse trade in the same market.
I will check what is going on with this EMPTY_VALUE...
-
RE: Memory stuffposted in Questions & Answers
Let's talk about trading. Can you explain the strategy itself, what do you want to do with the trades?
-
RE: Calling functionsposted in Questions & Answers
They also appear directly in the output code, but I would not recommend to use these
I'm already working for a new way of generating EAs and I was even thinking to lock/hide them somehow so they can't be used. -
RE: Memory stuffposted in Questions & Answers
What are you trying to do? I saw your project and you have Variables, GV and flags sharing the same name and controlling the same thing. Maybe your mindset is always telling you to convert data from one way to another. I think there must be a better and simpler way of doing whatever you are trying to do.
If you store values in Variables, they are lost when the EA goes down.
If you store values in Global (Terminal) Variables, they are probably not lost, but they can be already old when you open the EA hours later. The EA still needs to run most of the time, otherwise it will lose synchronization.
If you store values in a file, it's the same story. Terminal variables are actually written in files.
If you store values in chart objects, then you are limited to the chart only. And again, the data can become old.In all this situations you can lost data or use wrong data.
At the end, you are controlling trades. The best way to store information regarding trades is to store in right inside them. Well, unfortunately we don't have many custom fields to write data in, the only one is the Comment. Also SL, TP, Lot size and Magic Number are used for trailing stop and money managements.
-
RE: Changing the blocks order - questionposted in Questions & Answers
Block numbers are not important normally. Only when you have 2 or more blocks in parallel, the one with lower number will run first.
-
RE: Calling functionsposted in Questions & Answers
Directly. You can use native MQL4 functions in all input fields. Well, with some tricks in input fields that belongs to string parameter.