Stop Trading when the daily target or loss is achieved
-
Hello @l-andorrà @FXDREEMA-0 @miki
I wanna have an expert that can close the existing running trade automatically with two options condition :
1 Stop trading when the daily target profit is achieved (1% of equity)
2 Stop trading when the daily target loss is reached (5% of equity)Is this block structure correct? https://fxdreema.com/shared/yGZpQ1zLc
Always thank you very much

-
@zedeai2 You need some changes.
- You can remove the 'Pass' block on top.
- Substitute it by a 'For each trade' block instead.
- Move that 'Once a day' block below both 'check profit/check loss' blocks. One below each block.
-
@zedeai2 in your project the check is done only on the last position, even by adding "for each trade" block, the check is done in a loop on every single operation. If you want to check a trade basket use "check profit (unrealized)" block, but in this case the percentage must be calculated separately because the block does not have that function. After use close trade block to close all trade not terminate block.
-
@l-andorrà Great, I will try it!

-
@miki Okay, I will try it too!
Thanks a lot -
Looking to do something similar to this project mentioned, as a max daily loss parameter, but not sure if this project above will achieve it.
If -3% or more of balance lost in a single day then no more trades may be initiated until the next calendar day. (a max daily loss condition)
What I'm looking to do is if I lose 3% of my account in one day, I want to stop trading for that day and start again the next calendar day.Thanks for the help!
-
@sauce it depends on what you have to calculate it on, whether only on closed or open and closed trades. However, a pattern can be as you see in the image.

-
i would recommend to work with 2 variables loss (already closed positions) drawdown (running positions)
if you check this 2 numbers before opening a new position you are fine i think. drawdown is something you can reset after each trade and loss daily (just a recommendation)
-
@bk7 @miki my condition would be based on after a trades is closed and I'm now -3% for the day (if there are other current open trades, they are allowed to remain open). I just want to prevent any NEW trades opening for the rest of the day if I've lost 3% of my account for the day. Would that change the pattern, or would you mind reposting that pattern? Thank you!
-
@sauce
as i said before i would make the check before opening a position and if you have reached the limit dont open it and send a message mail alert whatever, so you can enter the trade if you want manually or just stay away.would look like this
once a day / at a specific time = store balance/equity to variable
calc stop level and store it to a variablebefore opening a new trade check if current balance/equity is higher than or euqal stop level if yes open trade if no alert,message, or simply nothing
-
@bk7 @miki working on it a little more, makes more sense to just focus on max drawdown of 3% and if I'm ever 3% max drawdown for the day, I want to shut it down for the day. Close all positions and prevent new ones from opening. Miki suggestion would accomplish this right? (I feel like I'm overcomplicating it, so just want to be sure)
-
yes his solutions:
part 1: grabs once a day the balance calculates the stoplevel and stores it and turns on all blocks
part 2: needs to run before any main calculation of the ea takes place (checks if balance below if true close all positions and turn off blocks (dont turn off the once a day block) -
-
@bk7 how do I make sure the "turn off blocks" doesn't turn off the "once a day > turn ON blocks"
Will this work? (disregard the weekday, time filters)
Note: the otherwise off of max daily drawdown condition begins the trading calculation/parameters with No trade/order
-
@sauce unlink account management block from one a day and in turn off/on blocks put 1
-
Hello. I have no not enough knowledge about fxdreema block.
Please anyone can make "stops trading after reaching the daily profit target and automatically resumes trading the next day". And give me this project link.
I want to do juat copy & paste on my ea please



-
check profit (period of time) < value - above buy/sell tree, check profit (period of time) > value - close block (if you want to close all if profit reached.
-
@miki Please i really don't understand anything here and too want to make an ea that would stop trading for the day once i hit a 3% total loss and also stop trading when i hit about 2% total profit
then it starts again the next day.
Please, can you help create something like that so i just follow your own?
Thanks
-
I dont understand do you make it for me then give the link plzz

-
Start a new question, create a test project, and if not working add and say the problem