자동매매 프로그램
실시간 주식 정보
현재 가격: 0 원
거래량: 0
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>자동매매 프로그램</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
h1 {
text-align: center;
}
#stockInfo {
margin-top: 20px;
}
.button {
padding: 10px 15px;
margin: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.buy {
background-color: #4CAF50;
color: white;
}
.sell {
background-color: #f44336;
color: white;
}
</style>
</head>
<body>
<h1>자동매매 프로그램</h1>
<div>
<label for="stockSymbol">주식 종목 입력:</label>
<input type="text" id="stockSymbol" placeholder="예: AAPL">
<button class="button" onclick="getStockInfo()">정보 조회</button>
</div>
<div id="stockInfo">
<h2>실시간 주식 정보</h2>
<p id="currentPrice">현재 가격: <span id="price">0</span> 원</p>
<p id="stockVolume">거래량: <span id="volume">0</span></p>
</div>
<button class="button buy" onclick="buyStock()">매수</button>
<button class="button sell" onclick="sellStock()">매도</button>
<script>
// 여기에 한국증권 API 호출 및 자동매매 로직을 추가하세요.
let currentSymbol = '';
function getStockInfo() {
const symbol = document.getElementById('stockSymbol').value;
currentSymbol = symbol; // 현재 종목 저장
// API를 통해 현재 주식 정보를 가져오는 코드
// 예시: fetch(`API_URL?symbol=${symbol}`)
// .then(response => response.json())
// .then(data => {
// document.getElementById('price').innerText = data.price;
// document.getElementById('volume').innerText = data.volume;
// });
alert(`${symbol}의 정보를 조회합니다.`); // 실제 API 호출 부분 대체
}
function buyStock() {
if (!currentSymbol) {
alert('주식 종목을 먼저 입력하세요.');
return;
}
// 매수 로직을 여기에 추가하세요.
alert(`${currentSymbol} 매수 주문이 실행되었습니다.`);
}
function sellStock() {
if (!currentSymbol) {
alert('주식 종목을 먼저 입력하세요.');
return;
}
// 매도 로직을 여기에 추가하세요.
alert(`${currentSymbol} 매도 주문이 실행되었습니다.`);
}
// 주식 정보를 주기적으로 업데이트
// setInterval(updateStockInfo, 5000); // 5초마다 업데이트
</script>
</body>
</html>
매매프로그램정보 html 형식으로 복사 해서 사용하시면 되여
'정보' 카테고리의 다른 글
연말정산계산기 (1) | 2025.01.16 |
---|---|
연말정산계산기 (1) | 2025.01.15 |
연말정산 간소화 프로그램을 HTML 형식으로 만들어 드리겠습니다. 아래는 기본적인 구조와 주요 요소를 포함한 HTML 코드입니다: (0) | 2025.01.14 |
단타종목검색기를html형식 (0) | 2025.01.14 |
건설안전기사자격요건 (1) | 2025.01.13 |