مقداری تجارتی موم بتی کے نمونے اور رجحان کی پیروی کی حکمت عملی


تخلیق کی تاریخ: 2024-01-31 17:24:30 آخر میں ترمیم کریں: 2024-01-31 17:24:30
کاپی: 3 کلکس کی تعداد: 681
1
پر توجہ دیں
1617
پیروکار

مقداری تجارتی موم بتی کے نمونے اور رجحان کی پیروی کی حکمت عملی

جائزہ

اس حکمت عملی کا نام ہے حجم ٹریڈنگ کیلنڈر اور رجحان ٹریکنگ حکمت عملی کیلنڈر۔ یہ حکمت عملی کیلنڈر تجزیہ اور رجحان ٹریکنگ ٹریڈنگ کی حکمت عملی کے خیالات کو جوڑتی ہے۔

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

حکمت عملی کا اصول

اس حکمت عملی کو مندرجہ ذیل ماڈیولز میں تقسیم کیا گیا ہے:

  1. شکل کا فیصلہ

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

  1. رجحانات کا تعین

حکمت عملی اعلی ترین اور کم ترین قیمتوں کی ٹریکنگ کا استعمال کرتے ہوئے رجحانات کا تعین کرتی ہے ، جب قیمت N دن کی اعلی ترین قیمت سے زیادہ ہوتی ہے تو اس کا تعین بڑھتی ہوئی رجحان کے طور پر کیا جاتا ہے ، اور جب قیمت N دن کی کم ترین قیمت سے نیچے آجاتی ہے تو اس کا تعین ہوا ہوا رجحان کے طور پر کیا جاتا ہے۔

  1. داخلے اور باہر نکلنے

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

مثال کے طور پر ، جب ایک کثیر سرہل شکل کی شناخت کی جاتی ہے جیسے کہ نٹ لائن ، اور قیمت N دن کی اونچائی سے زیادہ ہوتی ہے تو ، زیادہ کام کریں؛ جب قیمت N دن کی نچلی قیمت سے نیچے آجاتی ہے تو ، زیادہ سے زیادہ کو ختم کردیں۔

  1. رینج سیٹ کریں

حکمت عملی آخر میں پیمائش کے آغاز اور اختتام کے وقت کو ترتیب دے کر پوری حکمت عملی کی منطق کا بندوبست کرتی ہے۔

طاقت کا تجزیہ

اس حکمت عملی کے درج ذیل فوائد ہیں:

  1. شکلیں اور رجحانات کا مجموعہ

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

  1. شناخت کی مختلف شکلیں

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

  1. اعلی پیرامیٹر ایڈجسٹ ایبلٹی

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

  1. آسانی سے توسیع

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

خطرے کا تجزیہ

اس حکمت عملی میں مندرجہ ذیل خطرات بھی ہیں:

  1. شکل کی شناخت کی درستگی 100 فیصد تک نہیں

اس کے علاوہ، یہ بھی ممکن ہے کہ ٹریڈنگ سگنل کو غلطی سے متحرک کیا جائے.

  1. سٹاپ نقصان ماڈیول کی کمی

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

  1. اعداد و شمار کے مماثلت کے خطرات کا پتہ لگانا

موجودہ حکمت عملی کا اثر شاید ریٹرننگ بینڈ کے اعداد و شمار کے لئے کچھ فٹ بیٹھتا ہے ، اور ریئل ڈیسک میں کارکردگی میں کمی واقع ہوسکتی ہے۔

اصلاح کی سمت

اس حکمت عملی کے اہم اصلاحات درج ذیل ہیں:

  1. سٹاپ نقصان ماڈیول شامل کریں

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

  1. مشین لرننگ کے ذریعہ شکل کی درستگی میں اضافہ

مشین لرننگ الگورتھم ٹریننگ ماڈل کا استعمال کرتے ہوئے ، فلو کی شکل کا تعین کرنے کی درستگی کو بہتر بنانا ، اور غلط سگنل کی شرح کو کم کرنا۔

  1. ملٹی مارکیٹ کی توثیق

مزید مارکیٹوں جیسے فاریکس اور ڈیجیٹل کرنسی مارکیٹوں میں حکمت عملی کی جانچ پڑتال کی جائے گی ، تاکہ ریٹرنسنگ کے اعداد و شمار کی مماثلت کو روکا جاسکے۔

  1. مزید عوامل کا مجموعہ

مزید مقدار کے عوامل ، جیسے پیمائش کی قیمتوں کے اشارے ، دارالحکومت کے بہاؤ کے اشارے وغیرہ کو متعارف کرایا جاسکتا ہے ، جو حکمت عملی کی منطق کو تقویت بخشتا ہے اور استحکام کو بہتر بناتا ہے۔

خلاصہ کریں۔

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

حکمت عملی کا ماخذ کوڈ
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("Candle analysis & long/short strategy (HF) inspired by TurtleBC", shorttitle="TurtleBC-V.Troussel", overlay=true,initial_capital=1000)

//VARIABLES
body=close-open
range=high-low
middle=(open+close)/2
abody=abs(body)
ratio=abody/range
longcandle= (ratio>0.6)
bodytop=max(open, close)
bodybottom=min(open, close)
shadowtop=high-bodytop
shadowbottom=bodybottom-low

//Doji
DojiSize = input(0.05, minval=0.01, title="Doji size")
data=(abs(open - close) <= (high - low) * DojiSize)
plotchar(data, title="Doji", text='Doji', color=black)

//BULLISH SIGNALS
//Homing Pigeon
HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
plotshape(HomingPigeon, title= "Homing Pigeon", location=location.belowbar, color=lime, style=shape.arrowup, text="Homing\nPigeon")

//Dragonfly Doji Bottom
DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
plotshape(DragonflyDojiBottom, title= "Dragonfly Doji Bottom", location=location.belowbar, color=lime, style=shape.arrowup, text="Dragonfly\nDoji\nBottom")

//Concealing Baby Swallow
ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
plotshape(ConcealingBabySwallow, title= "Concealing Baby Swallow", location=location.belowbar, color=lime, style=shape.arrowup, text="Concealing\nBaby\nSwallow")

//Gravestone Doji Bottom
GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
plotshape(GravestoneDojiBottom, title= "Gravestone Doji Bottom", location=location.belowbar, color=lime, style=shape.arrowup, text="Gravestone\nDoji\nBottom")

//Last Engulfing Bottom
LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
plotshape(LastEngulfingBottom, title= "Last Engulfing Bottom", location=location.belowbar, color=lime, style=shape.arrowup, text="Last\nEngulfing\nBottom")

//Bullish Harami Cross
BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
plotshape(BullishHaramiCross, title= "Bullish Harami Cross", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nHarami\nCross")

//Three Stars in the South
ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2]  and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
plotshape(ThreeStarsInTheSouth, title= "Three Stars In TheSouth", location=location.belowbar, color=lime, style=shape.arrowup, text="Three\nStars\nIn\nThe\nSouth")

//Bullish Breakaway
BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
plotshape(BullishBreakaway, title= "Bullish Breakaway", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nBreakaway")

//Hammer
Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
plotshape(Hammer, title= "Hammer", location=location.belowbar, color=lime, style=shape.arrowup, text="Hammer")

//Inverted Hammer
InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
plotshape(InvertedHammer, title= "Inverted Hammer", location=location.belowbar, color=lime, style=shape.arrowup, text="Inverted\nHammer")

//Rising Three Methods
RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
plotshape(RisingThreeMethods, title= "Rising Three Methods", location=location.belowbar, color=lime, style=shape.arrowup, text="Rising\nThree\nMethods")

//BullishThreeLineStrike
BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
plotshape(BullishThreeLineStrike, title= "Bullish Three Line Strike", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nThreeLine\nStrike")

//Bullish Mat Hold
BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and  close>high[3] and close>high[2] and close>high[1])
plotshape(BullishMatHold, title= "Bullish Mat Hold", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nMat\nHold")

//Doji Star Bottom
DojiStarBottom=(body[1]<0 and longcandle[1] and low<low[1] and open<close[1] and ratio<0.3 and range<0.3*range[1])
plotshape(DojiStarBottom, title= "Doji Star Bottom", location=location.belowbar, color=lime, style=shape.arrowup, text="Doji\nStar\nBottom")

//Morning Star
MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
plotshape(MorningStar,  title= "Morning Star", location=location.belowbar, color=lime, style=shape.arrowup, text="Morning\nStar")

//Abandoned Baby Bottom
AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
plotshape(AbandonedBabyBottom,  title= "Abandoned Baby Bottom", location=location.belowbar, color=lime, style=shape.arrowup, text="Abandoned\nBaby\nBottom")

//Bullish Harami
BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
plotshape(BullishHarami,  title= "Bullish Harami", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nHarami")

//Three Inside Up
ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
plotshape(ThreeInsideUp,  title= "Three Inside Up", location=location.belowbar, color=lime, style=shape.arrowup, text="Three\nInside\nUp")

//Bullish Engulfing
BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
plotshape(BullishEngulfing, title= "Bullish Engulfing", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nEngulfing")

//Piercing Line
PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
plotshape(PiercingLine, title= "Piercing Line", location=location.belowbar, color=lime, style=shape.arrowup, text="Piercing\nLine")

//Three Outside Up
ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
plotshape(ThreeOutsideUp, title= "Three Outside Up", location=location.belowbar, color=lime, style=shape.arrowup, text="Three\nOutside\nUp")

//Three White Soldiers
ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
plotshape(ThreeWhiteSoldiers, title= "Three White Soldiers", location=location.belowbar, color=lime, style=shape.arrowup, text="Three\nWhite\nSoldiers")

//BEARISH SIGNALS

//Evening Star
EveningStar=(body[2]>0 and body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
plotshape(EveningStar, title= "Evening Star", color=red, style=shape.arrowdown, text="Evening\nStar")

//Dark Cloud Cover
DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
plotshape(DarkCloudCover, title= "Dark Cloud Cover", color=red, style=shape.arrowdown, text="Dark\nCloud\nCover")

//Abandoned Baby Top
AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
plotshape(AbandonedBabyTop, title= "Abandoned Baby Top", color=red, style=shape.arrowdown, text="Abandoned\nBaby\nTop")

//Bearish Harami
BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
plotshape(BearishHarami, title= "Bearish Harami", color=red, style=shape.arrowdown, text="Bearish\nHarami")

//Descending Hawk
DescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
plotshape(DescendingHawk, title= "Descending Hawk", color=red, style=shape.arrowdown, text="Descending\nHawk")

//Bearish Engulfing
BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
plotshape(BearishEngulfing, title= "Bearish Engulfing", color=red, style=shape.arrowdown, text="Bearish\nEngulfing")

//Gravestone Doji Top
GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
plotshape(GravestoneDojiTop, title= "Gravestone Doji Top", color=red, style=shape.arrowdown, text="Gravestone\nDoji\nTop")

//Shooting Star
ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
plotshape(ShootingStar, title= "Shooting Star", color=red, style=shape.arrowdown, text="Shooting\nStar")

//Hanging Man
HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
plotshape(HangingMan, title= "Hanging Man", color=red, style=shape.arrowdown, text="Hanging\nMan")

//Bearish Three Line Strike
BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
plotshape(BearishThreeLineStrike, title= "Bearish Three Line Strike", color=red, style=shape.arrowdown, text="Bearish\nThree\nLine\nStrike")

//Falling Three Methods
FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
plotshape(FallingThreeMethods, title= "Falling Three Methods", color=red, style=shape.arrowdown, text="Falling\n\nThreeMethods")

//Three Inside Down
ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and BearishHarami[1] and close<close[1])
plotshape(ThreeInsideDown, title= "Three Inside Down", color=red, style=shape.arrowdown, text="Three\nInside\nDown")

//Three Outside Down
ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and BearishEngulfing[1] and close<close[1])
plotshape(ThreeOutsideDown, title= "Three Outside Down", color=red, style=shape.arrowdown, text="Three\nOutside\nDown")

//Three Black Crows
ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
plotshape(ThreeBlackCrows, title= "Three Black Crows", color=red, style=shape.arrowdown, text="Three\nBlack\nCrows")

//Upside Gap Two Crows
UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
plotshape(UpsideGapTwoCrows, title= "Upside Gap Two Crows", color=red, style=shape.arrowdown, text="Upside\nGap\nTwo\nCrows")

//Last Engulfing Top
LastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
plotshape(LastEngulfingTop, title= "Last Engulfing Top", color=red, style=shape.arrowdown, text="Last\nEngulfing\nTop")

//Dragonfly Doji Top
DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
plotshape(DragonflyDojiTop, title= "Dragonfly Doji Top", color=red, style=shape.arrowdown, text="Dragonfly\nDoji\nTop")

//Bearish Harami Cross
BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
plotshape(BearishHaramiCross, title= "Bearish Harami Cross", color=red, style=shape.arrowdown, text="Bearish\nHarami\nCross")

//Advance Block
AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
plotshape(AdvanceBlock, title= "Advance Block", color=red, style=shape.arrowdown, text="Advance\nBlock")

//Bearish Breakaway
BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
plotshape(BearishBreakaway, title= "Bearish Breakaway", color=red, style=shape.arrowdown, text="Bearish\nBreakaway")

//Two Crows

TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
plotshape(TwoCrows, title= "Two Crows", color=red, style=shape.arrowdown, text="Two\nCrows")






// === BACKTEST RANGE ===
FromMonth = input(defval = 1, title = "From Month", minval = 1)
FromDay   = input(defval = 1, title = "From Day", minval = 1)
FromYear  = input(defval = 2016, title = "From Year", minval = 2016)
ToMonth   = input(defval = 1, title = "To Month", minval = 1)
ToDay     = input(defval = 1, title = "To Day", minval = 1)
ToYear    = input(defval = 9999, title = "To Year", minval = 9999)

enter_fast = input(20, minval=1)
exit_fast = input(10, minval=1)
exit_fast_short=input(10,minval=1)


fastL = highest(close, enter_fast)
fastS = highest(close ,exit_fast_short)
fastLC = lowest(close, exit_fast)


//entrées et sorties pour long et short, le short utilise la sortie du long comme entrée
enterL1 = close > fastL[1]
exitL1 = close <= fastLC[1]
exitS=close>fastS[1]



strategy.entry("Long", strategy.long, when = enterL1 )
strategy.close("Long", when = exitL1)

strategy.entry("Short", strategy.short, when = exitL1)
strategy.close("Short", when = exitS)