The point is that I would like to multiply, not add. When the multiplication occurs, for example 0.01 *1.1 = 0.011, there is a way to "write" the exact lot (which will then be rounded by the broker) but the expert will take into consideration the correct size for the next multiplication (with decimals)?
Best posts made by Crisfx
-
RE: Lots multiplication problemposted in Questions & Answers
Latest posts made by Crisfx
-
RE: Lots multiplication problemposted in Questions & Answers
@jstap I have been testing it for some time and everything works fine, thank you very much.
-
RE: Lots multiplication problemposted in Questions & Answers
@jstap I tried and the sequence continues even after restarting the mt4, fantastic. Thank you very much, can I ask you how these blocks "work"?
I have just these "alert" during compilation: implicit conversion from 'number' to 'string'

-
RE: Lots multiplication problemposted in Questions & Answers
I had to create a variable called BUYMART because it gave an error during compilation. I copied the blocks into my project and tried in demo but it doesn't multiply.

-
RE: Lots multiplication problemposted in Questions & Answers
I tried but now it doesn't even multiply anymore, since I modified the "modify variable" block. This is because by using it in loop he will still read the lot (already rounded by the broker) of the last open operation (0.01) and then using "adjust" he will multiply it *1.1. But it will be rounded again by the broker to 0.01 and the next pips away the same thing will happen, in loop it will read the current size of the operation of 0.01. In this way there is no real "sequence" with a variable that increases the lot to follow, the initial size always remains.
-
RE: Lots multiplication problemposted in Questions & Answers
Perfect, I'll try it. However, I can't understand how it can solve my problem, currently with the block that I attach(photo) in case of crash/reopening it starts again from the last trade reading the lot. But when he reads the lot of the last trade, can he also read the thousandths?
Original trade 0.01
2 trades 0.011
3 trades 0.0121
4 trades 0.01331
5 trade 0.014641 (the broker open 0.01) -> if the platform restart here, when restarting the "for each trade" block and all subsequent ones, what lot will they read? 0.014641 or 0.01 (like the last open trade as it is automatically rounded by the broker)? I understand that it is then adjusted using *TrendMultiply but it would mean starting again as if it were the 2nd trade. As I specified, my problem is to "continue" the multiplication sequence even if the mt4 were to restart due to any problem.
-
RE: Lots multiplication problemposted in Questions & Answers
@jstap "in the modify block get the running trade value"
Do you mean to modify the "modify variables" block on the right by selecting (in loop) Trade/Order in Loop - Volume size (lots) - Current volume and insert *costantmultiplication in Adjust section?
"Also use the code in your buy block under numeric value, text code input, and then your multiplier value will be corrected to the correct 0.00"
By code do you mean MathRound(Lots* 100.0) / 100.0 ?
To be inserted in the buy block on the right tree?
I have to use a custom value for this I guess, so I block buy / money management CUSTOM VALUE / Text (code input) / in "sample text" I insert the variable with the lot and in adjust I insert the code I wrote above? -
RE: Lots multiplication problemposted in Questions & Answers
It's difficult to understand, I'll explain why: if the mt4 platform is not closed and reopened, everything works correctly. The problem comes when it is closed and reopened and at that point when the For Each Trade/pips away etc block is activated the error I showed you appears, as if the buy or sell connected to the "For each trade" chain wants to use a variable which apparently has been reset/lost/forgotten, since if the mt4 is not closed and reopened the same chain works perfectly.

-
RE: Lots multiplication problemposted in Questions & Answers
@jstap Apparently 0. In fact you can read it inside the alert: for the broker I am trying to open at 0.0. It means that the expert after the reboot has "lost" the variable count, which is now 0.
-
RE: Lots multiplication problemposted in Questions & Answers
@jstap It doesn't happen immediately when I close and reopen the platform. It only happens when the "pips away" condition occurs after the restart, then in this case having to open another trade with that distance the error I sent you comes out. I attach you two screenshots, in the first you see the 3 open trades (2 buy and 1 sell), after which I close and reopen the mt4, after a few minutes another sell opens (I set 1 pip as pips away otherwise it would take days to test) and here's the error. Even if he had to open 0.02 or 0.03 the error would still have occurred. It has already happened to me other times, when this happens it is because for the expert the variable is 0 at that moment.
I'm using the one I sent you in the last link: https://fxdreema.com/shared/qq3YsnW8c

