impressivePers2252
@t_impressivePers2252
What symbols does the trader recommend buying?
Purchase History
پیام های تریدر
Filter
Signal Type

//version=5strategy("استراتژی ترکیبی RSI + EMA", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)/// محاسبه EMA هاema9 = ta.ema(close, 9)ema21 = ta.ema(close, 21)ema200 = ta.ema(close, 200)/// محاسبه RSIrsi = ta.rsi(close, 14)/// شروط خریدbuySignal = (rsi < 30) and (ema9 > ema21) and (close > ema200)/// شروط فروشsellSignal = (rsi > 70) and (ema9 < ema21) and (close < ema200)/// ورود به معاملهif (buySignal) strategy.entry("Buy", strategy.long)if (sellSignal) strategy.close("Buy")/// نمایش اندیکاتورها روی چارتplot(ema9, color=color.orange, title="EMA 9")plot(ema21, color=color.blue, title="EMA 21")plot(ema200, color=color.red, title="EMA 200")/// سیگنالهای بصری (فلش)plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")

//// Author LonesomeTheBlue////version=3study("Sell / Buy Rates", overlay = false, precision = 0)prd = input(title="Period", defval = 34, minval = 1)tw = high - max(open, close) bw = min(open, close) - low body = abs(close - open) _rate(cond) => 0.5 * (tw + bw + (cond ? 2 * body : 0)) / (tw + bw + body) volup = volume * _rate(open <= close) voldown = volume * _rate(open >= close)rate = linreg(volup - voldown, prd, 0)col = rate > 0 ? (falling(rate, 5) ? green : lime) : rate < 0 ? rising(rate, 5) ? maroon : red : naplot(rate, color = col, style = columns)

import pandas as pdimport matplotlib.pyplot as plt# Load data# For this example, we'll use a CSV file with 'Date' and 'Close' columns.# Adjust the file path as needed.data = pd.read_csv('path/to/your/data.csv')# Convert 'Date' column to datetimedata['Date'] = pd.to_datetime(data['Date'])# Set 'Date' column as the indexdata.set_index('Date', inplace=True)# Define the short-term and long-term moving averagesshort_window = 50long_window = 200# Calculate the short-term and long-term moving averagesdata['Short_MA'] = data['Close'].rolling(window=short_window, min_periods=1).mean()data['Long_MA'] = data['Close'].rolling(window=long_window, min_periods=1).mean()# Create signalsdata['Signal'] = 0data['Signal'][short_window:] = np.where(data['Short_MA'][short_window:] > data['Long_MA'][short_window:], 1, 0)# Generate trading ordersdata['Position'] = data['Signal'].diff()# Plotting the resultsplt.figure(figsize=(14, 7))# Plot the closing price and moving averagesplt.plot(data['Close'], label='Close Price', alpha=0.5)plt.plot(data['Short_MA'], label=f'Short {short_window}-Day MA', alpha=0.75)plt.plot(data['Long_MA'], label=f'Long {long_window}-Day MA', alpha=0.75)# Plot buy signalsplt.plot(data[data['Position'] == 1].index, data['Short_MA'][data['Position'] == 1], '^', markersize=10, color='g', lw=0, label='Buy Signal')# Plot sell signalsplt.plot(data[data['Position'] == -1].index, data['Short_MA'][data['Position'] == -1], 'v', markersize=10, color='r', lw=0, label='Sell Signal')# Add labels and legendplt.title('Moving Average Crossover Strategy')plt.xlabel('Date')plt.ylabel('Price')plt.legend()plt.show()
Disclaimer
Any content and materials included in Sahmeto's website and official communication channels are a compilation of personal opinions and analyses and are not binding. They do not constitute any recommendation for buying, selling, entering or exiting the stock market and cryptocurrency market. Also, all news and analyses included in the website and channels are merely republished information from official and unofficial domestic and foreign sources, and it is obvious that users of the said content are responsible for following up and ensuring the authenticity and accuracy of the materials. Therefore, while disclaiming responsibility, it is declared that the responsibility for any decision-making, action, and potential profit and loss in the capital market and cryptocurrency market lies with the trader.