নিম্নমুখী বিপরীতমুখী কৌশল

লেখক:চাওঝাং, তারিখ: ২০২৩-১২-১৫ ১১ঃ০৭ঃ৪১
ট্যাগঃ

img

সারসংক্ষেপ

এই কৌশলটি বিপরীত ট্রেডিংয়ের জন্য বাজারের নীচে ভিত্তি করে। এটি বাজারের নীচে নির্ধারণের জন্য 200 দিনের ইএমএর সর্বনিম্ন পয়েন্টগুলি ক্যামারিলার সমর্থন / প্রতিরোধের স্তরের সাথে মিলিয়ে ব্যবহার করে। দাম ফিরে আসার সময় এটি দীর্ঘ হয়।

কৌশলগত যুক্তি

  1. 200 দিনের EMA এর সর্বনিম্ন মূল্য EMA200Lows গণনা করুন। যখন দাম এই EMA এর নীচে বন্ধ হয়, তখন বাজারটি নীচের দিকে বলে মনে করা হয়।
  2. Camarilla সমর্থন স্তর 3 (S3), ema_s3_9 এর 9 দিনের EMA একটি গুরুত্বপূর্ণ সমর্থন স্তর হিসাবে গণনা করুন।
  3. এছাড়াও বিপরীতমুখী সংকেত হিসেবে Camarilla midpoint ema_center_9 এর 9-দিনের EMA গণনা করুন।
  4. যখন ema_center_9 ema200Lows অতিক্রম করে, এবং শেষ 3 টি বার ema200Lows এর চেয়ে কম হয়, তখন লম্বা হয়ে যায়।
  5. ATR ব্যবহার করুন, সর্বনিম্ন মূল্যের ট্র্যাকিং করে লাভের জন্য স্টপ লস ব্যবহার করুন।
  6. মুনাফা লক্ষ্যমাত্রা হল ema_h4_9 (Camarilla Resistance Level 4) এবং ema_s3_9.

সুবিধা বিশ্লেষণ

  1. ২০০ দিনের EMA-র সর্বনিম্ন মূল্য প্রকৃত নীচের অংশের আগে পজিশন গ্রহণ এড়ায়।
  2. মিডপয়েন্টের সাথে মিলিত ক্যামারিলার মাত্রা নির্ভরযোগ্যভাবে বিপরীততা চিহ্নিত করে।
  3. ATR স্টপ লস আরো যুক্তিসঙ্গত। কম দাম ট্র্যাকিং বৃহত্তর মুনাফা দেয়।

ঝুঁকি বিশ্লেষণ

  1. এই কৌশলটি স্বল্পমেয়াদী ট্রেডিংয়ের পক্ষে।
  2. বড় বাজার চলার ফলে বড় স্টপ লস হতে পারে। এটার প্যারামিটার সংশোধন করুন।
  3. Camarilla বিপরীত সিগন্যাল সবসময় সঠিক হয় না. কিছু whipsaws আশা.

অপ্টিমাইজেশান নির্দেশাবলী

  1. বিপরীতমুখী সংকেত যোগ করার জন্য RSI এর মত সূচক যোগ করার কথা বিবেচনা করুন।
  2. বিভিন্ন পণ্যের জন্য সর্বোত্তম পরামিতি গবেষণা করুন।
  3. গতিশীল এটিআর স্টপ লস এর জন্য মেশিন লার্নিং এক্সপ্লোর করুন।

সংক্ষিপ্তসার

এই কৌশলটি ইএমএ নিম্ন এবং ক্যামারিলা স্তর ব্যবহার করে বাজারের নীচে এবং বিপরীতগুলি সনাক্ত করে। এটি এটিআর ট্রেলিং স্টপগুলির সাথে মুনাফা লক করে। সামগ্রিকভাবে এটি ব্যবহারিক মূল্যের সাথে মোটামুটি সম্পূর্ণ। আরও অপ্টিমাইজেশন স্থিতিশীলতা উন্নত করবে।


/*backtest
start: 2023-12-07 00:00:00
end: 2023-12-14 00:00:00
period: 1m
basePeriod: 1m
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

//Using the lowest of low of ema200, you can find the bottom
//wait for price to close below ema200Lows line
//when pivot

//@version=4
strategy(title="PickingupFromBottom Strategy", overlay=true )  //default_qty_value=10, default_qty_type=strategy.fixed, 

//HMA
HMA(src1, length1) =>  wma(2 * wma(src1, length1/2) - wma(src1, length1), round(sqrt(length1)))


//variables BEGIN
length1=input(200,title="EMA 1 Length")   
length2=input(50,title="EMA 2 Length")   
length3=input(20,title="EMA 3 Length")   

sourceForHighs= input(hlc3, title="Source for Highs", type=input.source)
sourceForLows = input(hlc3, title="Source for Lows" , type=input.source)

hiLoLength=input(7, title="HiLo Band Length")

atrLength=input(14, title="ATR Length")
atrMultiplier=input(3.5, title="ATR Multiplier")

//takePartialProfits = input(true, title="Take Partial Profits (if this selected, RSI 13 higher reading over 80 is considered for partial closing ) ")


ema200=ema(close,length1)
hma200=HMA(close,length1)


////Camarilla pivot points
//study(title="Camarilla Pivots", shorttitle="Camarilla", overlay=true)
t = input(title = "Pivot Resolution", defval="D", options=["D","W","M"])

//Get previous day/week bar and avoiding realtime calculation by taking the previous to current bar
sopen = security(syminfo.tickerid, t, open[1], barmerge.gaps_off, barmerge.lookahead_on)
shigh = security(syminfo.tickerid, t, high[1], barmerge.gaps_off, barmerge.lookahead_on)
slow = security(syminfo.tickerid, t, low[1], barmerge.gaps_off, barmerge.lookahead_on)
sclose = security(syminfo.tickerid, t, close[1], barmerge.gaps_off, barmerge.lookahead_on)
r = shigh-slow

//Calculate pivots
//center=(sclose)
//center=(close[1] + high[1] + low[1])/3
center=sclose - r*(0.618)

h1=sclose + r*(1.1/12)
h2=sclose + r*(1.1/6)
h3=sclose + r*(1.1/4)
h4=sclose + r*(1.1/2)
h5=(shigh/slow)*sclose
l1=sclose - r*(1.1/12)
l2=sclose - r*(1.1/6)
l3=sclose - r*(1.1/4)
l4=sclose - r*(1.1/2)
l5=sclose - (h5-sclose)

//Colors (<ternary conditional operator> expression prevents continuous lines on history)
c5=sopen != sopen[1] ? na : color.red
c4=sopen != sopen[1] ? na : color.purple
c3=sopen != sopen[1] ? na : color.fuchsia
c2=sopen != sopen[1] ? na : color.blue
c1=sopen != sopen[1] ? na : color.gray
cc=sopen != sopen[1] ? na : color.blue

//Plotting
//plot(center, title="Central",color=color.blue, linewidth=2)
//plot(h5, title="H5",color=c5, linewidth=1)
//plot(h4, title="H4",color=c4, linewidth=2)
//plot(h3, title="H3",color=c3, linewidth=1)
//plot(h2, title="H2",color=c2, linewidth=1)
//plot(h1, title="H1",color=c1, linewidth=1)
//plot(l1, title="L1",color=c1, linewidth=1)
//plot(l2, title="L2",color=c2, linewidth=1)
//plot(l3, title="L3",color=c3, linewidth=1)
//plot(l4, title="L4",color=c4, linewidth=2)
//plot(l5, title="L5",color=c5, linewidth=1)////Camarilla pivot points

ema_s3_9=ema(l3, 9)
ema_s3_50=ema(l3, 50)
ema_h4_9=ema(h4, 9)

ema_center_9=ema(center, 9)




plot(ema_h4_9, title="Camariall R4 Resistance EMA 9", color=color.fuchsia)
plot(ema_s3_9, title="Camarilla S3 support EMA 9", color=color.gray, linewidth=1)

//plot(ema_s3_50, title="Camarilla S3 support EMA 50", color=color.green, linewidth=2)

plot(ema_center_9, title="Camarilla Center Point EMA 9", color=color.blue)




plot(hma200, title="HULL 200", color=color.yellow,  transp=25)
plotEma200=plot(ema200, title="EMA 200",  style=plot.style_linebr, linewidth=2 , color=color.orange)

ema200High = ema(highest(sourceForHighs,length1), hiLoLength)
ema200Low= ema(lowest(sourceForLows,length1), hiLoLength)

ema50High = ema(highest(sourceForHighs,length2), hiLoLength)
ema50Low= ema(lowest(sourceForLows,length2), hiLoLength)

ema20High = ema(highest(sourceForHighs,length3), hiLoLength)
ema20Low= ema(lowest(sourceForLows,length3), hiLoLength)

//plot(ema200High, title="EMA 200 Highs", linewidth=2, color=color.orange, transp=30)
plotEma200Low=plot(ema200Low, title="EMA 200 Lows", linewidth=2, color=color.green, transp=30, style=plot.style_linebr)

//plot(ema50High, title="EMA 50 Highs", linewidth=2, color=color.blue, transp=30)
//plotEma50Low=plot(ema50Low, title="EMA 50 Lows", linewidth=2, color=color.blue, transp=30)


fill(plotEma200, plotEma200Low, color=color.green )


// Drawings /////////////////////////////////////////





//Highlight when centerpont crossing up ema200Low a
ema200LowBuyColor=color.new(color.green, transp=50)
bgcolor(crossover(ema_center_9,ema200Low) and (close[1]<ema200Low or close[2]<ema200Low or close[3]<ema200Low)? ema200LowBuyColor : na)
//ema200LowBuyCondition= (close[1]<ema200Low or close[2]<ema200Low or close[3]<ema200Low)
strategy.entry(id="ema200Low Buy", comment="LE2", qty=2, long=true,  when= crossover(ema_center_9,ema200Low) and (close[1]<ema200Low or close[2]<ema200Low or close[3]<ema200Low) )  //or (close>open and low<ema20Low and close>ema20Low) ) )     //  // aroonOsc<0


//Trailing StopLoss
////// Calculate trailing SL
/////////////////////////////////////////////////////
sl_val = atrMultiplier * atr(atrLength)


trailing_sl = 0.0
//trailing_sl :=   max(low[1]  - sl_val, nz(trailing_sl[1])) 
trailing_sl :=   strategy.position_size>=1 ?  max(low  - sl_val, nz(trailing_sl[1])) :  na

//draw initil stop loss
//plot(strategy.position_size>=1 ? trailing_sl : na, color = color.blue , style=plot.style_linebr,  linewidth = 2, title = "stop loss")
plot(trailing_sl, title="ATR Trailing Stop Loss", style=plot.style_linebr, linewidth=1, color=color.red, transp=30)
//Trailing StopLoss
////// Calculate trailing SL
/////////////////////////////////////////////////////



strategy.close(id="ema200Low Buy", comment="TP1="+tostring(close - strategy.position_avg_price, "####.##"), qty=1, when=abs(strategy.position_size)>=1 and crossunder(close, ema_h4_9)  )  //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89
strategy.close(id="ema200Low Buy", comment="TP2="+tostring(close - strategy.position_avg_price, "####.##"),  qty=1, when=abs(strategy.position_size)>=1 and crossunder(close, ema_s3_9)  )  //close<ema55 and rsi5Val<20 //ema34<ema55  //close<ema89



আরো