https://fxdreema.com/shared/CUogthrsb
There is a block "Modify Variables". Most attributes have numeric data type, like "int" or "double". Here is more: https://docs.mql4.com/constants/objectc ... t_property
https://fxdreema.com/shared/CUogthrsb
There is a block "Modify Variables". Most attributes have numeric data type, like "int" or "double". Here is more: https://docs.mql4.com/constants/objectc ... t_property
For some reason blocks with titles containing this strange looking "o" with something above it does not work. I will suggest to use the normal latin letter "o" instead
I will try to fix this tomorrow
This is the idea. The second order is like in a mirror. Then, when one of them is trigerred/deleted, the other is automatically deleted.
Yes, this is normal. Any unclosed trades are automatically closed at the end and this drop means that they are unprofitable
There is no block to check this, but here is something that collects that data - https://fxdreema.com/shared/5viHJzgYc I have 2 numeric Variables. They are reset every time in "For each Closed Trade". This block is set to work with up to 10 closed trades. For each one of them it checks the type (Buy or Sell) and depending on this one of both Variables is incremented. When all 10 trades are checked, the "Comment" block runs and shows the results.
So you have Sell pending order somewhere and certain Buy trade must be closed at the same price at which the Sell order is trigerred. What if you have SL/TP for this Buy trade that is set to that price?
For "Open at price" choose "Custom level" and select the indicator. I guess that "Price offset" must be 0 in this case.
I don't understand the second question. Indicators are only giving numeric values, they have nothing to do with orders and positions. If you want 1 trade (position in MT5) at a time... https://fxdreema.com/demo/mt4-buy-now-i ... ade-exists But if you have multiple pending orders, well, you can't stop them from turning into trades until you delete them 
Nice observation
I think I fixed it
I don't know why people prefer to connect blocks like this. The idea of these "Bucket" blocks is to:
And the idea is that 2) **must **happen after 1). But for some reason if there are blocks that must run in certain order, people don't connect them in any order. Insted, probably because it looks more pretty, they connect blocks in this parallel fashion. When blocks are connected like this, then their numbers matter and this is the problem.
I don't want to turn the value from EMPTY_VALUE to 0 only because of this example. As I said, there is a reason why I use EMPTY_VALUE. What I can do is to turn EMPTY_VALUE to the minimum lot size in the functions that calculate lot sized. Because 0 is nothing, but EMPTY_VALUE also represents nothingness, although it's value is a huge positive number 
Hopefully these hints will help. Because to be honest, what you are trying to do is too twisted for my weak lazy brain 
Condition -> Close trades
This should be under "on Tick" of course. Also, blocks like "Once per bar" can be used... if needed. I think the idea is clear. The condition checks two values and when the result is true, "Close trades" will close the trades 
So, each trade has it's own role in the game and there is something like stages. In this case I am thinkig about the Group number. The first trade can have number 1, the second trade can have number 2. Then in any time you will be able to check the Group number of the last closed trade.
About the stages. One way is to set the current stage as a value in a variable. If the variable is numeric, then let's say that stage 1 will be described with value 1, stage 2 will be value of 2 and so on. The downside of this is that Variables are something temporary and in case the EA is closed, they are gone.
Another way is by usinf this feature https://fxdreema.com/demo/mt4-wait-crossovers These blocks with the blue border are something like stages. Each one of them will wait until it passes. This can be used if the logic can reach the last point and start again from the top
I use 2147483647, also known as EMPTY_VALUE normally on purpose. The reason is that "Condition" does not pass if one of its sides equals to this value. This simplifies things. If you have "Condition" block and inside you have something (indicator, object...) that does not exists, then there is no reason for this block to pass. This is the idea. But maybe the idea is not very good for Buckets. Can you give me some small example (not your actual project, it contains many blocks and I'm lazy to investigate it) that shows your idea?
Go to My Indicators and try to add some indicator. The indicator is not really uploaded, only the needed data is read locally and then sent to the server. Only name, input parameters and buffers are needed. Then the indicator appears in blocks lile Condition. You still must have the file in /Indicators. No, indicators are not embedded in the EA, they are separate programs.
I can explain.
MT5 has two functions to make a position - OrderSend and OrderSendAsync. The first one, OrderSend is the one that is supposed to be synchronous. In other words, when this function is called in the code, the program will wait until there is response from the server and only then the program will continue to the next row in the code. While if you use OrderSendAsync, the program will not wait for the position to be created.
I use OrderSend, but unfortunately this function is not 100% synchronous, it is semi-synchronous. Yes, the function will wait for responce from the server. But let's say that you modified SL of the position. If you try to load the position and read the new fresh SL, you will actually read the old SL. Only few moments later you will be able to read the new SL. I don't exactly know why it happens like this, I think that second responce must be received from the server. Let's say that this is the case, but that second response needs to be read from special event function - OnTradeTransaction(), which makes the code asyncronous.
So how I deal with this situation - I have infinite loops immediately after OrderSend. Let's say that you modify SL. The first response from the server tells the EA that everything was fine and the SL was modified. But I need to wait until the data is updated locally. And I do exactly that - in an endless loop the EA is checking if SL is changed and when this is detected the EA exits the loop and continues to do it's other work.
I must say that using infinite loops is something like a hack, it's never a good idea to use them like this, and this is not the right way to do things, but it works. And you know why I use them? Because there were problems when the EA is working on live. Everything works fine with or without these infinite loops in the Tester.
But for some reasn if the account is made with the hedge option, nothing works the same way in the Tester. Maybe there is some bug, this is new option. I don't know, but my infinite loops just don't work in the Tester. If I remove them, then the problem will be that the data will not be updated immediately.
Or, if I decide to use OnTradeTransaction() to catch the moment when the data is updated, this will make the way we connect blocks in fxDreema impossible. Because you want after some "modify" block to be able to read the modified data immediately.
I don't know, I need some hack again. But at this time this "hedge" option is still new and I think that brokers still does not use it. Who knows whether they will... That's why I'm not in hurry to fix this problem 
If this account was created with this option, I admit, it will not work:
http://prntscr.com/bmsfza
http://image.prntscr.com/image/66a9b493875e487daf5d3a9eb715612f.png