Increase lot when privious trade hits SL
-
hi everyone
i am having trouble in increasing the lots in this project, i took help of earlier shared post in here, i believe it somewhat working but not working completely. i want to increase the next lot by lot multiplier when SL is hit. i don't understand the lotsReset function completely which i used. here is my project,please check
https://fxdreema.com/shared/q3MeZqpQb
Thanks
-
@foxeye I'm afraid I'm not good at custom code but apparently you want to limit the numer of lots used. Can you please explain how is it supposed to work?
-
i want the next lot to decide according to previous loss amount.
suppose first lot is 0.5
0.5*10 pips = -5$ SL hit. my question is how many lots should i use next to recover 5$ ? whatever the loss is , it should calculate the lot according to it. i hope you get it what i want to explain. -
I think it's not possible. Is it?
-
@foxeye I would create a whole structure with variables, so I cannot confirm your custom code is wrong. You would need one variable to store the last closed trade and another one to canlculate the new lot size for the next trade.
-
Can you please suggest me the variable & how to set it to get the last closed loss trade? I don't know much coding.A rough idea would be enough, please
Thanks

-
@foxeye Sure! Here you will learn how to create a variable for that last lot size:
https://fxdreema.com/instructions/builder/constants-and-variables
And here you have the structure to store the value of the last closed trade's lot size into a variable I created:

Please notice I used those blocks on the 'on Trade' tab. That way you don't need to worry about storing any previous closed trade.
-
thanks for the reply but i don't want to store the value of lot size, i want to store the value of last closed trade (the negative amount) & change the next lot according to it.
example - suppose my last close trade is -5$ , my next lot should be 5 lot, if it's -3$ the next lot should be 3 lot.. i hope you understand now. -
-
IS this a correct way? i don't know what this code doing 'lot_buy=(StringSubstr( last_buy_trade_money, 1, 4 ));'
-
@foxeye The code is taking digits from the variable, as a loss always starts with -, you have to start 1 after to be able to use. The second part is checking if condition is true, if so it changes the lotsbuy variable to match lotstart variable.
-
@jstap idk it's not working as i want, after a loss it's still trading with same lot. am i missing something?
-
@foxeye Most likely, you need to have buy and sell in on chart, this is what makes EA to buy/sell with the increased lot in this link I have put the mt5 version, if you press the ex5 button then you will get the EA to see working on back test, if you press the MQ5 button you will get it in FXDreema to adjust how you want.
