15MIN BTCUSDTPERP BOT

লেখক:চাওঝাং, তারিখ: ২০২২-০৫-২৩ 16:26:54
ট্যাগঃএডিএক্সএসএআরআরএসআইটিডব্লিউএপিজেএমএএমএসিডি

এটা আমার BTCUSDTPERP 15 মিনিট বট সেরা ফলাফল বিএনএন্স ফিউচারে বিটিসি ইউএসডিটিপিআরপি-তে। ফলাফল নির্দিষ্ট ভলিউম সূচক উপর নির্ভর করে যা binancefutures এ সবচেয়ে ভাল কাজ করে

১৫ মিনিটের বট খুবই দ্রুত, ভালো কনফিগারেশন পাওয়া কঠিন, কারণ ১৫ মিনিটের ব্যাকটেস্টিং যা অন্তত ৩-৪ মাস

এই বটটি স্পেসিফিক, খুব উচ্চ শতাংশ লাভজনক ট্রেড করেছে। নেট মুনাফাও খুব ভাল। তবে দীর্ঘমেয়াদে ১৫ মিনিটের বট ব্যবহার করা অত্যন্ত কঠিন, তাই আমি যতটা সম্ভব ডিফ্লাউট সেটিংস করেছি।

তাই, এই বট ১১টি ভিন্ন সূচক ব্যবহার করেঃ

  1. এডিএক্স

  2. পরিসীমা ফিল্টার

  3. এসএআর

  4. আরএসআই

  5. টিডব্লিউএপি

  6. জেএমএ

  7. এমএসিডি

  8. ভলিউম DELTA

  9. ভলিউম ওজন

  10. এমএ এবং শেষেরটা কুইজিক চার্টে ভালো ফলাফলের জন্য (15মিনিট) আমি যোগ করার সিদ্ধান্ত নিয়েছি:

  11. স্টোচ

  12. ADX - - কোন জালিয়াতি উইক ছাড়া প্রবণতা একটি কঠিন ভিউ তোলেঃ শুধুমাত্র সবুজ বার উপর লং, শুধুমাত্র লাল বার উপর শর্টস. যে s একটি সঠিক প্রবণতা সংজ্ঞায়িত করতে আমার কৌশল সাহায্য করে, সেখানে একটি অরেঞ্জ অপশন অজানা প্রবণতা জন্য।

  13. পরিসীমা ফিল্টার - এই সূচকটি প্রবণতা আরও ভালভাবে দেখার জন্য, প্রবণতা নির্ধারণের জন্য, যা প্রতিটি ষাঁড়/ঘোড়ার ফাঁদে গুরুত্বপূর্ণ যা খুব পরিবর্তনশীল প্রবণতার কারণে অনেক সাহায্য করে।

  14. এসএআর - প্যারাবোলিক এসএআর একটি প্রযুক্তিগত সূচক যা কোনও সম্পদের দামের দিক নির্ধারণ করতে ব্যবহৃত হয়, পাশাপাশি যখন দামের দিক পরিবর্তন হয় তখন মনোযোগ আকর্ষণ করে। এসএআর সমর্থনকারী বট, যখন প্রবণতা ধীরে ধীরে পরিবর্তিত হয় তখন নতুন ট্রেড না খোলার জন্য

  15. RSI- মান সঠিক সময়ে ট্রেড বন্ধ করতে কৌশল সাহায্য করে। যখন RSI overbought হয় কৌশল নতুন লং খুলবেন না, এছাড়াও যখন RSI oversold হয় কৌশল নতুন শর্ট খুলবেন না

  16. TWAP - এর একই কাজ রয়েছে Range Filter এর মতো, এটি শুধুমাত্র ট্রেন্ডের আরও ভাল দৃশ্যমানতার জন্য, ট্রেন্ড সংজ্ঞায়িত করার জন্য।

  17. JMA - Jurik Moving Average সূচকটি সর্বনিম্ন সময়ের ব্যবধানে মূল্য বক্ররেখা মসৃণ করার অন্যতম নিশ্চিত উপায়। সূচকটি মুদ্রা ব্যবসায়ীদের শক্তিশালী মূল্য আন্দোলনের সময় সেরা মূল্য ফিল্টারগুলির মধ্যে একটি সরবরাহ করে। এই সময়ে, যখন বিটকয়েনের দামের ক্রিয়াকলাপ এত শক্তিশালী, এই সূচকটি প্রয়োজনীয়।

  18. এমএসিডি - মুভিং মিডিয়ার কনভার্জেন্স ডিভার্জেন্স (এমএসিডি) হল একটি প্রবণতা অনুসরণকারী গতির সূচক যা একটি সিকিউরিটির মূল্যের দুটি মুভিং মিডিয়ার মধ্যে সম্পর্ক দেখায়। এমএসিডি গণনা করা হয় ২6-পরিয়ড এক্সপোনেন্সিয়াল মুভিং মিডিয়ার (ইএমএ) কে 12-পরিয়ড ইএমএ থেকে বিয়োগ করে। আজকের দিনে, ম্যাকডেমিকস, জেএমএ-র মতোই লাভজনক বট তৈরির জন্য প্রয়োজনীয়।

  19. ভলিউম ডেল্টা - এসএন্ডসি ম্যাগাজিনের অক্টোবর ২০০৩ সংখ্যায় প্রকাশিত ভাদিম জিমেলফারবের বুল এবং বিয়ার ব্যালেন্স সূচকের উপর ভিত্তি করে একটি সমষ্টিগত ভলিউম ডেল্টা পদ্ধতি। আপনার প্রয়োজন অনুযায়ী চলমান গড়ের দৈর্ঘ্য সামঞ্জস্য করুন (প্রতীক, সময়সীমা ইত্যাদি)

  20. ভলিউম ওয়েট - কৌশলটির জন্য সবচেয়ে গুরুত্বপূর্ণ সূচক, ফ্ল্যাট চার্টে খোলা ট্রেড এড়ানোর জন্য, শক্তিশালী ভলিউম বারগুলির পরে নতুন ট্রেড খোলা হয়।

  21. MA 5-10-30 - পূর্ববর্তীগুলির মতো এটি প্রবণতা আরও ভালভাবে দেখার জন্য, এবং প্রবণতা সঠিকভাবে সংজ্ঞায়িত করার জন্য, এছাড়াও Speed_MA ভবিষ্যতের মূল্য কর্মের পূর্বাভাস দেওয়ার জন্য ব্যবহার করা হয়।

  22. স্টোকাস্টিক-স্টক ট্রেন্ড বিপরীতমুখীতা পূর্বাভাস জন্য দরকারী। এটি মূল্য গতি উপর ফোকাস এবং overbought এবং oversold মাত্রা সনাক্ত করতে ব্যবহার করা যেতে পারে

ভালো থাকবেন 😉

ব্যাকটেস্ট img


/*backtest
start: 2022-05-20 00:00:00
end: 2022-06-18 23:59:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © wielkieef

//@version=4
strategy("15MIN BTCUSDTPERP BOT", overlay=true,  pyramiding=1,initial_capital = 10000, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0)

//SOURCE ==================================================================================================================================================================================================================================================================

src = input(ohlc4)

// INPUTS ==================================================================================================================================================================================================================================================================

//ADX -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Act_ADX = input(true, title = "AVERAGE DIRECTIONAL INDEX", type = input.bool)
ADX_options = input("MASANAKAMURA",  title = "ADX OPTION", options = ["CLASSIC", "MASANAKAMURA"])
ADX_len = input(11, title = "ADX LENGTH", type = input.integer, minval = 1)
th = input(12, title = "ADX THRESHOLD", type = input.float, minval = 0, step = 0.5)

//Range Filter----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

length0 = input(13, title="Range Filter lenght"),mult = input(1, title="Range Filter mult")

//SAR-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

start = input(title="SAR Start", type=input.float, step=0.001, defval=0)
increment = input(title="SAR Increment", type=input.float, step=0.001, defval=0.006)
maximum = input(title="SAR Maximum", type=input.float, step=0.01, defval=1)
width = input(title="SAR Point Width", type=input.integer, minval=1, defval=1)

//RSI---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

len_3 = input(70, minval=1, title="RSI lenght")
src_3 = input(close, "RSI Source")

//TWAP Trend --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

smoothing = input(title="TWAP Smoothing", defval= 10)
resolution = input("0", "TWAP Timeframe") 

//JMA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

inp = input(title="JMA Source", type=input.source, defval=close)
reso = input(title="JMA Resolution", type=input.resolution, defval="")
rep = input(title="JMA Allow Repainting?", type=input.bool, defval=false)
src0 = security(syminfo.tickerid, reso, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
lengths = input(title="JMA Length", type=input.integer, defval=4, minval=1)

//MACD------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

fast_length = input(title="MACD Fast Length", type=input.integer, defval=25)
slow_length = input(title="MACD Slow Length", type=input.integer, defval=50)
signal_length = input(title="MACD Signal Smoothing", type=input.integer, minval = 1, maxval = 50, defval = 9)

//Volume Delta -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

periodMa = input(title="Delta Length", minval=1, defval=45)

//Volume weight------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

maLength = input(title="Volume Weight Length", type=input.integer, defval=100, minval=1)
maType = input(title="Volume Weight Type", type=input.string, defval="SMA", options=["EMA", "SMA", "HMA", "WMA", "DEMA"])
rvolTrigger = input(title="Volume To Trigger Signal", type=input.float, defval=1.5, step=0.1 , minval=0.1)

//MA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

length = input(51, minval=1, title="MA Length")
matype = input(5, minval=1, maxval=5, title="AvgType")

//Momentum------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

tmolength = input(45, title="Momentum Length")
calcLength = input(12, title="Momentum Calc length")
smoothLength = input(9, title="Momentum Smooth length")

//INDICATORS ==============================================================================================================================================================================================================================================================

//ADX----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calcADX(_len) =>
    up              = change(high)
	down            = -change(low)
	plusDM          = na(up)   ? na : (up > down and up > 0   ? up   : 0)
    minusDM         = na(down) ? na : (down > up and down > 0 ? down : 0)
	truerange       = rma(tr, _len)
	_plus           = fixnan(100 * rma(plusDM, _len)  / truerange)
	_minus          = fixnan(100 * rma(minusDM, _len) / truerange)
	sum             = _plus + _minus
	_adx            = 100 * rma(abs(_plus - _minus) / (sum == 0 ? 1 : sum), _len)
    [_plus,_minus,_adx]

calcADX_Masanakamura(_len) =>
    SmoothedTrueRange                   = 0.0
    SmoothedDirectionalMovementPlus     = 0.0
    SmoothedDirectionalMovementMinus    = 0.0
    TrueRange                           = max(max(high - low, abs(high - nz(close[1]))), abs(low - nz(close[1])))
    DirectionalMovementPlus             = high - nz(high[1]) > nz(low[1]) - low ? max(high - nz(high[1]), 0) : 0
    DirectionalMovementMinus            = nz(low[1]) - low > high - nz(high[1]) ? max(nz(low[1]) - low, 0)   : 0
    SmoothedTrueRange                   := nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1]) /_len) + TrueRange
    SmoothedDirectionalMovementPlus     := nz(SmoothedDirectionalMovementPlus[1])  - (nz(SmoothedDirectionalMovementPlus[1])  / _len) + DirectionalMovementPlus
    SmoothedDirectionalMovementMinus    := nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1]) / _len) + DirectionalMovementMinus
    DIP                                 = SmoothedDirectionalMovementPlus  / SmoothedTrueRange * 100
    DIM                                 = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
    DX                                  = abs(DIP-DIM) / (DIP+DIM)*100
    adx                                 = sma(DX, _len)
    [DIP,DIM,adx]

[DIPlusC,DIMinusC,ADXC] = calcADX(ADX_len) 
[DIPlusM,DIMinusM,ADXM] = calcADX_Masanakamura(ADX_len)
DIPlus                  = ADX_options == "CLASSIC" ? DIPlusC    : DIPlusM
DIMinus                 = ADX_options == "CLASSIC" ? DIMinusC   : DIMinusM
ADX                     = ADX_options == "CLASSIC" ? ADXC       : ADXM

ADX_color = DIPlus > DIMinus and ADX > th ? color.green : DIPlus < DIMinus and ADX > th ? color.red : color.orange
barcolor(color = Act_ADX ? ADX_color : na, title = "ADX")

//Range Filter---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

out = 0., cma = 0., cts = 0.
Var = variance(src,length0)*mult
sma = sma(src,length0)

secma = pow(nz(sma - cma[1]),2) 
sects = pow(nz(src - cts[1]),2) 
ka = Var < secma ? 1 - Var/secma : 0
kb = Var < sects ? 1 - Var/sects : 0

cma := ka*sma+(1-ka)*nz(cma[1],src)
cts := kb*src+(1-kb)*nz(cts[1],src)

css = cts > cma ? color.green : color.red
a = plot(cts,"CTS",color.red,2,transp=0)
b = plot(cma,"CMA",color.green,2,transp=0)
fill(a,b,color=css,transp=80)

rangegood = cts > cma
rangebad  = cts < cma

//SAR-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

psar = sar(start, increment, maximum)
dir = psar < close ? 1 : -1

psarColor = dir == 1 ? color.green : color.red
psarPlot = plot(psar, title="PSAR", style=plot.style_circles, linewidth=width, color=psarColor, transp=0)

var color longColor = color.green
var color shortColor = color.red

sargood = dir ==1
sarbad  = dir ==-1

//RSI---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

up_3 = rma(max(change(src_3), 0), len_3)
down_3 = rma(-min(change(src_3), 0), len_3)
rsi_3 = down_3 == 0 ? 100 : up_3 == 0 ? 0 : 100 - (100 / (1 + up_3 / down_3))

rsiob = (rsi_3 < 70)
rsios  = (rsi_3 > 30) 

//TWAP Trend --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

res = resolution != "0" ? resolution : timeframe.period
weight = barssince(change(security(syminfo.tickerid, res, time, lookahead=barmerge.lookahead_on)))
price = 0.
price:= weight == 0 ? src : src + nz(price[1])
twap = price / (weight + 1)
ma_ = smoothing < 2 ? twap : sma(twap, smoothing)
bullish = iff(smoothing < 2, src >= ma_, src > ma_)
disposition = bullish ? color.lime : color.red
basis = plot(src, "OHLC4", disposition, linewidth=1, transp=100)
work = plot(ma_, "TWAP", disposition, linewidth=2, transp=20)
fill(basis, work, disposition, transp=65)

//JMA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

jsa = (src0 + src0[lengths]) / 2
sig = src0 > jsa ? 1 : src0 < jsa ? -1 : 0

jsaColor = sig > 0 ? color.lime : sig < 0 ? color.red : color.orange
plot(jsa, color=jsaColor, linewidth=2)

jmagood = sig > 0
jmabad  = sig < 0

//MACD------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

fast_ma = ema(src, fast_length)
slow_ma = ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma(macd, signal_length)

macdgood = macd > signal
macdbad  = macd < signal

//Volume Delta -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

bullPower = iff(close < open, iff(close[1] < open, max(high - close[1], close - low), max(high - open, close - low)), iff(close > open, iff(close[1] > open,  high - low, max(open - close[1], high - low)), iff(high - close > close - low, iff(close[1] < open, max(high - close[1], close - low), high - open), iff(high - close < close - low, iff(close[1] > open, high - low, max(open - close[1], high - low)), iff(close[1] > open, max(high - open, close - low), iff(close[1] < open, max(open - close[1], high - low), high-low))))))
bearPower = iff(close < open, iff(close[1] > open, max(close[1] - open, high - low), high - low), iff(close > open, iff(close[1] > open, max(close[1] - low, high - close), max(open - low, high - close)), iff(high - close > close - low, iff(close[1] > open, max(close[1] - open, high - low), high - low), iff(high - close < close - low, iff(close[1] > open, max(close[1] - low, high - close), open - low), iff(close[1] > open, max(close[1] - open, high - low), iff(close[1] < open, max(open - low, high - close), high - low))))))

bullVolume = (bullPower / (bullPower + bearPower)) * volume
bearVolume = (bearPower / (bullPower + bearPower)) * volume

delta = bullVolume - bearVolume
cvd = cum(delta)
cvdMa = sma(cvd, periodMa)

deltagood = cvd > cvdMa
deltabad  = cvd < cvdMa

//Volume weight------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

getMA0(length) =>
    maPrice = ema(volume, length)
    if maType == "SMA"
        maPrice := sma(volume, length)
    if maType == "HMA"
        maPrice := hma(volume, length)
    if maType == "WMA"
        maPrice := wma(volume, length)
    if maType == "DEMA"
        e1 = ema(volume, length)
        e2 = ema(e1, length)
        maPrice := 2 * e1 - e2
    maPrice

ma = getMA0(maLength)
rvol = volume / ma

volumegood = volume > rvolTrigger * ma

//MA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ma5 = sma(close, 5)
ma10 = sma(close, 10)
ma30 = sma(close, 30)

magood = ma5 > ma30
mabad  = ma5 < ma30

simplema = sma(src,length)
exponentialma = ema(src,length)
hullma = wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length)))
weightedma = wma(src, length)
volweightedma = vwma(src, length)
avgval = matype==1 ? simplema : matype==2 ? exponentialma : matype==3 ? hullma : matype==4 ? weightedma : matype==5 ? volweightedma : na
MA_speed = (avgval / avgval[1] -1 ) *100

masgood = MA_speed > 0
masbad  = MA_speed < 0

//Momentum-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

data = 0
for i = 1 to tmolength-1
    if close > open[i]
        data := data + 1
    if close < open[i]
        data := data - 1
    
EMA5 = ema(data, calcLength)
Main = ema(EMA5, smoothLength)
Signal = ema(Main, smoothLength)

momentumgood = Main > Signal
momentumbad = Main < Signal

//STRATEGY===============================================================================================================================================================================================================================================================

Long = (DIPlus > DIMinus and ADX > th)  and volumegood and sargood and rsiob and macdgood and deltagood and magood and masgood and bullish and jmagood and rangegood and momentumgood
Short = (DIPlus < DIMinus and ADX > th) and volumegood and sarbad  and rsios and macdbad  and deltabad  and mabad and masbad and jmabad and rangebad and momentumbad

//BACKTESTING==========================================================================================================================================================================================================================

// ————— Backtest input
Act_BT              = input(true, title = "BACKTEST", type = input.bool)
backtest_time       = input(180, title ="BACKTEST DAYS", type = input.integer, minval = 1)*24*60*60*1000
entry_Type          = input("% EQUITY", title = "ENTRY TYPE", options = ["CONTRACTS","CASH","% EQUITY"])
et_Factor           = (entry_Type == "CONTRACTS") ? 1 : (entry_Type == "% EQUITY") ? (100/(strategy.equity/close)) : close

//Signals----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// SL AND TP-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

stopPer = input(3.6, title='Stop Loss % [plotshape]', type=input.float) / 100
takePer = input(0.8, title='Take Profit % [plotshape]', type=input.float) / 100

long_short = 0
long_last = Long and (nz(long_short[1]) == 0 or nz(long_short[1]) == -1)
short_last = Short and (nz(long_short[1]) == 0 or nz(long_short[1]) == 1)
long_short := long_last ? 1 : short_last ? -1 : long_short[1]

longPrice = valuewhen(long_last, close, 0)
shortPrice = valuewhen(short_last, close, 0)

longStop = longPrice * (1 - stopPer)
shortStop = shortPrice * (1 + stopPer)
longTake = longPrice * (1 + takePer)
shortTake = shortPrice * (1 - takePer)

//plot lines ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

plotshape(long_short==1  ? longTake : na, style=shape.cross, color=color.gray, location=location.absolute )
plotshape(long_short==-1 ? shortTake : na, style=shape.cross, color=color.gray, location=location.absolute )

longBar1 = barssince(long_last)
longBar2 = longBar1 >= 1 ? true : false
shortBar1 = barssince(short_last)
shortBar2 = shortBar1 >= 1 ? true : false

Long_SL = long_short==1 and longBar2 and low < longStop
Short_SL = long_short==-1 and shortBar2 and high > shortStop

Long_TP = long_short==1 and longBar2 and high > longTake
Short_TP = long_short==-1 and shortBar2 and low < shortTake

long_short := (long_short==1 or long_short==0) and longBar2 and (Long_SL or Long_TP) ? 0 : (long_short==-1 or long_short==0) and shortBar2 and (Short_SL or Short_TP) ? 0 : long_short

last_long_cond  = Long and  long_last
last_short_cond = Short and short_last

//plotshapes---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

plotshape(last_long_cond, title="Long x1", color=color.blue, style=shape.triangleup, location=location.belowbar, size=size.small, textcolor=color.white, text="Long" , transp=1)
plotshape(last_short_cond, title="Short x1", color=color.red, style=shape.triangledown, location=location.abovebar, size=size.tiny, textcolor=color.white, text="Short" ,transp=1)

plotshape(Long_SL, location=location.belowbar, color=color.black, size=size.tiny , text="SL", textcolor=color.fuchsia)
plotshape(Short_SL, location=location.abovebar, color=color.black, size=size.tiny , text="SL", textcolor=color.fuchsia)

plotshape(Long_TP,style=shape.triangledown, location=location.abovebar, color=color.gray, size=size.tiny , text="TP", textcolor=color.red)
plotshape(Short_TP,style=shape.triangleup, location=location.belowbar, color=color.gray, size=size.tiny , text="TP", textcolor=color.green)

if last_long_cond and Act_BT
    strategy.entry("L", strategy.long)
    
if last_short_cond and Act_BT
    strategy.entry("S", strategy.short)
    
per(pcnt) =>
    strategy.position_size != 0 ? round(pcnt / 100 * strategy.position_avg_price / syminfo.mintick) : float(na)
stoploss=input(title=" stop loss [BT]", defval=3.6, minval=0.01)
los = per(stoploss)
q=input(title=" qty percent", defval=100, minval=1)

tp=input(title=" Take profit [BT]", defval=0.8, minval=0.01)

strategy.exit("tp", qty_percent = q, profit = per(tp), loss = los)

//By wielkieef


সম্পর্কিত

আরো