Scripts: Candle Analysis Report

 

Candle Analysis Report:

This script helps traders understand the distribution and range of candles in a specific period, which can be useful for making trading decisions such as determining which historical values to use for Take Profit or Stop Loss.

Candle Analysis Report

Author: Enrique Enguix

 
import pandas as pd # فرض کنید داده‌های قیمت یک سهم را در یک DataFrame داریم data = pd.DataFrame({'close': [100, 105, 102, 108, 110]}) # یک استراتژی ساده: خرید وقتی قیمت از میانگین متحرک 5 روزه بالاتر رفت data['SMA_5'] = data['close'].rolling(window=5).mean() data['signal'] = np.where(data['close'] > data['SMA_5'], 1, 0) # نمایش سیگنال‌ها print(data)