বিটিসি এবং ইটিএইচ দীর্ঘ প্রবণতা কৌশল

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

সারসংক্ষেপ

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

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

  1. ট্রেন্ডের দিকনির্দেশনা নির্ধারণের জন্য MACD ব্যবহার করুন, যখন MACD ক্রসিং আপ হয়;

  2. ২০ পেরিডের EMA, ১০০ পেরিডের SMA এবং ২০০ পেরিডের SMA গণনা করুন, যখন EMA এবং SMA একসাথে উপরে নির্দেশ করে তখন লং যান;

  3. যখন EMA SMA এর চেয়ে বেশি হয় এবং SMA ধীর SMA এর চেয়ে বেশি হয় তখন কিনুন;

  4. স্টপ লস লাইন সেট করুন, স্টপ আউট করুন যখন দাম ভাঙবে স্টপ লস।

  5. যখন দাম কমে যায় এবং EMA SMA এর নিচে চলে যায় তখন পজিশন বন্ধ করুন।

এই কৌশলটি বিভিন্ন সূচককে একত্রিত করে প্রবণতা এবং প্রবেশের সময় নির্ধারণ করে বড় উত্থানের প্রবণতা থেকে লাভবান হয়।

সুবিধা

  1. একাধিক সূচক সংমিশ্রণ মিথ্যা ব্রেকআউট এবং ভুল সংকেত ফিল্টার করতে সাহায্য করতে পারে।

  2. শুধুমাত্র স্পষ্ট প্রবণতা প্রবেশ অপ্রয়োজনীয় ট্রেড এবং কম ট্রেডিং ফ্রিকোয়েন্সি কমাতে পারেন।

  3. স্টপ লস কার্যকরভাবে ট্রেড প্রতি সর্বোচ্চ ক্ষতি সীমাবদ্ধ করতে পারে।

  4. বিটিসি এবং ইটিএইচ-এর ব্যাকটেস্ট ভালো মুনাফা দেখায়।

  5. সহজ এবং পরিষ্কার যুক্তি, সহজেই বোঝা এবং বাস্তবায়ন, নতুনদের জন্য ভাল।

  6. অপ্টিমাইজেশনের জন্য আরও সূচক অন্তর্ভুক্ত করার জন্য উচ্চ সম্প্রসারণযোগ্যতা।

ঝুঁকি

  1. বাজারের উচ্চ এলোমেলোতা, ভুল বিচার ঝুঁকি।

  2. একক পজিশনের পদ্ধতি সিস্টেমিক ঝুঁকিকে সুরক্ষিত করতে পারে না।

  3. ভুল স্টপ লস সেটিং ওভারস্টপ লসের কারণ হতে পারে।

  4. ব্যাকটেস্ট বাস্তব ফলাফলের প্রতিনিধিত্ব করে না, প্রকৃত কর্মক্ষমতা এখনও বৈধ করা হয়নি।

  5. ট্রেডিং খরচ প্রভাব বিবেচনা করা হয় না, লাইভ পারফরম্যান্স থেকে ভিন্ন হতে পারে।

  6. পণ্যের বৈশিষ্ট্য বিবেচনা করা হয়নি, প্যারামিটার টিউনিং প্রয়োজন।

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

  1. সূচক পরামিতি অপ্টিমাইজ করার জন্য বিভিন্ন পরামিতি সমন্বয় পরীক্ষা করুন।

  2. প্রবেশ সংকেত ফিল্টার করার জন্য কেডিজে এর মত ফিল্টার যোগ করুন।

  3. স্টপ লস কৌশল অপ্টিমাইজ করুন, যেমন ডায়নামিক স্টপ লস যোগ করা।

  4. অ্যাকাউন্টের আকারের উপর ভিত্তি করে পজিশনের আকার বিবেচনা করুন।

  5. প্রোডাক্টের বৈশিষ্ট্যগুলো আলাদা করে, সে অনুযায়ী পরামিতিগুলো সামঞ্জস্য করে।

  6. বিশ্লেষণের জন্য আরো সময়সীমা অন্তর্ভুক্ত করুন।

  7. বিভিন্ন পণ্য পরীক্ষা করুন এবং সবচেয়ে উপযুক্তগুলি সন্ধান করুন।

সিদ্ধান্ত

কৌশল যুক্তি সহজ এবং পরিষ্কার। একাধিক সূচক ব্যবহার করে ভুল সংকেতগুলি কার্যকরভাবে ফিল্টার করতে সহায়তা করতে পারে। তবে প্রকৃত প্রয়োগের আগে লাইভ ট্রেডিং যাচাইকরণের সাথে সংযুক্ত পরামিতি, ঝুঁকি নিয়ন্ত্রণ ইত্যাদির উপর আরও অপ্টিমাইজেশান প্রয়োজন। সঠিক এক্সটেনশানগুলির সাথে এটি কৌশল অনুসরণ করে একটি খুব ব্যবহারিক ক্রিপ্টো ট্রেন্ড হয়ে উঠতে পারে।


/*backtest
start: 2023-09-06 00:00:00
end: 2023-10-06 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy(title="BTC Long strategy", overlay=true, max_bars_back=3000, initial_capital=1000, commission_value=0.075)

//////////// !!!!!!!!!!!!!!!! WORK BEST IN 2 HOURS for BTC, ETH and ETHXBT !!!!!!!!!!!!!!!!!!! /////////////////////


[macdLine, macdSignalLine, macdHist] = macd(close, 12, 26, 7)  

//_rsi_len = input(14, title="RSI length")
_rsi_len = 14 
 
NewValue = 0
PreviousValue = 0
leverage = 1

smaPercentageIncrease = 0.0
SMA_PERCENT_INCREASE = 0.0
float atrValue = 0
bool bPositionOpened = false
float stockPositionSize = 0 
float volatilityPercentage = 0.0
bool bDisplayArrow = false 
bool bEMAIsRising = false
bool bSMAIsRising = false
bool bSMASlowIsRising = false
bool bMACDIsRising = false
bool bMACDHistIsRising = false
bool bMACDSignalIsRising = false

float stopLoss = input (1.5, "StopLoss in %", type=input.float) //StopLoss associated with the order 
//positionSize = input (1000, "in $")
float positionSize = 1000
float currentPrice = close 
float stopLossPrice = 0
float entryPrice = 0



//-----------------------------------------------------------



// === INPUT BACKTEST RANGE ONE YEAR 
//FromDay   = input(defval = 01, title = "From Day", minval = 1, maxval = 31)
//FromMonth = input(defval = 01, title = "From Month", minval = 1, maxval = 12)
//FromYear  = input(defval = 2020, title = "From Year", minval = 2017)
FromDay   = 01
FromMonth = 01
FromYear  = 2019


//ToDay     = input(defval = 01, title = "To Day", minval = 1, maxval = 31)
//ToMonth   = input(defval = 01, title = "To Month", minval = 1, maxval = 12)
//ToYear    = input(defval = 2023, title = "To Year", minval = 2017)
ToDay     = 31
ToMonth   = 12
ToYear    = 2099

// === FUNCTION EXAMPLE ===
start     = timestamp(FromYear, FromMonth, FromDay, 00, 00)  // backtest start window
finish    = timestamp(ToYear, ToMonth, ToDay, 23, 59)        // backtest finish window
window()  => true // create function "within window of time"



//emaLength = input(20, "EMA Length")
//smaLength = input(100, "SMA Length")
//smaSlowLength = input(200, "SMA Length") 
emaLength = 20
smaLength = 100
smaSlowLength = 200
 
ema = ema(close, emaLength) 
sma = sma(close, smaLength)
smaSlow = sma(close, smaSlowLength)

plot(sma, color=color.green)
plot(smaSlow, color=color.orange)
plot(ema, color=color.yellow)

//reload previous values
stopLossPrice := na(stopLossPrice[1]) ? 0.0 : stopLossPrice[1]
entryPrice := na(entryPrice[1]) ? 0.0 : entryPrice[1]
bPositionOpened := na(bPositionOpened[1]) ? false : bPositionOpened[1]
positionSize := na(positionSize[1]) ? 50000 : positionSize[1]
stockPositionSize := na(stockPositionSize[1]) ? 0 : stockPositionSize[1]
//leverage := na(leverage[1]) ? 1 : leverage[1]
 
//ReEvaluate the direction of indicators
bEMAIsRising := rising(ema, 2) 
bSMAIsRising := rising(sma, 3)
bMACDIsRising := rising(macdLine, 3)
bMACDHistIsRising := rising(macdHist, 1)
bSMASlowIsRising := rising(smaSlow, 10)
bMACDSignalIsRising := rising(macdSignalLine, 3)

atrValue := atr(14)
volatilityPercentage := (atrValue/currentPrice)*100 //calcute the volatility. Percentage of the actual price


//There is too many signal in tranding market, to avoid this we need to make sure that the smaSlow has a mininal increase
//THIS DOES NOT WORK AT ALL!!!!!
//if bSMASlowIsRising == true
//    //calculate the percentegage difference over the last 10 bars
//    smaPercentageIncrease := ((smaSlow[0]/sma[10])-1)*100
//    if smaPercentageIncrease < SMA_PERCENT_INCREASE
//        //Not enough increase we reset the flag 
//        bSMASlowIsRising := false 
        
 
if (window()) 
    //Check if we can open a LONG
//sma > smaSlow and
    if ( volatilityPercentage < 2 and bPositionOpened == false and bSMASlowIsRising == true and bMACDIsRising == true and bEMAIsRising == true and bSMAIsRising == true and ema[0] > sma[0] and sma[0] < currentPrice)
    // add comparaison between macd and macd signal line
    //if (bPositionOpened == false and macdSignalLine < macdLine and bMACDIsRising == true and bMACDHistIsRising == true and bEMAIsRising == true and bSMAIsRising == true and ema[1] > sma[1] and sma[1] < currentPrice)
   
        //Enter in short position 
        stockPositionSize := (positionSize*leverage)/currentPrice //Calculate the position size based on the actual price and the position Size (in $) configured.
        
        //calculate exit values
        stopLossPrice := currentPrice*(1-stopLoss/100) 
        strategy.entry("myPosition", strategy.long, qty=stockPositionSize, comment="BUY at " + tostring(currentPrice))
        entryPrice := currentPrice //store the entry price
        bPositionOpened := true  
        bDisplayArrow := true 
        
    
    //if (bPositionOpened == true and (currentPrice <= stopLossPrice or crossunder(ema[1], sma[1]) or currentPrice < sma[1]))  
    if (bPositionOpened == true and (currentPrice <= stopLossPrice or crossunder(ema[1], sma[1])))
        strategy.close("myPosition", comment="" + tostring(currentPrice) ) //Stop
        //uncomment the below line to make the bot investing the full portfolio amount to test compounding effect.
        //positionSize := positionSize + ((stockPositionSize * currentPrice) - (positionSize*leverage)) 
        //reset some flags 
        bPositionOpened := false 
        bDisplayArrow := true 
        entryPrice := 0.0
        


আরো