
এই পাইন স্ক্রিপ্ট কৌশলটি তুলনামূলকভাবে দুর্বল সূচক আরএসআই এবং দামের ওঠানামা মানক ব্যবধান ডিইভি ভিত্তিক, দামের তুলনা করে প্রবেশের পয়েন্ট নির্ধারণের জন্য, আরএসআইকে সহায়ক ফিল্টারিং সূচক হিসাবে ব্যবহার করে, যখন দামটি ওঠানামা করে এবং আরএসআই ওভারব্লড ওভারসোল অঞ্চলে পৌঁছে যায় তখন একটি খোলার সংকেত তৈরি করে, যখন দামটি বিপরীতভাবে বেরিয়ে যায় ট্র্যাক্টর বা আরএসআই বিপরীতভাবে ওভারব্লড ওভারসোল অঞ্চলে পৌঁছে যায়। এই কৌশলটি বাজারের ওঠানামার গতিশীলতা অনুসারে সামঞ্জস্য করতে সক্ষম, যখন ওঠানামা বেশি থাকে এবং ক্ষতি হয়, এবং যখন ওঠানামা কম থাকে তখন পজিশন লাভ হয়। এটি একটি পরিমাণগত ট্রেডিং কৌশল যা বিভিন্ন বাজারের অবস্থার সাথে খাপ খাইয়ে নিতে পারে।
এই কৌশলটি উর্ধ্বমুখী চ্যানেল এবং অপেক্ষাকৃত শক্তিশালী সূচকগুলির সাথে মিলিত হয়, যা মূল্যের ওঠানামা করার সময় আরএসআই সূচককে রেফারেন্স করে খোলার অবস্থান নির্ধারণ করে, যা পর্যায়ক্রমিক প্রবণতা, সময়মতো স্টপ লস এবং লাভের সমাপ্তিকে আরও ভালভাবে ধরে রাখতে পারে। তবে কৌশলটির পারফরম্যান্স প্যারামিটার সেটিংয়ের প্রতি সংবেদনশীল, বিভিন্ন বাজার পরিবেশ এবং মানের সম্পদের জন্য অনুকূলিতকরণ প্রয়োজন, পাশাপাশি অন্যান্য সূচকগুলিকে বাজারের প্রবণতা সম্পর্কে সহায়ক বিচার করার জন্য বিবেচনা করা উচিত, যাতে এই কৌশলটির সম্পূর্ণ সুবিধা গ্রহণ করা যায়। সামগ্রিকভাবে, কৌশলটি পরিষ্কার, যুক্তিসঙ্গতভাবে কঠোর এবং একটি দুর্দান্ত ট্রেডিং কৌশল।
/*backtest
start: 2024-05-20 00:00:00
end: 2024-05-27 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tmalvao
//@version=5
strategy("Estratégia de Desvio Padrão com RSI", overlay=true, margin_long=100, margin_short=100)
// Parâmetros
length = input.int(20, title="Período do Desvio Padrão")
thresholdEntry = input.float(1.5, title="Limite de Entrada")
thresholdExit = input.float(0.5, title="Limite de Saída")
rsiLength = input.int(14, title="Período do RSI")
rsiOverbought = input.int(70, title="RSI Overbought")
rsiOversold = input.int(30, title="RSI Oversold")
// Cálculo do Desvio Padrão
price = close
stdDev = ta.stdev(price, length)
// Média Móvel Simples
sma = ta.sma(price, length)
// Limites baseados no Desvio Padrão
upperLimit = sma + thresholdEntry * stdDev
lowerLimit = sma - thresholdEntry * stdDev
exitUpperLimit = sma + thresholdExit * stdDev
exitLowerLimit = sma - thresholdExit * stdDev
// Cálculo do RSI
rsi = ta.rsi(price, rsiLength)
// Condições de Entrada com RSI
longCondition = ta.crossover(price, lowerLimit) and rsi < rsiOversold
shortCondition = ta.crossunder(price, upperLimit) and rsi > rsiOverbought
// Condições de Saída com RSI
exitLongCondition = ta.crossunder(price, exitLowerLimit) or rsi > rsiOverbought
exitShortCondition = ta.crossover(price, exitUpperLimit) or rsi < rsiOversold
// Plotar Linhas
plot(upperLimit, color=color.red, title="Limite Superior")
plot(lowerLimit, color=color.green, title="Limite Inferior")
plot(exitUpperLimit, color=color.orange, title="Limite de Saída Superior")
plot(exitLowerLimit, color=color.blue, title="Limite de Saída Inferior")
plot(sma, color=color.gray, title="SMA")
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
plot(rsi, title="RSI", color=color.purple)
// Estratégia de Trade
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
if (exitLongCondition)
strategy.close("Long")
if (exitShortCondition)
strategy.close("Short")