init
This commit is contained in:
@@ -240,7 +240,7 @@ def run_simulation(symbol: str, interval_minutes: int, days: int = 30):
|
||||
if all(data[f'MA{n}'].iloc[i] < data['MA720'].iloc[i] for n in [5, 20, 40, 120, 200, 240]) and \
|
||||
all(data[f'MA{n}'].iloc[i] > data[f'MA{n}'].iloc[i-1] for n in [5, 20, 40, 120, 200, 240]) and \
|
||||
data['MA720'].iloc[i] < data['MA1440'].iloc[i]:
|
||||
data.at[data.index[i], 'buy_signal'] = 'moving average'
|
||||
data.at[data.index[i], 'buy_signal'] = 'movingaverage'
|
||||
data.at[data.index[i], 'buy_point'] = 1
|
||||
|
||||
# Deviation40(이격도 40) 기반 매수 조건: 90 이하에서 상승 전환
|
||||
@@ -255,7 +255,7 @@ def run_simulation(symbol: str, interval_minutes: int, days: int = 30):
|
||||
|
||||
# 매수 포인트를 신호 유형별로 다르게 표시
|
||||
# 이동평균선 기반 매수 포인트 (빨간 동그라미)
|
||||
ma_buy_points = data[(data['buy_point'] == 1) & (data['buy_signal'] == 'moving average')]
|
||||
ma_buy_points = data[(data['buy_point'] == 1) & (data['buy_signal'] == 'movingaverage')]
|
||||
scatter_ma_buy_points = ax1.scatter(ma_buy_points.index, ma_buy_points['Close'], color='red', s=100, zorder=5, label='MA 매수 포인트')
|
||||
|
||||
# Deviation40 기반 매수 포인트 (속이 빈 빨간 점선 원)
|
||||
|
||||
Reference in New Issue
Block a user