CREON Plus

전체

현재 가격 문의

작성일
2021-09-16 오후 9:53:45
조회수
204
파이썬
운영
K**
오류 메시지
아래 예시에서 현재가 Current Price 불러오면 실제 시세와 가격이 다릅니다. 기준이 다른 것 같아서 차이를 알수 있을까요?
그리고, 제가 매입한 금액과 수수료가 반영된 금액을 알수 있을까요? Profit Amount 계산이 어떻게 되는 지 알고 싶습니다.

감사합니다.
for i in range(cpBalance.GetHeaderValue(7)):

stock_code = cpBalance.GetDataValue(12, i) # 종목코드
stock_name = cpBalance.GetDataValue(0, i) # 종목명
current_price = cpBalance.GetDataValue(8, i)
Profit_amount = cpBalance.GetDataValue(10, i)
Profit_percent = cpBalance.GetDataValue(11, i)
sales_price = cpBalance.GetDataValue(12, i)
stock_quantity = cpBalance.GetDataValue(15, i)

# str_ = "" + stock_code + " {:6.1f}".format(current_price) + "{:6.1f}".format(stock_quantity) + "{:6.1f}".format(Profit_percent) + '%' + ' ' + stock_name
str_ = "{:10}".format(current_price) + "{:6.1f}".format(stock_quantity) + " {:10}".format(Profit_amount) + "{:6.1f}".format(Profit_percent) + '% ' + stock_name
첨부파일
의견(0)

첨부파일을 PDF뷰어로 확인 하실수 있으며, PDF뷰어 미설치 고객께서는 우측 다운로드를 통해 설치 후 이용 가능 합니다.

PDF뷰어 다운로드

인쇄