Last stand: measured against the full daily loss, not the stop after its reserve
The rule is: when hitting the day's loss limit would leave the account 15% of that loss or less above its max-drawdown floor, ride without a daily-loss stop. It had compared against the stop-out after the 10% reserve, which made it stricter — $3,294.70 to the floor with $3,000 of daily room (9.8% left) wasn't a last stand, and now is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ff9b107452
commit
5a4e85cc18
@@ -375,16 +375,19 @@ test('max-drawdown room: the static floor, the broker floor, the higher', () =>
|
||||
assert.equal(maxLossRoom({ balance: 99000, accountSize: 100000, maxLoss: 0 }), null);
|
||||
});
|
||||
|
||||
test('last stand: no daily-loss stop once a stop-out would leave under 15% of it', () => {
|
||||
// Full day: a stop-out spends $2,700 (room less the $300 reserve).
|
||||
test('last stand: no daily-loss stop once hitting the daily limit would leave 15% of it or less', () => {
|
||||
// A full day's $3,000 of room.
|
||||
const at = (maxRoom) => lastStand({ dllRoom: 3000, dailyLossLimit: 3000, maxLossRoom: maxRoom });
|
||||
assert.equal(LAST_STAND_FRACTION, 0.15);
|
||||
assert.equal(at(5757.39), false, 'a fresh 1-Step keeps its stop');
|
||||
assert.equal(at(2700 * 1.15 + 1), false, 'just over 15% left: keep the stop');
|
||||
assert.equal(at(2700 * 1.15), true, '15% left: last stand');
|
||||
assert.equal(at(3000), true, 'two stopped days in: last stand');
|
||||
assert.equal(at(800), true, 'floor nearer than the stop: last stand');
|
||||
assert.equal(at(3000 * 1.15 + 1), false, 'just over 15% left: keep the stop');
|
||||
assert.equal(at(3000 * 1.15), true, '15% left: last stand');
|
||||
assert.equal(at(3294.70), true, 'one stopped day in: $294.70 left, 9.8% — last stand');
|
||||
assert.equal(at(800), true, 'floor nearer than the limit: last stand');
|
||||
assert.equal(at(null), false, 'no floor known');
|
||||
// Measured against what's left of the day: $1,000 of room, $1,200 to the floor.
|
||||
assert.equal(lastStand({ dllRoom: 1000, dailyLossLimit: 3000, maxLossRoom: 1200 }), false);
|
||||
assert.equal(lastStand({ dllRoom: 1000, dailyLossLimit: 3000, maxLossRoom: 1150 }), true);
|
||||
assert.equal(lastStand({ dllRoom: Infinity, dailyLossLimit: 0, maxLossRoom: 500 }), false, 'no daily limit, no daily stop to drop');
|
||||
// The far side of the walk is the nearer floor, net of the entry fee.
|
||||
assert.equal(breachDistance({ dllRoom: 3000, maxLossRoom: 2900, entryFee: 120 }), 2780);
|
||||
|
||||
Reference in New Issue
Block a user