File size: 9,644 Bytes
c363c4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TradeFlow Pro - Position Calculator</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    colors: {
                        primary: {
                            500: '#6366f1',
                        },
                        secondary: {
                            500: '#8b5cf6',
                        },
                    }
                }
            }
        }
    </script>
</head>
<body class="bg-gray-900 text-white">
    <!-- Header -->
    <header class="bg-gray-800 bg-opacity-50 backdrop-blur-md border-b border-gray-700 sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <a href="index.html" class="p-2 rounded-lg hover:bg-gray-700">
                    <i data-feather="arrow-left" class="w-5 h-5"></i>
                </a>
                <h1 class="text-xl font-bold">Position Calculator</h1>
            </div>
        </div>
    </header>
    
    <!-- Main Content -->
    <main class="container mx-auto px-4 py-8">
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
            <!-- Calculator Inputs -->
            <div class="bg-gray-800 bg-opacity-50 backdrop-blur-md rounded-xl border border-gray-700 p-6">
                <h2 class="text-xl font-bold mb-6">Position Size Calculator</h2>
                
                <div class="space-y-6">
                    <div>
                        <label class="block text-gray-400 mb-2">Account Balance</label>
                        <div class="relative">
                            <span class="absolute left-3 top-3 text-gray-400">$</span>
                            <input type="text" value="25000" class="w-full bg-gray-700 rounded-lg p-3 pl-8 focus:outline-none focus:ring-2 focus:ring-primary-500">
                        </div>
                    </div>
                    
                    <div>
                        <label class="block text-gray-400 mb-2">Risk Percentage</label>
                        <div class="flex items-center">
                            <input type="range" min="0.1" max="5" step="0.1" value="1" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
                            <span class="ml-4 w-16 bg-gray-700 rounded-lg p-2 text-center">1%</span>
                        </div>
                    </div>
                    
                    <div>
                        <label class="block text-gray-400 mb-2">Stop Loss (pips)</label>
                        <input type="text" value="25" class="w-full bg-gray-700 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-primary-500">
                    </div>
                    
                    <div>
                        <label class="block text-gray-400 mb-2">Instrument</label>
                        <select class="w-full bg-gray-700 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-primary-500">
                            <option>EUR/USD</option>
                            <option>GBP/USD</option>
                            <option>USD/JPY</option>
                            <option>Gold</option>
                            <option>Bitcoin</option>
                        </select>
                    </div>
                    
                    <div>
                        <label class="block text-gray-400 mb-2">Account Currency</label>
                        <select class="w-full bg-gray-700 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-primary-500">
                            <option>USD</option>
                            <option>EUR</option>
                            <option>GBP</option>
                            <option>JPY</option>
                        </select>
                    </div>
                </div>
                
                <div class="mt-8">
                    <button class="w-full bg-gradient-to-r from-primary-500 to-secondary-500 px-6 py-3 rounded-lg font-medium">
                        Calculate Position Size
                    </button>
                </div>
            </div>
            
            <!-- Calculator Results -->
            <div class="bg-gray-800 bg-opacity-50 backdrop-blur-md rounded-xl border border-gray-700 p-6">
                <h2 class="text-xl font-bold mb-6">Calculation Results</h2>
                
                <div class="space-y-6">
                    <div class="bg-gray-750 rounded-lg p-4">
                        <div class="flex justify-between">
                            <span class="text-gray-400">Risk Amount</span>
                            <span class="font-medium">$250.00</span>
                        </div>
                    </div>
                    
                    <div class="bg-gray-750 rounded-lg p-4">
                        <div class="flex justify-between">
                            <span class="text-gray-400">Position Size (lots)</span>
                            <span class="font-medium">0.12</span>
                        </div>
                    </div>
                    
                    <div class="bg-gray-750 rounded-lg p-4">
                        <div class="flex justify-between">
                            <span class="text-gray-400">Contracts/Units</span>
                            <span class="font-medium">12,000</span>
                        </div>
                    </div>
                    
                    <div class="bg-gray-750 rounded-lg p-4">
                        <div class="flex justify-between">
                            <span class="text-gray-400">Risk per Pip</span>
                            <span class="font-medium">$10.00</span>
                        </div>
                    </div>
                    
                    <div class="bg-gray-750 rounded-lg p-4">
                        <div class="flex justify-between">
                            <span class="text-gray-400">Reward/Risk Ratio (2:1)</span>
                            <span class="font-medium">$500.00</span>
                        </div>
                    </div>
                </div>
                
                <div class="mt-8">
                    <h3 class="text-lg font-bold mb-4">Risk Visualization</h3>
                    <div class="h-48 flex items-center justify-center">
                        <div class="text-center">
                            <i data-feather="pie-chart" class="w-16 h-16 text-gray-500 mx-auto mb-4"></i>
                            <p class="text-gray-400">Risk/reward visualization</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Breakeven and Trailing Stop Calculator -->
        <div class="bg-gray-800 bg-opacity-50 backdrop-blur-md rounded-xl border border-gray-700 mt-8 p-6">
            <h2 class="text-xl font-bold mb-6">Breakeven & Trailing Stop Calculator</h2>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <div>
                    <h3 class="text-lg font-bold mb-4">Breakeven Levels</h3>
                    <div class="space-y-4">
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>Basic BE (0 pips)</span>
                            <span class="font-medium">1.0850</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>BE at +20 pips</span>
                            <span class="font-medium">1.0870</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>BE at +40 pips</span>
                            <span class="font-medium">1.0890</span>
                        </div>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">Trailing Stop Options</h3>
                    <div class="space-y-4">
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>Basic TS (1:1)</span>
                            <span class="font-medium">1 pip/pip</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>ATR-Based TS</span>
                            <span class="font-medium">1.5x ATR</span>
                        </div>
                        <div class="flex items-center justify-between p-3 bg-gray-750 rounded-lg">
                            <span>MA-Based TS</span>
                            <span class="font-medium">EMA 20</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    
    <script>
        feather.replace();
    </script>
</body>
</html>