|
Kiran
2016-04-24 13:31:51
|
|
I wrote a simple EqMM script (below) that rejects positions if the portfolio drawdown exceeds a threshold.
Challenge is the drawdown seems to be calculated on positions accepted vs all positions triggered, so the equity curve never climbs out of the hole.
Is there another variable in MM I can access that calculates drawdown based on positions triggered?
// Reject if Drawdown .. OnNewPositions section
double dd_threshold = (double)Variables.GetVariable("Drawdown");
double drawdown = Portfolio.Drawdown;
if(drawdown < dd_threshold)
{
Divers.Output("Position Rejected: " + NewPosition.Symbol + ", Drawdown=" + drawdown + ", DD threshold=" + dd_threshold);
Functions.RejectPosition();
return;
}
|
|