এই কৌশলটি ইএমএ এবং ক্রমবর্ধমান লেনদেনের সূচককে একত্রিত করে এবং ক্রস-ট্রেন্ডিংয়ের উপর ভিত্তি করে বাজার প্রবণতা নির্ধারণ করে, একটি ক্রয় এবং বিক্রয় সংকেত উত্পন্ন করে। এটি একটি সাধারণ ট্রেন্ডিং কৌশল যা দীর্ঘতর লাইন স্তরের বাজার দিকনির্দেশ অনুসরণ করে।
৫০ দিনের ইএমএ গড় এবং ১০০ দিনের ক্রমবর্ধমান লেনদেনের সূচক গণনা করুন। যখন ইএমএ নীচে থেকে উপরে ক্রমবর্ধমান লেনদেনের পরিমাণ অতিক্রম করে, তখন এটি একটি ক্রয় সংকেত তৈরি করে। যখন ইএমএ উপরে থেকে নীচে ক্রমবর্ধমান লেনদেনের পরিমাণ অতিক্রম করে, তখন এটি একটি বিক্রয় সংকেত তৈরি করে।
পজিশন ধরে রাখার সময়, স্থির স্টপ লস এবং স্টপ এক্সটিং কৌশল সেট করুন। স্টপ লসটি প্রবেশের দামের 8% এর নীচে সেট করা হয়েছে; স্টপ লসটি প্রবেশের দামের 8% উপরে সেট করা হয়েছে এবং যখন দামটি স্টপ লস স্পর্শ করে তখন পজিশনের একটি অংশটি সরিয়ে ফেলা হয়েছে।
এই কৌশলটি প্রবণতা সূচক ইএমএ এবং তহবিল প্রবাহের সূচকগুলিকে একত্রিত করে, দাম এবং লেনদেনের পরিমাণের তথ্যের যথাযথ ব্যবহার করে, যা মধ্য-দীর্ঘ লাইন প্রবণতাকে কার্যকরভাবে সনাক্ত করতে পারে। স্থির স্টপ লস কৌশলটি সরাসরি কার্যকর এবং লাভের কিছু অংশ লক করতে এবং ঝুঁকি নিয়ন্ত্রণে সুবিধাজনক।
EMA চক্রের প্যারামিটারগুলিকে বিভিন্ন জাতের সাথে সামঞ্জস্য করার জন্য অবাধে সামঞ্জস্য করা যায়। একাধিক লঘু করা যায়, লিনিয়ার ট্রেডিং করা যায়। রিটার্নিং ডেটা দেখায় যে প্রবণতার পরিস্থিতিতে কৌশলটি ভাল কাজ করে।
এই কৌশলটি গড়রেখার উপর অত্যধিক নির্ভরশীল, এবং বিন্দুগুলির মধ্যে অস্থিরতার পরিস্থিতিতে ভুল সংকেত তৈরির জন্য প্রবণ। স্থির স্টপ লসও অকাল অবসান বা অত্যধিক ক্ষতির কারণ হতে পারে। কেবলমাত্র দাম এবং লেনদেনের পরিমাণের তথ্য বিবেচনা করে, অন্য কারণগুলি বিবেচনা না করে।
গড়রেখার প্যারামিটারগুলি যথাযথভাবে প্রসারিত করা যেতে পারে, ত্রুটিযুক্ত সংকেত হ্রাস করা যেতে পারে। এছাড়াও, ওলট-পালট হার, আরএসআই ইত্যাদির মতো সূচকগুলি সহায়ক বিচার প্রবর্তন করা যেতে পারে। স্টপ লস প্রক্রিয়াটি অনুকূলিতকরণ করুন, যেমন ট্র্যাকিং স্টপ লস, গতিশীল স্টপ ইত্যাদি।
EMA প্যারামিটারগুলির সমন্বয় পরীক্ষা করে এবং সর্বোত্তম প্যারামিটারগুলি খুঁজে বের করে।
অন্যান্য প্রযুক্তিগত সূচকগুলিকে অন্তর্ভুক্ত করে একটি সূচক সমন্বয় কৌশল তৈরি করা।
মেশিন লার্নিং প্রয়োগ করে দামের প্রবণতা পূর্বাভাস দেওয়া এবং EMA এর কার্যকারিতা বাড়ানো।
স্টপ-অফ-লস কৌশলকে অপ্টিমাইজ করুন, স্টপ-অফ-ট্র্যাকিং, ডায়নামিক স্টপ-অফ ইত্যাদির সাথে।
তহবিল ব্যবস্থাপনা মডিউল চালু করুন, গতিশীলভাবে পজিশন সামঞ্জস্য করুন।
প্রজাতির বৈশিষ্ট্যগুলির জন্য প্যারামিটারগুলি সামঞ্জস্য করুন এবং কৌশলগত পোর্টফোলিও তৈরি করুন।
এই কৌশলটি ইএমএ এবং লেনদেনের পরিমাণের সূচকগুলিকে সংহত করে এবং দীর্ঘমেয়াদী প্রবণতা নির্ধারণের জন্য সুস্পষ্ট। তবে গড় এবং স্থির স্টপ লসগুলির উপর অত্যধিক নির্ভরশীলতাও সমস্যাযুক্ত। আরও সূচক যুক্ত করে এবং স্টপ লস কৌশলটি অপ্টিমাইজ করে কৌশলটির স্থিতিশীলতা এবং লাভের জায়গা বাড়িয়ে তুলতে পারে। সামগ্রিকভাবে, এটি মূল্য এবং লেনদেনের পরিমাণের তথ্য ব্যবহার করে প্রবণতা ট্র্যাকিংয়ের জন্য একটি কৌশল সরবরাহ করে।
/*backtest
start: 2023-08-20 00:00:00
end: 2023-09-19 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mohanee
//@version=4
strategy("EMA_cumulativeVolume_crossover[Strategy]", overlay=true, pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=20, initial_capital=10000)
emaLength= input(50, title="EMA Length", minval=1, maxval=200)
cumulativePeriod = input(100, title="cumulative volume Period", minval=1, maxval=200)
riskCapital = input(title="Risk % of capital", defval=10, minval=1)
stopLoss=input(8,title="Stop Loss",minval=1)
takePartialProfits=input(false, title="take partial profits (percentage same as stop loss)")
tradeDirection=input(title="Trade Direction", defval="LONG", options=["LONG", "SHORT"])
avgPrice = (high + low + close) / 3
avgPriceVolume = avgPrice * volume
cumulPriceVolume = sum(avgPriceVolume, cumulativePeriod)
cumulVolume = sum(volume, cumulativePeriod)
vwapValue = cumulPriceVolume / cumulVolume
emaVal=ema(close, emaLength)
plot(emaVal, title="EMA", color=color.green, transp=25)
plot(vwapValue, title="Cumulate Volumne / VWAP", color=color.orange, linewidth=2, transp=25)
bgcolor(emaVal>vwapValue?color.blue:color.purple)
//Entry--
//Echeck how many units can be purchased based on risk manage ment and stop loss
qty1 = (strategy.equity * riskCapital / 100 ) / (close*stopLoss/100)
//check if cash is sufficient to buy qty1 , if capital not available use the available capital only
qty1:= (qty1 * close >= strategy.equity ) ? (strategy.equity / close) : qty1
strategy.entry(id="LE",comment="LE", long=true, qty=qty1, when=crossover(emaVal, vwapValue) and (tradeDirection=="LONG") ) //emaVal>vwapValue and crossover(close , emaVal)
//stoploss
stopLossVal= strategy.position_size>=1 ? (strategy.position_avg_price * (1-(stopLoss*0.01) )) : 0.00
//draw initil stop loss
plot(strategy.position_size>=1 ? stopLossVal : na, color = color.purple , style=plot.style_linebr, linewidth = 2, title = "stop loss")
//partial exits
takeProfit= strategy.position_size>=1 ? (strategy.position_avg_price * (1+(stopLoss*0.01) )) : ( close[1] * 2 )
if(takePartialProfits==true)
strategy.close(id="LE", comment="Partial"+tostring(close-strategy.position_avg_price, "###.##") , qty=strategy.position_size/3 , when = (tradeDirection=="LONG" ) and close>takeProfit and crossunder(close, emaVal) ) //close<close[1] and close[1]<close[2] and close[2]<close[3])
strategy.close(id="LE" , comment="LE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when=crossunder(emaVal, vwapValue) and (tradeDirection=="LONG") )
strategy.close(id="LE" , comment="SL Exit Loss="+tostring(close-strategy.position_avg_price, "###.##"), when= close < stopLossVal and (tradeDirection=="LONG") )
//for short you dont have to wait crossodown of ema, falling is speed , so just check if close crossing down vwapVal
strategy.entry(id="SE",comment="SE", long=false, qty=qty1, when=(close<vwapValue and close<open and close[1] < vwapValue and close[1]<open[1] and close<close[1]) and emaVal>=vwapValue and (tradeDirection=="SHORT") ) //emaVal>vwapValue and crossover(close , emaVal)
//stoploss
stopLossValUpside= abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ? (strategy.position_avg_price * (1+(stopLoss*0.01) )) : 0.00
//draw initil stop loss
plot(abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ? stopLossValUpside : na, color = color.purple , style=plot.style_linebr, linewidth = 2, title = "stop loss")
//partial exits
shortTakeProfit= abs(strategy.position_size)>=1 and tradeDirection=="SHORT" ? (strategy.position_avg_price * (1-(stopLoss*0.01) )) : 0.00
if(takePartialProfits==true)
strategy.close(id="SE", comment="Partial" , qty=strategy.position_size/3 , when = (tradeDirection=="SHORT" ) and close<shortTakeProfit ) //close<takeProfit and (emaVal - close)>8 )
//strategy.close(id="SE" , comment="SE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when=crossover(emaVal, vwapValue) and (tradeDirection=="SHORT") )
strategy.close(id="SE" , comment="SE Exit Points="+tostring(close-strategy.position_avg_price, "###.##"), when= abs(strategy.position_size)>=1 and ( (emaVal<vwapValue and close>vwapValue and open>vwapValue and close>open ) or (crossover(emaVal,vwapValue)) ) and (tradeDirection=="SHORT") )
strategy.close(id="SE" , comment="SL Exit Loss="+tostring(close-strategy.position_avg_price, "###.##"), when= abs(strategy.position_size)>=1 and close > stopLossValUpside and (tradeDirection=="SHORT" ) )