This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#property indicator_chart_window // 지표표현 방식 : indicator_separate_window = 캔들챠트에 표현, indicator_chart_window = 별도창. | |
#property indicator_buffers 1 // 지표 버퍼수 | |
//#property indicator_plots 1// 설정하지 않는 경우 상기 indicator_buffers 와 동일 수량 자동 할당됨. | |
#property indicator_color1 Yellow | |
// 지표 버퍼 | |
double indi_buf_1[]; | |
int OnInit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////// 파일들. 주로 클래스 정의들. | |
#include "../CySDK_MQL5/CCy_SIG_TrendFilter_1.mqh" | |
////////// 사용자 입력. | |
input ulong ui_magic_number = 9601;//Magic Number | |
/// 입력값들 수정전값 받아두는것. | |
ulong ui_magic_number_prev = ui_magic_number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CCy_AP909_TA_DB_Sqlite_1.mqh | |
2024.10.26 | |
CyEA909 에서 활용되는 SQLite DB CyEA909.sqlite 핸들링. | |
- 종목별로 다른 정보(예 : 커미션)이면서 mql5 에서 함수 제공안되는 것들 처리위함. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
함수 설명: Get_Loss_Spread_USD(double volume_lot) | |
목적: 거래 종목의 스프레드로 인해 발생하는 USD 손실을 계산. 반환값은 항상 음수. | |
매개변수: volume_lot - 거래량을 랏 단위로 받음. | |
포인트 단위 스프레드: | |
SymbolInfoInteger 함수로 종목의 스프레드를 포인트 단위로 가져옴. | |
1랏 기준 USD 금액: | |
SymbolInfoDouble 함수로 가격 1 Tick의 USD 값을 가져옴. 상대 통화의 USD 환율에 따라 변경됨. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybit.unified_trading import WebSocket | |
from time import sleep | |
# multi symbol | |
symbols_to_get_tick = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "SUIUSDT", "XRPUSDT"] | |
category = "linear" | |
# 모든 심볼의 최신 틱 데이터를 저장할 dictionary. key=symbol name | |
symbol_tick_last = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybit.unified_trading import WebSocket | |
from time import sleep | |
import queue | |
import threading | |
# multi symbol | |
symbols_to_get_tick = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "SUIUSDT", "XRPUSDT"] | |
category = "linear" | |
# 모든 심볼의 최신 틱 데이터를 저장할 dictionary. key=symbol name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybit.unified_trading import WebSocket | |
from time import sleep | |
# 메시지 핸들러 함수 정의 | |
def handle_message(message): | |
print(message) | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybit.unified_trading import WebSocket | |
from time import sleep | |
# Tick 데이터 형식 정의 | |
tick_dict = { | |
'timestamp_ms': int, # 밀리초 단위의 타임스탬프 | |
'symbol': str, # 거래 심볼 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tick 데이터 형식 정의 | |
tick_dict = { | |
'timestamp_ms': int, # 밀리초 단위의 타임스탬프 | |
'symbol': str, # 거래 심볼 | |
'side': str, # 매수/매도 측 (예: "Buy", "Sell") | |
'volume_base': str, # 기본 통화의 거래량 (문자열로 처리) | |
'volume_quote': str, # 기준 통화의 거래량 (문자열로 처리) | |
'block_trade': str # 블록 거래 여부 (문자열로 처리) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 메시지 핸들러 함수 정의 | |
def handle_message(message): | |
if 'data' in message: | |
data = message['data'] | |
for tick_data in data: | |
print("Received Tick Data:", tick_data) | |
else: | |
print("Received Message without 'data' field:", message) |
NewerOlder