import MetaTrader5 as mt5
# MetaTrader 5 패키지에 데이터 표시
print("MetaTrader5 패키지 작성자: ",mt5.__author__)
print("MetaTrader5 패키지 버전: ",mt5.__version__)
# MetaTrader 5 터미널 연결 설정
if not mt5.initialize():
print("initialize() 실패, 오류 코드 =",mt5.last_error())
quit()
# 오픈 포지션 존재 유무 확인
positions_total=mt5.positions_total()
if positions_total>0:
print("Total positions=",positions_total)
else:
print("포지션을 찾을 수 없습니다")
# MetaTrader 5 터미널 연결 종료
mt5.shutdown()
|