work on calculations
This commit is contained in:
parent
3d910a13e0
commit
ab7ef2b678
20 changed files with 1343 additions and 222 deletions
19
libs/utils/test/simple-test.ts
Normal file
19
libs/utils/test/simple-test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { fixedRiskPositionSize } from '../src/calculations/position-sizing.js';
|
||||
|
||||
try {
|
||||
console.log('Testing position sizing calculations...');
|
||||
|
||||
const result = fixedRiskPositionSize({
|
||||
accountSize: 100000,
|
||||
riskPercentage: 2,
|
||||
entryPrice: 100,
|
||||
stopLoss: 95
|
||||
});
|
||||
|
||||
console.log('Fixed risk position size result:', result);
|
||||
console.log('Expected: 400 shares');
|
||||
console.log('Test passed:', result === 400);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue