MrMaths

Newbie
Sep 1, 2024
7
0
2
45
You should already be able to achieve that by using the Number of positions >= condition in combination with the Ignore profitable filter.

I've tested this. And it only closes all the losing positions when I click ignore profitable. What I'm looking for it closes all the positions in the pair in the particular direction. Is it possible to add this function as explained in my previous post??
Post automatically merged:

this one https://www.earnforex.com/forum/threads/account-protector.24067/post-236180
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com

chrissezhi

Trader
Jan 19, 2023
22
0
17
53
Hi and thank you again for a wonderful product. My need is simple, I think :) ... I just want to ensure when trades are open and closed, that AP monitors and if the account goes negative $350 disable Algotrading and if the account goes positive $350, close AlgoTrading. To monitor these dollar amounts, which setting do I use. The trades are cumulative (closed and open) and not watching one trade.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com
Hi and thank you again for a wonderful product. My need is simple, I think :) ... I just want to ensure when trades are open and closed, that AP monitors and if the account goes negative $350 disable Algotrading and if the account goes positive $350, close AlgoTrading. To monitor these dollar amounts, which setting do I use. The trades are cumulative (closed and open) and not watching one trade.
You need two conditions ('Equity - snapshot >= 350' and 'Snapshot - Equity >= 350') for one action ('Disable AlgoTrading').
 

Tonywong131

Trader
Sep 12, 2024
9
0
7
34
Hi Enivid, thank you very much for designing this good EA. I have two questions.
First, from my understanding, the system will use the Broker 00:00 balance every day for account balance revaluation. But this number is hidden in the EA. In future versions, is there any opportunity to display it, similar to equity balance snapshot? Because I mainly do manual trading. It is useful for me to know which exact number is used for EA.
Secondly, I want to make sure daily profit/loss >=/ <= % of balance, including realized and unrealize profit.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com
First, from my understanding, the system will use the Broker 00:00 balance every day for account balance revaluation. But this number is hidden in the EA. In future versions, is there any opportunity to display it, similar to equity balance snapshot? Because I mainly do manual trading. It is useful for me to know which exact number is used for EA.
If you are asking about the Daily profit/loss conditions, then yes, they are calculated based on the balance at 00:00 broker time. Perhaps, I will add the display for its value in the next version.

Secondly, I want to make sure daily profit/loss >=/ <= % of balance, including realized and unrealize profit.
By default, it includes both realized and unrealized profit. However, you can set the CountFloatingInDailyPL input parameter to false to count only realized profit.
 

Tonywong131

Trader
Sep 12, 2024
9
0
7
34
If you are asking about the Daily profit/loss conditions, then yes, they are calculated based on the balance at 00:00 broker time. Perhaps, I will add the display for its value in the next version.


By default, it includes both realized and unrealized profit. However, you can set the CountFloatingInDailyPL input parameter to false to count only realized profit.
Very appreciate for your prompt reply and hard work. Sorry one more question, for those % field, for example 5% daily loss, should I just input -5 or 95 only, or both work
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com
Very appreciate for your prompt reply and hard work. Sorry one more question, for those % field, for example 5% daily loss, should I just input -5 or 95 only, or both work
This depends on what you are trying to achieve.
If you want the AP to trigger when Daily profit reaches 5%, you set 'Daily profit/loss >= % of balance' to 5.
If you want the AP to trigger when Daily loss reaches 5%, you set 'Daily profit/loss <= % of balance' to -5.
 

Tonywong131

Trader
Sep 12, 2024
9
0
7
34
Hi @Enivid , about that Booker time 00:00, EA uses the account balance reference, does it include floating profit/loss. for example, Broker time 00:00,
Account balance: usd10000,
Floating profit: +1000,
Does EA uses usd11000 as balance snapshot?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com
Hi @Enivid , about that Booker time 00:00, EA uses the account balance reference, does it include floating profit/loss. for example, Broker time 00:00,
Account balance: usd10000,
Floating profit: +1000,
Does EA uses usd11000 as balance snapshot?
Oh... Actually, I just saw that there is a bug with the initial balance check when there was some floating loss at that time. Currently, it will calculate this value incorrectly unless you have CountFloatingInDailyPL set to false. If you have it set to false, it will calculate only realized account balance at 00:00 without any floating loss or profit. If you have it set to true, the balance calculation will be completely wrong.
 

Tonywong131

Trader
Sep 12, 2024
9
0
7
34
Oh... Actually, I just saw that there is a bug with the initial balance check when there was some floating loss at that time. Currently, it will calculate this value incorrectly unless you have CountFloatingInDailyPL set to false. If you have it set to false, it will calculate only realized account balance at 00:00 without any floating loss or profit. If you have it set to true, the balance calculation will be completely wrong.
I see, looking forward to see you fix the bug. Again, many thanks for your time.
 

Tonywong131

Trader
Sep 12, 2024
9
0
7
34
No, it considers the daily starting balance to be the balance at 00:00, not the equity at 00:00.
So it means, when I have positions with floating pnl carry over 00:00, I can not use daily pnl< / >= % of balance, because it wont be accurate, because balance only calcluate realized pnl. In this case, I still need to use dailly pnl < / > = % of equity. Need to set up another AP instance for capture snapshot repeat daily and daily.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,234
1,507
144
Odesa
www.earnforex.com
So it means, when I have positions with floating pnl carry over 00:00, I can not use daily pnl< / >= % of balance, because it wont be accurate, because balance only calcluate realized pnl. In this case, I still need to use dailly pnl < / > = % of equity. Need to set up another AP instance for capture snapshot repeat daily and daily.
Yes, if you want conditions based on the daily PnL as % of equity, then you need to set it up via global snapshots and a second AP instance.