স্ট্র্যাট কিনুন/বিক্রয় করুন

লেখক:চাওঝাং, তারিখ: ২০২২-০৫-০৯ ১১ঃ১০ঃ১০
ট্যাগঃইএমএ

এই কৌশলটি ক্রয় বা বিক্রয় সংকেত তৈরি করবে যখন নিম্নলিখিত মানদণ্ড পূরণ করা হবেঃ

9 EMA 21 EMA অতিক্রম করে সম্প্রতি বন্ধ মোমবাতি আগের 5 মোমবাতি তুলনায় 15% বেশি গড় ভলিউম আছে একটি মোমবাতি বিপরীত প্যাটার্ন দাম 9 EMA অতিক্রম করে

আপনি যেভাবে চান ব্যবহার করতে পারেন এবং পরিবর্তন করতে পারেন। শুভ লেনদেন!

ব্যাকটেস্ট

img


/*backtest
start: 2022-01-01 00:00:00
end: 2022-05-07 23:59:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
//Author: Andrew Shubitowski
strategy("Buy/Sell Strat", overlay = true)

//Define EMAs & Crossovers (Feature 2)
a = ta.ema(close, 9)
b = ta.ema(close, 21)
crossUp = ta.crossover(a, b)
crossDown = ta.crossunder(a, b)


//Define & calc volume averages (Feature 1)
float volAvg = 0
for i = 1 to 5
    volAvg := volAvg + volume[i]
volAvg := volAvg / 5

//Define candlestick pattern recongition (Feature 4)
bool reversalPatternUp = false
bool reversalPatternDown = false
if (close > close[1] and close[1] > close [2] and close[3] > close[2] and close > close[3])
    reversalPatternUp := true
    
if (close < close[1] and close[1] < close [2] and close[3] < close[2] and close < close[3])
    reversalPatternDown := true

//Execute trade (Feature 3 + 5)
if (crossUp)
    strategy.entry("long", strategy.long, when = ((volume * 0.85) > volAvg and close > a and reversalPatternUp == true))
    
if (crossDown)
    strategy.entry("short", strategy.short, when = ((volume * 0.85) > volAvg and close < a and reversalPatternDown == true))
    
//Exit strategy (New Feature)
//close_condition_long = close < a
//close_condition_short = close > a
//if (close_condition_long)
//    strategy.close("long")
//
//if (close_condition_short)
//    strategy.close("short")

//plot the EMAs
plot(a, title = "Fast EMA", color = color.green)
plot(b, title = "Slow EMA", color = color.blue)


//Some visual validation parameters
//plotchar(volAvg, "Volume", "", location.top, color.aqua) //*TEST* volume calc check
//plotshape(reversalPatternUp, style = shape.arrowup, color = color.aqua) //*TEST* reversal check
//plotshape(reversalPatternDown, style = shape.arrowup, location = location.belowbar, color = color.red) //*TEST* reversal check

সম্পর্কিত

আরো