cTrader calculate wrong Max equity drawdown
cTrader calculate wrong Max equity drawdown
06 Aug 2023, 16:03
Wrong Max equity drawdown (Maybe max balance drawdown too)
I have a bot that can manage risk from SL( in the picture I choose risk at 10% & SL=120pips).
And in OnTick I will calculate DD like this.
And It is Ok. At OnStop I print log like this. But it isn't same with the cTrader!
Replies
chatcpe
07 Aug 2023, 17:21
RE: cTrader calculate wrong Max equity drawdown
PanagiotisChar said:
Hi there,
Your drawdown calculation is wrong. The drawdown is calculated from the peak equity to the lowest equity after that.
Need help? Join us on Telegram
Where? THis is my code
private void CalculateDDForAccount()
{
try
{
var newDDdol = Account.Balance - Account.Equity;
if (newDDdol > MaxEquityDDInDol)
{
MaxEquityDDInDol = newDDdol;
}var newDDPercent = newDDdol / Account.Balance * 100;
if (newDDPercent > MaxEquityDDPercent)
{
MaxEquityDDPercent = newDDPercent;
}}
catch (Exception ex)
{
Print($"Error in CalculateDDForAccount : {ex.Message}");
}
}
@chatcpe
PanagiotisChar
08 Aug 2023, 05:32
RE: RE: cTrader calculate wrong Max equity drawdown
chatcpe said:
PanagiotisChar said:
Hi there,
Your drawdown calculation is wrong. The drawdown is calculated from the peak equity to the lowest equity after that.
Need help? Join us on Telegram
Where? THis is my code
private void CalculateDDForAccount()
{
try
{
var newDDdol = Account.Balance - Account.Equity;
if (newDDdol > MaxEquityDDInDol)
{
MaxEquityDDInDol = newDDdol;
}var newDDPercent = newDDdol / Account.Balance * 100;
if (newDDPercent > MaxEquityDDPercent)
{
MaxEquityDDPercent = newDDPercent;
}}
catch (Exception ex)
{
Print($"Error in CalculateDDForAccount : {ex.Message}");
}
}
Everywhere :) The whole code is wrong
@PanagiotisChar
chatcpe
10 Aug 2023, 10:22
RE: RE: RE: cTrader calculate wrong Max equity drawdown
PanagiotisChar said:
chatcpe said:
PanagiotisChar said:
Hi there,
Your drawdown calculation is wrong. The drawdown is calculated from the peak equity to the lowest equity after that.
Need help? Join us on Telegram
Where? THis is my code
private void CalculateDDForAccount()
{
try
{
var newDDdol = Account.Balance - Account.Equity;
if (newDDdol > MaxEquityDDInDol)
{
MaxEquityDDInDol = newDDdol;
}var newDDPercent = newDDdol / Account.Balance * 100;
if (newDDPercent > MaxEquityDDPercent)
{
MaxEquityDDPercent = newDDPercent;
}}
catch (Exception ex)
{
Print($"Error in CalculateDDForAccount : {ex.Message}");
}
}
Everywhere :) The whole code is wrong
I think it is already corrected.
@chatcpe
PanagiotisChar
07 Aug 2023, 12:14
Hi there,
Your drawdown calculation is wrong. The drawdown is calculated from the peak equity to the lowest equity after that.
Aieden Technologies
Need help? Join us on Telegram
@PanagiotisChar