This commit is contained in:
2026-06-28 17:07:19 +00:00
commit 0506cee2bc
5 changed files with 90 additions and 0 deletions

29
index.js Normal file
View File

@ -0,0 +1,29 @@
/**
* Free Trading Calculators
* Web versions: https://blog.quant-view.xyz/tools/
* Telegram: https://t.me/GFIL_Trading
* Discord: https://discord.gg/GMmMCD4MCr
*/
function positionSize(accountBalance, riskPercent, stopLossPips, pipValue = 10) {
const riskAmount = accountBalance * (riskPercent / 100);
return parseFloat((riskAmount / (stopLossPips * pipValue)).toFixed(2));
}
function pipValue(currencyPair, lotSize = 1) {
const rates = { "EURUSD": 10, "GBPUSD": 10, "USDJPY": 9.3, "XAUUSD": 10 };
return rates[currencyPair] * lotSize || 10;
}
function fibonacci(high, low) {
const diff = high - low;
return {
"0.236": high - diff * 0.236,
"0.382": high - diff * 0.382,
"0.500": high - diff * 0.500,
"0.618": high - diff * 0.618,
"0.786": high - diff * 0.786,
};
}
module.exports = { positionSize, pipValue, fibonacci };