লেখক:চাওঝাং
ট্যাগঃ

img

সারসংক্ষেপ

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

  1. মোমবাতি মডেল সনাক্ত করুনঃ যখন মোমবাতি শরীরের আকার প্রান্তিকের চেয়ে ছোট হয় এবং খোলা বন্ধের সমান হয়, এটি ট্র্যাকিং সংকেত হিসাবে চিহ্নিত করা হয়।

  2. লং/শর্টঃ যখন বিপরীতমুখী মোমবাতি প্যাটার্ন চিহ্নিত করা হয়, তখন যদি পূর্ববর্তী বন্ধটি 2 দিনের আগে উচ্চতর হয় তবে লং যান, যদি পূর্ববর্তী বন্ধটি 2 দিনের আগে কম হয় তবে শর্ট যান।

সুবিধা

  1. মুনাফা গ্রহণ/ক্ষতি বন্ধের প্রক্রিয়া কার্যকরভাবে ঝুঁকি নিয়ন্ত্রণ করে, মুনাফা বন্ধ করে দেয়, ক্ষতি বাড়ানো এড়ায়।

ঝুঁকি

  1. ভুলভাবে লাভ/হানি বন্ধের পয়েন্ট সেটিং করলে বড় ট্রেন্ড মিস হতে পারে অথবা অকাল হ্রাস বন্ধ হতে পারে।

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

  1. সঠিকতা বাড়াতে আরো সূচক দিয়ে মোমবাতি সনাক্তকরণের শর্তগুলি অনুকূল করুন।

  2. আরো ট্রেডিং সংকেত চিহ্নিত করার জন্য অ্যালগরিদম যোগ করে কৌশল যুক্তি সমৃদ্ধ করুন।

  3. রেফারেন্স সূচকগুলির উপর ভিত্তি করে অবস্থানগুলিকে গতিশীলভাবে সামঞ্জস্য করার জন্য অবস্থান আকারের মডিউল যুক্ত করুন।

সিদ্ধান্ত


/*backtest
start: 2023-12-26 00:00:00
end: 2024-01-25 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 30/01/2019
//   This is a candlestick where the open and close are the same. 
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title = "Doji Backtest", overlay = true)
input_takeprofit = input(10, title="Take Profit pip", step=0.01)
input_stoploss = input(10, title="Stop Loss pip", step=0.01)
input_minsizebody = input(0.5, title="Min. Size Body pip", step=0.01)
barcolor(abs(close - open) <= input_minsizebody ? open == close ? yellow : na : na)
possell = 0.0
posbuy = 0.0
pospricebuy = 0.0
pospricesell = 0.0
barcolornow = blue
pospricesell := close< close[2] ? abs(close - open) <= input_minsizebody ? open == close ? close : nz(pospricesell[1], 0) : nz(pospricesell[1], 0) : nz(pospricesell[1], 0) 
possell := iff(pospricesell > 0 , -1, 0)
barcolornow := possell == -1 ? red: posbuy == 1 ? green : blue 
pospricesell := iff(low <= pospricesell - input_takeprofit and pospricesell > 0, 0 ,  nz(pospricesell, 0))
pospricesell := iff(high >= pospricesell + input_stoploss and pospricesell > 0, 0 ,  nz(pospricesell, 0))
pospricebuy := close > close[2] ? abs(close - open) <= input_minsizebody ? open == close ? close : nz(pospricebuy[1], 0) : nz(pospricebuy[1], 0) : nz(pospricebuy[1], 0) 
posbuy := iff(pospricebuy > 0 , 1, 0)
barcolornow := posbuy == 1 ? green: barcolornow
pospricebuy := iff(high >= pospricebuy + input_takeprofit and pospricebuy > 0, 0 ,  nz(pospricebuy, 0))
pospricebuy := iff(low <= pospricebuy - input_stoploss and pospricebuy > 0, 0 ,  nz(pospricebuy, 0))
barcolor(barcolornow)
if (posbuy == 0 and possell == 0) 
    strategy.close_all()
if (posbuy == 1)
    strategy.entry("Long", strategy.long)
if (possell == -1)
    strategy.entry("Short", strategy.short)	   	    
pospricebuy := iff(high <= pospricebuy + input_takeprofit and pospricebuy > 0, 0 ,  nz(pospricebuy, 0))
pospricebuy := iff(low >= pospricebuy - input_stoploss and pospricebuy > 0, 0 ,  nz(pospricebuy, 0))
pospricesell := iff(low <= pospricesell - input_takeprofit and pospricesell > 0, 0 ,  nz(pospricesell, 0))
pospricesell := iff(high >= pospricesell + input_stoploss and pospricesell > 0, 0 ,  nz(pospricesell, 0))


আরো