موم بتی کے نمونوں پر مبنی حکمت عملی

مصنف:چاؤ ژانگ، تاریخ: 2023-09-22 12:28:59
ٹیگز:

جائزہ

یہ حکمت عملی موم بتیوں کے مختلف سگنلز کی نشاندہی کرنے اور رجحان کے ساتھ تجارت کرنے کے لئے موم بتیوں کے نمونوں پر مبنی ہے۔ اسٹاپ نقصان ، منافع لینے ، اور ٹریلنگ اسٹاپ جیسے مناسب رسک مینجمنٹ طریقوں کے ساتھ ، اس کا مقصد مارکیٹ میں اتار چڑھاؤ کے اثرات کو کم کرنا ہے۔

حکمت عملی منطق

حکمت عملی بنیادی طور پر ٹریڈنگ سگنل کے لئے مندرجہ ذیل موم بتی کے نمونوں کی نشاندہی کرتی ہے:

  • نگلنگ: بولش نگلنگ اور بیرش نگلنگ پیٹرن

  • چھیدنے والی لائن/گہرا بادل کا احاطہ: تیزی سے چھیدنے والی لائن اور گہرا بادل کا احاطہ کرنے والے نیچے آنے والے پیٹرن

  • صبح کا ستارہ/شام کا ستارہ: صبح کا ستارہ اور شام کا ستارہ

  • بیلٹ ہولڈ: بلش بیلٹ ہولڈ اور بیرش بیلٹ ہولڈ پیٹرن

  • تین سفید فوجی / تین سیاہ کرو: تین سفید فوجی اور تین سیاہ کرو پیٹرن

  • تین ستارے جنوب میں: تین ستارے جنوب کے نمونہ میں

  • اسٹک سینڈوچ: اسٹک سینڈوچ پیٹرن

  • میٹنگ لائن: بولش میٹنگ لائن اور بیرش میٹنگ لائن پیٹرن

  • کِکنگ: بولش کِکنگ اور بیئرش کِکنگ پیٹرن

  • سیڑھی نیچے: سیڑھی نیچے پیٹرن

جب یہ موم بتی کے سگنل کا پتہ لگاتا ہے تو ، یہ اگلے بار کی کھلی قیمت کے قریب زیر التواء آرڈرز رکھے گا ، جس میں پہلے سے طے شدہ اسٹاپ نقصان اور رجحان کی پیروی کے لئے منافع لیا جائے گا۔ یہ خطرات کو سنبھالنے کے لئے ٹریلنگ اسٹاپ اور بریکنڈ اسٹاپ کا بھی استعمال کرتا ہے۔

اس میں ایک چلتی اوسط فلٹر بھی شامل ہے تاکہ جب قیمت ایم اے کے غلط پہلو پر ہو تو سگنل لینے سے گریز کیا جاسکے۔

فوائد

  1. کلاسیکی شمعدان کے نمونوں پر مبنی، اس میں کچھ عالمگیر اطلاق ہے.

  2. نمونہ کے اصولوں پر مبنی مکینیکل ٹریڈنگ، ذات پات کے عوامل سے متاثر نہیں.

  3. معقول سٹاپ نقصان اور منافع حاصل کرنے کی ترتیبات ایک ہی تجارتی خطرات کو کنٹرول کرنے کے لئے.

  4. ٹریلنگ سٹاپ میکانزم سٹاپ نقصان کو مارکیٹ کے ساتھ متحرک طور پر ایڈجسٹ کرتا ہے۔

  5. ایم اے فلٹر غلط تجارت میں پھنسنے سے بچنے کے لئے مزید منطق کا اضافہ کرتا ہے۔

خطرات اور حل

  1. موم بتی کے نمونوں میں کچھ غلط شناخت کے مسائل ہوتے ہیں ، جس سے غلط سگنل پیدا ہوسکتے ہیں۔ پیرامیٹرز کو بہتر بنا سکتے ہیں یا غلط نمونوں کو فلٹر کرسکتے ہیں۔

  2. جامد اسٹاپ نقصان مارکیٹ کے واقعات سے خطرات سے مکمل طور پر بچ نہیں سکتا ہے۔ وسیع اسٹاپ یا ٹریلنگ اسٹاپ استعمال کرسکتا ہے۔

  3. تجارتی سیشن کے لئے حساس، 24x7 نہیں چل سکتا.

  4. ایم اے فلٹر کچھ مواقع کو کھو سکتا ہے۔ ایم اے مدت کو کم کر سکتا ہے یا فلٹر کو ہٹا سکتا ہے۔

  5. تنازعات کی وجہ سے دونوں طویل اور مختصر اطراف سے فائدہ اٹھانا مشکل ہے۔ طویل اور مختصر حکمت عملیوں کو الگ کرسکتے ہیں۔

اصلاح کی ہدایات

  1. شناخت کو بہتر بنانے کے لئے شمعدان کے نمونوں کے پیرامیٹرز کو بہتر بنائیں.

  2. بہترین تلاش کرنے کے لئے مختلف ٹریلنگ سٹاپ کے طریقوں کا تجربہ کریں.

  3. زیادہ اعلی درجے کی خطرے کے انتظام کی تکنیک جیسے منی مینجمنٹ یا اتار چڑھاؤ سٹاپ نقصان کی کوشش کریں.

  4. فلٹرنگ منطق کو بہتر بنانے کے لئے مزید فلٹرز شامل کریں.

  5. مشین لرننگ کا استعمال کرتے ہوئے موم بتی پیٹرن کی شناخت کے ماڈل بنائیں.

  6. حکمت عملی کی منطق تیار کریں جو طویل اور مختصر دونوں سگنلز کی نشاندہی کرسکے۔

خلاصہ

یہ حکمت عملی رجحان کا پتہ لگانے کے لئے کلاسیکی موم بتی کے نمونوں کا استعمال کرتی ہے اور سگنلز کی بنیاد پر مکینیکل طور پر تجارت کرتی ہے۔ یہ سخت اسٹاپ نقصان اور ٹریلنگ اسٹاپ کے ذریعہ خطرات کا انتظام کرتی ہے ، اور ایم اے فلٹر کو شامل کرکے منطق کو بہتر بناتی ہے۔ حکمت عملی کو سمجھنا اور نافذ کرنا آسان ہے ، لیکن اس میں غلط شناخت اور پیرامیٹر ٹیوننگ میں دشواریوں جیسے کچھ مسائل بھی ہیں۔ بہتر کارکردگی حاصل کرنے کے لئے مزید تکنیکی اشارے اور مشین لرننگ ماڈل متعارف کرانے سے مستقبل کی اصلاحات کی جاسکتی ہیں۔


/*backtest
start: 2022-09-15 00:00:00
end: 2023-02-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
strategy("Candle Patterns Strategy - 2", shorttitle="CPS - 2", overlay=true)
// New risk management system: order entry, moving stop loss to breakeven + moving average filter (SMA)

//--- Patterns Input ---

OnEngulfing = input(defval=true, title="Engulfing", type=bool)
OnHarami = input(defval=true, title="Harami", type=bool)
OnPiercingLine = input(defval=true, title="Piercing Line / Dark Cloud Cover", type=bool)
OnMorningStar = input(defval=true, title="Morning Star / Evening Star ", type=bool)
OnBeltHold = input(defval=true, title="Belt Hold", type=bool)
OnThreeWhiteSoldiers = input(defval=true, title="Three White Soldiers / Three Black Crows", type=bool)
OnThreeStarsInTheSouth = input(defval=true, title="Three Stars in the South", type=bool)
OnStickSandwich = input(defval=true, title="Stick Sandwich", type=bool)
OnMeetingLine = input(defval=true, title="Meeting Line", type=bool)
OnKicking = input(defval=true, title="Kicking", type=bool)
OnLadderBottom = input(defval=true, title="Ladder Bottom", type=bool)

//--- Risk Management Input ---
tick = input (defval = 0.01, title="Tick Size", minval = 0.001)
inpsl = input(defval = 10, title="Stop Loss", minval = 1)
inptp = input(defval = 100, title="Take Profit", minval = 1)
inpbm = input (defval=10, title="Breakeven Margin", minval = 1)
inpindent = input(defval = 5, title="Price Movement Confirmation", minval = 0)
InpSmaFilter = input(defval=false, title="MA Filter", type=bool)
maPer=input(defval = 50, title="MA Period", minval = 1)
//inptrail = input(defval = 0, title="Trailing Stop", minval = 0)
// If the zero value is set for stop loss, take profit or trailing stop, then the function is disabled
//sl = inpsl >= 1 ? inpsl : na
sl = inpsl * tick
bm = inpbm * tick
tp = inptp //* tick
indent = inpindent * tick
//trail = inptrail >= 1 ? inptrail : na

//--- Session Input ---

sess = input(defval = "0000-0000", title="Trading Session")
t = time(timeframe.period, sess)
session_open = na(t) ? false : true

// --- Candlestick Patterns ---

//Engulfing 
bullish_engulfing = high[0]>high[1] and low[0]<low[1] and open[0]<open[1] and close[0]>close[1] and close[0]>open[0] and close[1]<close[2] and close[0]>open[1] ? OnEngulfing : na
bearish_engulfing = high[0]>high[1] and low[0]<low[1] and open[0]>open[1] and close[0]<close[1] and close[0]<open[0] and close[1]>close[2] and close[0]<open[1] ? OnEngulfing : na

//Harami
bullish_harami =  open[1]>close[1] and close[1]<close[2] and open[0]>close[1] and open[0]<open[1] and close[0]>close[1] and close[0]<open[1] and high[0]<high[1] and low[0]>low[1] and close[0]>=open[0] ? OnHarami : na
bearish_harami =   open[1]<close[1] and close[1]>close[2] and open[0]<close[1] and open[0]>open[1] and close[0]<close[1] and close[0]>open[1] and high[0]<high[1] and low[0]>low[1] and close[0]<=open[0] ? OnHarami : na

//Piercing Line/Dark Cloud Cover 
piercing_line = close[2]>close[1] and open[0]<low[1] and close[0]>avg(open[1],close[1]) and close[0]<open[1] ? OnPiercingLine : na
dark_cloud_cover = close[2]<close[1] and open[0]>high[1] and close[0]<avg(open[1],close[1]) and close[0]>open[1] ? OnPiercingLine : na

//Morning Star/Evening Star
morning_star = close[3]>close[2] and close[2]<open[2] and open[1]<close[2] and close[1]<close[2] and open[0]>open[1] and open[0]>close[1] and close[0]>close[2] and open[2]-close[2]>close[0]-open[0] ? OnMorningStar : na
evening_star = close[3]<close[2] and close[2]>open[2] and open[1]>close[2] and close[1]>close[2] and open[0]<open[1] and open[0]<close[1] and close[0]<close[2] and close[2]-open[2]>open[0]-close[0] ? OnMorningStar : na

//Belt Hold
bullish_belt_hold = close[1]<open[1] and low[1]>open[0] and close[1]>open[0] and open[0]==low[0] and close[0]>avg(close[0],open[0]) ? OnBeltHold :na
bearish_belt_hold =  close[1]>open[1] and high[1]<open[0] and close[1]<open[0] and open[0]==high[0] and close[0]<avg(close[0],open[0]) ? OnBeltHold :na

//Three White Soldiers/Three Black Crows 
three_white_soldiers = close[3]<open[3] and open[2]<close[3] and close[2]>avg(close[2],open[2]) and open[1]>open[2] and open[1]<close[2] and close[1]>avg(close[1],open[1]) and open[0]>open[1] and open[0]<close[1] and close[0]>avg(close[0],open[0]) and high[1]>high[2] and high[0]>high[1] ? OnThreeWhiteSoldiers : na
three_black_crows =  close[3]>open[3] and open[2]>close[3] and close[2]<avg(close[2],open[2]) and open[1]<open[2] and open[1]>close[2] and close[1]<avg(close[1],open[1]) and open[0]<open[1] and open[0]>close[1] and close[0]<avg(close[0],open[0]) and low[1]<low[2] and low[0]<low[1] ? OnThreeWhiteSoldiers : na

//Three Stars in the South
three_stars_in_the_south = open[3]>close[3] and open[2]>close[2] and open[2]==high[2] and open[1]>close[1] and open[1]<open[2] and open[1]>close[2] and low[1]>low[2] and open[1]==high[1] and open[0]>close[0] and open[0]<open[1] and open[0]>close[1] and open[0]==high[0] and close[0]==low[0] and close[0]>=low[1] ? OnThreeStarsInTheSouth : na

//Stick Sandwich
stick_sandwich = open[2]>close[2] and open[1]>close[2] and open[1]<close[1] and open[0]>close[1] and open[0]>close[0] and close[0]==close[2] ? OnStickSandwich : na

//Meeting Line 
bullish_ml = open[2]>close[2] and open[1]>close[1] and close[1]==close[0] and open[0]<close[0] and open[1]>=high[0] ? OnMeetingLine : na
bearish_ml = open[2]<close[2] and open[1]<close[1] and close[1]==close[0] and open[0]>close[0] and open[1]<=low[0] ? OnMeetingLine : na

//Kicking 
bullish_kicking =  open[1]>close[1] and open[1]==high[1] and close[1]==low[1] and open[0]>open[1] and open[0]==low[0] and close[0]==high[0] and close[0]-open[0]>open[1]-close[1] ? OnKicking : na
bearish_kicking = open[1]<close[1] and open[1]==low[1] and close[1]==high[1] and open[0]<open[1] and open[0]==high[0] and close[0]==low[0] and open[0]-close[0]>close[1]-open[1] ? OnKicking : na

//Ladder Bottom
ladder_bottom = open[4]>close[4] and open[3]>close[3] and open[3]<open[4] and open[2]>close[2] and open[2]<open[3] and open[1]>close[1] and open[1]<open[2] and open[0]<close[0] and open[0]>open[1] and low[4]>low[3] and low[3]>low[2] and low[2]>low[1] ? OnLadderBottom : na

// --- Plotting Patterns ---

plotshape(bullish_engulfing, text='Engulfing', style=shape.triangleup, color=#1FADA2, editable=true, title="Bullish Engulfing Text")
plotshape(bearish_engulfing,text='Engulfing', style=shape.triangledown, color=#F35A54, editable=true, title="Bearish Engulfing Text")
plotshape(bullish_harami,text='Harami', style=shape.triangleup, color=#1FADA2, editable=true, title="Bullish Harami Text")
plotshape(bearish_harami,text='Harami', style=shape.triangledown, color=#F35A54, editable=true, title="BEarish Harami Text")
plotshape(piercing_line,text='Piercing Line', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(dark_cloud_cover,text='Dark Cloud Cover', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(morning_star,text='Morning Star', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(evening_star,text='Evening Star', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(bullish_belt_hold,text='Belt Hold', style=shape.triangleup, color=#1FADA2, editable=false)    
plotshape(bearish_belt_hold,text='Belt Hold', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(three_white_soldiers,text='Three White Soldiers', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(three_black_crows,text='Three Black Crows', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(three_stars_in_the_south,text='3 Stars South', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(stick_sandwich,text='Stick Sandwich', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(bullish_ml,text='Meeting Line', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(bearish_ml,text='Meeting Line', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(bullish_kicking,text='Kicking', style=shape.triangleup, color=#1FADA2, editable=false)
plotshape(bearish_kicking,text='Kicking', style=shape.triangledown, color=#F35A54, editable=false)
plotshape(ladder_bottom,text='Ladder Bottom', style=shape.triangleup, color=#1FADA2, editable=false)

// --- STRATEGY ---

SignalUp = bullish_engulfing or bullish_harami or piercing_line or morning_star or bullish_belt_hold or three_white_soldiers or three_stars_in_the_south or stick_sandwich or bullish_ml or bullish_kicking or ladder_bottom
SignalDown = bearish_engulfing or bearish_harami or dark_cloud_cover or evening_star or bearish_belt_hold or three_black_crows or bearish_ml or bearish_kicking

PointOfEntry = SignalUp ? high[0] + indent : SignalDown ? low[0] - indent : na

bu = strategy.position_avg_price
shlo = strategy.position_size
stL = shlo > 0 and close [0] > bu + bm ? bu : shlo < 0 and close [0] < bu - bm ? bu : na
du = sma(close, maPer)
smaF = SignalUp and high[0]>du[0] ? true : SignalUp and high[0]<du[0] ? false : SignalDown and high[0]>du[0] ? false : SignalDown and high[0]<du[0] ? true : na 
smaFilter = InpSmaFilter ? smaF : true
duplot = InpSmaFilter ? du : na
plot(duplot, color=red)

// -- Orders --

strategy.order("buy", true, stop = PointOfEntry, oca_name = "trade",  when = SignalUp and session_open and smaFilter)
strategy.cancel("buy", when = not session_open or SignalDown or strategy.opentrades > 0)
strategy.order("stop sell", false, stop = bu-sl, oca_name = "trade",  when = strategy.opentrades > 0 and shlo > 0 and session_open)
strategy.cancel("stop sell", close [0] > bu + bm or not session_open or strategy.opentrades == 0 )
strategy.order("breakeven sell", false, stop = bu + 1*tick, oca_name = "trade",  when = strategy.opentrades > 0 and shlo > 0 and close [0] > bu + bm and session_open)
strategy.cancel("breakeven sell", when = strategy.opentrades == 0 or not session_open)

strategy.order("sell", false, stop = PointOfEntry, oca_name = "trade",  when = SignalDown and session_open and smaFilter)
strategy.cancel("sell", when = not session_open or SignalUp or strategy.opentrades > 0)
strategy.order("stop buy", true, stop = bu+sl, oca_name = "trade",  when = strategy.opentrades > 0 and shlo < 0 and session_open)
strategy.cancel("stop buy", when = close [0] < bu - bm or not session_open or  strategy.opentrades == 0 )
strategy.order("breakeven buy", true, stop = bu - 1 * tick, oca_name = "trade",  when = strategy.opentrades > 0 and shlo < 0 and close [0] < bu - bm and session_open)
strategy.cancel("breakeven buy", when = strategy.opentrades == 0 or not session_open)

strategy.close("buy", when = not session_open or SignalDown )
strategy.close("sell", when = not session_open or SignalUp)
strategy.exit("Take Profit", from_entry = "buy", profit = tp)
strategy.exit("Take Profit", from_entry = "sell", profit = tp)

مزید