-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
314 lines (274 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!doctype html>
<html lang="en">
<head>
<title>Risk Management Calculator</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Forex Calculator, FX Calculator, calculate position size, trading calculator, risk management calculator, profit and loss calculator">
<meta name="description" content="A simple tool designed to help traders manage risk by determining potential profit or loss of a trade based on the position size">
<!-- Bootstrap CDN -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/style.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C6HLFECPED"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-C6HLFECPED');
</script>
</head>
<body>
<!-- Navigation -->
<header>
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<span class="navbar-brand mb-0 h1">Risk Management Calculator</span>
<button class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
How to use this calculator
</button>
</div>
</nav>
</header>
<!-- Tool Instructions -->
<div class="container-fluid row">
<div class="collapse" id="collapseExample">
<h4>Position Size</h4>
<p>
First define your position size by filling in the Position Size form to the left.
<ul class="">
<li>Select the currency of your trading account</li>
<li>Input the balance of your trading account.</li>
<li>Select the currency pair you are going to trade.</li>
<li>Input the lot size (volume) you plan to trade with.</li>
</ul>
</p>
<h4>Margin</h4>
<p class="">
<ul>
<li>Select the leverage on your trading account</li>
<p>
This will display a margin value in the selected account currency.
The box lights up <em id="red-text">red</em> if a position cannot be opened or <em id="green-text">green</em> if a position can be opened.
</p>
</ul>
Changing these values will also change the margin value.
</p>
<h4>Profit/Loss</h4>
<p>
The user selects either BUY or SELL to determine trade direction, then inputs the entry level,
take profit and stop loss values which will give the profit and loss amount in the boxes below.
</p>
</div>
</div>
<!-- Calculator Form -->
<form name="RiskManagementCalculator">
<div class="container-fluid row">
<div class="container-fluid col">
<!-- Position Size -->
<div id="Position" class="card split col">
<h3>Position Sizing</h3>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Account Currency</label>
<div class="col-sm-6">
<select id="AccountCurrency" class="form-select" size="1" onchange="calculateMargin()">
<option value="AUD">AUD</option>
<option value="CAD">CAD</option>
<option value="CHF">CHF</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="JPY">JPY</option>
<option value="TZS">TZS</option>
<option value="USD">USD</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Account Balance</label>
<div class="col-sm-6">
<input id="AccountBalance" class="form-control" size="7" type="number" min="0" step="0.01" onchange="calculateMargin()">
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Currency Pair</label>
<div class="col-sm-6">
<select id="CurrencyPair" class="form-select" onchange="calculateMargin()">
<option>AUD/CAD</option>
<option>AUD/CHF</option>
<option>AUD/JPY</option>
<option>AUD/NZD</option>
<option>AUD/USD</option>
<option>CAD/CHF</option>
<option>CAD/JPY</option>
<option>CHF/JPY</option>
<option>EUR/AUD</option>
<option>EUR/CAD</option>
<option>EUR/CHF</option>
<option>EUR/GBP</option>
<option>EUR/JPY</option>
<option>EUR/NZD</option>
<option>EUR/USD</option>
<option>GBP/AUD</option>
<option>GBP/CAD</option>
<option>GBP/CHF</option>
<option>GBP/JPY</option>
<option>GBP/NZD</option>
<option>GBP/USD</option>
<option>NZD/CAD</option>
<option>NZD/CHF</option>
<option>NZD/JPY</option>
<option>NZD/USD</option>
<option>USD/CAD</option>
<option>USD/CHF</option>
<option>USD/JPY</option>
<option>USD/MXN</option>
<option>USD/NOK</option>
<option>USD/ZAR</option>
<option>XAG/USD</option>
<option>XAU/USD</option>
</select>
</div>
</div>
<div class="form-group row" >
<label class="col-sm-6 col-form-label">Lot Size (Volume) </label>
<div class="col-sm-6">
<input id="LotSize" class="form-control" size="6" type="number" min="0.01" step="0.01" onchange="calculateMargin(); ProfitLoss(BuySellButton);">
</div>
</p>
</div>
</div>
</div>
<div class="container-fluid col">
<!-- Margin Calculator -->
<div id="Margin" class="card split col">
<h3>Margin Calculation</h3>
<div class="form-group row">
<label class="col-sm-6 col-form-label"> Leverage </label>
<div class="col-sm-6">
<select id="SelectedLeverage" class="form-select" onchange="calculateMargin()">
<option value="1">1:1</option>
<option value="2">1:2</option>
<option value="3">1:3</option>
<option value="4">1:4</option>
<option value="5">1:5</option>
<option value="10">1:10</option>
<option value="20">1:20</option>
<option value="50">1:50</option>
<option value="100">1:100</option>
<option value="200">1:200</option>
<option value="400">1:400</option>
<option value="500">1:500</option>
<option value="1000">1:1000</option>
<option value="2000">1:2000</option>
<option value="3000">1:3000</option>
</select>
</div>
</div>
<div class="card-body">
<div class="form-group row">
<label class="col-sm-6 col-form-label">Margin </label>
<div class="col-sm-6">
<input id="AccountMargin" class="form-control" type="text" disabled="">
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Pip Value </label>
<div class="col-sm-6">
<input id="PipValue" class="form-control" type="text" disabled="">
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid col">
<!-- Profit/Loss Calculator -->
<div id="Profits" class="card split col">
<h3>Profit Calculation</h3>
<div class="form-group row">
<div class="form-group row">
<label class="col-sm-6 col-form-label">Entry Price </label>
<div class="col-sm-6">
<input id="EntryPrice" class="form-control" type="number" size="6" min="0.00001" step="0.00001" onchange="ProfitLoss()">
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Take Profit</label>
<div class="col-sm-6">
<input id="TakeProfit" name="LimitValue" type="number" class="form-control ExitPrice" size="6" min="0" step="0.00001" onchange="ProfitLoss()">
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Stop Loss</label>
<div class="col-sm-6">
<input id="StopLoss" name="LimitValue" type="number" class="form-control ExitPrice" size="6" min="0" step="0.00001" onchange="ProfitLoss()">
</div>
</div>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-success" for="BuyRadioButton">
<input type="radio" name="BuySellButton" id="BuyRadioButton" class="btn-check" autocomplete="off" onclick="ProfitLoss(BuySellButton.Buy)"/> BUY
</label>
<label class="btn btn-danger" for="SellRadioButton">
<input type="radio" name="BuySellButton" id="SellRadioButton" class="btn-check" autocomplete="off" onclick="ProfitLoss(BuySellButton.Sell)"/> SELL
</label>
</div>
</div>
<div class="form-group row card-body">
<div class="form-group row">
<label class="col-sm-6 col-form-label">Profit</label>
<div class="col-sm-6">
<input id="CalculatedProfit" class="form-control" type="text" size="6" name="result" min="0" step="0.01" disabled value="">
</div>
</div>
<div class="form-group row">
<label class="col-sm-6 col-form-label">Loss</label>
<div class="col-sm-6">
<input id="CalculatedLoss" class="form-control" type="text" size="6" name="result" min="0" step="0.01" disabled value="">
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- Broker Banner -->
<div class="container-fluid row">
<div id="over" style=" width:100%; height:100%" class="container-fluid">
<a href="https://one.exnesslink.com/intl/en/a/uil2h5b5">
<img src="https://d3dpet1g0ty5ed.cloudfront.net/EN_0821_Crypto_DevColor_AtExnessUSPs_728x90px.jpg" width="100%" height="auto" alt="Exness - Broker Banner" />
</a>
</div>
</div>
<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
<!-- Optional JavaScript (Vue.js)-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<!-- Custom JavaScript -->
<script src="js/script.js"></script>
<!-- Dependencies -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="js/accounting.min.js"></script>
<script src="js/money.min.js"></script>
<script type="text/javascript">
// Load exchange rates data via AJAX:
$.getJSON(
// NB: using Open Exchange Rates here, but you can use any source!
'https://openexchangerates.org/api/latest.json?app_id=f86995cf17784ff88a15305cb7f8b6ad',
function(data) {
// Check money.js has finished loading:
if ( typeof fx !== "undefined" && fx.rates ) {
fx.rates = data.rates;
fx.base = data.base;
} else {
// If not, apply to fxSetup global:
var fxSetup = {
rates : data.rates,
base : data.base
}
}
}
);
</script>
</body>
</html>