
এই কৌশলটির মূল ধারণা হল EMA এবং WMA এর ক্রসকে প্রবেশের সংকেত হিসাবে ব্যবহার করা এবং পয়েন্টের উপর ভিত্তি করে স্টপ লস স্টপিংয়ের সাথে ট্রেড করা। এর সবচেয়ে বড় সুবিধা হল যে এটি খুব নমনীয় এবং সুনির্দিষ্টভাবে ঝুঁকি নিয়ন্ত্রণ করতে পারে, পয়েন্টের আকার পরিবর্তন করে স্টপ লস স্টপের মাত্রা নিয়ন্ত্রণ করতে পারে।
যখন ইএমএ নীচে থেকে WMA অতিক্রম করে তখন একটি মাল্টিসিগন্যাল তৈরি করে; যখন ইএমএ নীচে থেকে WMA অতিক্রম করে তখন একটি ফাঁকা সংকেত তৈরি করে। পজিশনে প্রবেশের পরে, এটি রিয়েল-টাইমে প্রবেশের পয়েন্টটি গণনা করে এবং এর ভিত্তিতে স্টপ লস এবং স্টপ সেট করে। উদাহরণস্বরূপ, স্টপ লস 20 সেট করুন, স্টপ লস 100 সেট করুন, তারপরে নির্দিষ্ট স্টপ লস মূল্যটি প্রবেশের মূল্য 20 পয়েন্ট হ্রাস করে*কন্ট্রাক্ট ভ্যালু, স্টপ-আপ মূল্য হল প্রবেশ মূল্য প্লাস ১০০ পয়েন্ট*কন্ট্রাক্ট ভ্যালু। এইভাবে ঝুঁকি এবং মুনাফা নিয়ন্ত্রণ করা যায়।
একই সময়ে, কৌশলটি বর্তমান বন্ধের সাথে ঐতিহাসিক স্টপ-এর তুলনা করে এবং স্টপ-এর অবস্থান পরিবর্তন করে, যা স্টপ-এর মূল্য অনুসরণ করে।
সাধারণ ফিক্সড পয়েন্ট বা শতাংশের ক্ষতির তুলনায় এই কৌশলটির সবচেয়ে বড় সুবিধা হ’ল ঝুঁকিটি খুব নমনীয় এবং সুনির্দিষ্টভাবে নিয়ন্ত্রণ করা যায়। পয়েন্টের আকারটি সামঞ্জস্য করার ফলে স্টপ লভ্যাংশের আকারটি সরাসরি প্রভাবিত হতে পারে। এটি বিভিন্ন জাতের জন্য খুব কার্যকর এবং বাজারের ওঠানামা এবং ভোল্টেজ অনুসারে সূক্ষ্মভাবে সামঞ্জস্য করা যায়।
এছাড়াও, স্টপ লস একটি খুব ব্যবহারিক বৈশিষ্ট্য। এটি রিয়েল-টাইম পরিবর্তনের উপর ভিত্তি করে স্টপ লস পজিশনগুলিকে ট্র্যাক করতে পারে এবং ঝুঁকি নিয়ন্ত্রণের গ্যারান্টি দেওয়ার সাথে সাথে সর্বাধিক সম্ভাব্য মুনাফা অর্জন করতে পারে।
এই কৌশলটির ঝুঁকি মূলত ইএমএ এবং ডাব্লুএমএ দুটি সূচক থেকে আসে। যখন বাজারে তীব্র পরিবর্তন হয়, তখন তারা প্রায়শই ভুল সংকেত দেয়, সহজেই বন্ধ হয়ে যায়। এই ক্ষেত্রে, উপযুক্তভাবে স্টপ পয়েন্টগুলি শিথিল করার পরামর্শ দেওয়া হয় বা অন্য সূচক সমন্বয়কে প্রতিস্থাপনের বিষয়ে বিবেচনা করা হয়।
আরেকটি ঝুঁকিপূর্ণ বিষয় হল যে, স্টপড্রপগুলি একই সময়ে বজায় রাখা কঠিন। উচ্চতর স্টপড্রপগুলি অনুসরণ করার জন্য, সাধারণত আরও বেশি ঝুঁকি নেওয়া প্রয়োজন, যা ট্রেডিংয়ের সময় সহজেই বন্ধ হয়ে যায়। সুতরাং, স্টপড্রপ সেটিংগুলিকে সাবধানে পরীক্ষা এবং মূল্যায়ন করা দরকার।
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকে অপ্টিমাইজ করা যেতে পারেঃ
এই কৌশলটির মূল ধারণাটি সহজ এবং স্পষ্ট, ইএমএ এবং ডাব্লুএমএ সূচকগুলির উপর ভিত্তি করে, পয়েন্ট-ভিত্তিক স্টপ লস থামার ব্যবস্থা ব্যবহার করে ঝুঁকি নিয়ন্ত্রণের জন্য। কৌশলটির সুবিধা হ’ল ঝুঁকি নিয়ন্ত্রণটি সুনির্দিষ্ট এবং নমনীয়, বিভিন্ন বাজারের সাথে যথাযথভাবে সামঞ্জস্য করা যায়। পরবর্তী সময়ে প্রবেশের সংকেত, প্যারামিটার নির্বাচন, স্টপ লস মেকানিজম ইত্যাদির দিক থেকে গভীরভাবে অপ্টিমাইজ করা যেতে পারে, যাতে কৌশলটি জটিল এবং পরিবর্তনশীল বাজার পরিবেশের সাথে আরও উপযুক্ত হয়।
/*backtest
start: 2024-01-03 00:00:00
end: 2024-01-10 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// inspiration script from: @ahmad_naquib
// inspiration script link: https://www.tradingview.com/script/tGTV8MkY-Two-Take-Profits-and-Two-Stop-Loss/
// inspiration strategy script name: Two Take Profits and Two Stop Loss
////////////
// Do not use this strategy, it's just an exmaple !! The goal from this script is to show you TP and SL based on PIPS
////////////
//@version=5
strategy('SL & TP based on Pips', "PIP SL & TP", overlay=true, initial_capital=1000)
// MA
ema_period = input(title='EMA period', defval=10)
wma_period = input(title='WMA period', defval=20)
ema = ta.ema(close, ema_period)
wma = ta.wma(close, wma_period)
// Entry Conditions
long = ta.crossover(ema, wma) and nz(strategy.position_size) == 0
short = ta.crossunder(ema, wma) and nz(strategy.position_size) == 0
// Pips Calculation
pip1 = input(20, title = "TP PIP", group = "PIP CALCULATION") * 10 * syminfo.mintick
pip2 = input(20, title = "SL PIP", group = "PIP CALCULATION") * 10 * syminfo.mintick
// Trading parameters
var bool LS = na
var bool SS = na
var float EP = na // Entry Position
var float TVL = na
var float TVS = na
var float TSL = na
var float TSS = na
var float TP1 = na
//var float TP2 = na
var float SL1 = na
///var float SL2 = na
// SL & TP Values
// there's also SL2 and TP2 in case you want to add them to your script,
//also you can add a break event in the strategy.entry section.
if short or long and strategy.position_size == 0
EP := close
SL1 := EP - pip2 * (short ? -1 : 1)
//SL2 := EP - pip2 * (short ? -1 : 1)
TP1 := EP + pip1 * (short ? -1 : 1)
//TP2 := EP + pip1 * 2 * (short ? -1 : 1)
// current trade direction
LS := long or strategy.position_size > 0
SS := short or strategy.position_size < 0
// adjust trade parameters and trailing stop calculations
TVL := math.max(TP1, open) - pip1[1]
TVS := math.min(TP1, open) + pip1[1]
TSL := open[1] > TSL[1] ? math.max(TVL, TSL[1]) : TVL
TSS := open[1] < TSS[1] ? math.min(TVS, TSS[1]) : TVS
//if LS and high > TP1
//if open <= TP1
//SL2 := math.min(EP, TSL)
//if SS and low < TP1
//if open >= TP1
//SL2 := math.max(EP, TSS)
// Closing conditions
// and those are a closing conditions in case you want to add them.
//close_long = LS and open < SL2
//close_short = SS and open > SL2
// Buy
if (long and not SS)
strategy.entry('buy', strategy.long)
strategy.exit('exit1', from_entry='buy', stop=SL1, limit=TP1, qty_percent=100)
//strategy.exit('exit2', from_entry='buy', stop=SL2, limit=TP2)
// Sell
if (short and not LS)
strategy.entry('sell', strategy.short)
strategy.exit('exit3', from_entry='sell', stop=SL1, limit=TP1, qty_percent=100)
//strategy.exit('exit4', from_entry='sell', stop=SL2, limit=TP2)
// Plots
// those are plots for the lines of The tp and sl. they are really useful, and in the next update I will use a filling option.
a = plot(strategy.position_size > 0 ? SL1 : na, color=color.new(#af0829, 30), linewidth = 2, style=plot.style_linebr)
b = plot(strategy.position_size < 0 ? SL1 : na, color=color.new(#af0829, 30), linewidth = 2, style=plot.style_linebr)
c = plot(strategy.position_size > 0 ? TP1 : na, color=color.new(#2e7e00, 30), linewidth = 2, style=plot.style_linebr)
d = plot(strategy.position_size < 0 ? TP1 : na, color=color.new(#2e7e00, 30), linewidth = 2, style=plot.style_linebr)
g = plot(strategy.position_size >= 0 ? na : EP, color=color.new(#ffffff, 50), style=plot.style_linebr)
h = plot(strategy.position_size <= 0 ? na : EP, color=color.new(#ffffff, 50), style=plot.style_linebr)
// those are plot for the TP2 and SL2, they are optional if you want to add them.
//e = plot(strategy.position_size > 0 ? TP2 : na, color=color.new(#00ced1, 0), style=plot.style_linebr)
//f = plot(strategy.position_size < 0 ? TP2 : na, color=color.new(#00ced1, 0), style=plot.style_linebr)
//those are the plot for the ema and wma strategy for short and long signal. they are not really a good strategy, I just used them as an example
//but you have the option to plot them or not.
// do not use this strategy, it's just an exmaple !! The goal from this script is to show you TP and SL based on PIPS
//plot(ema, title='ema', color=color.new(#fff176, 0))
//plot(wma, title='wma', color=color.new(#00ced1, 0))