0% found this document useful (0 votes)
63 views2 pages

Mega Crypto Bot Strategy

The document outlines a trading strategy script for a cryptocurrency bot using Pine Script version 5. It includes features such as candle body resistance channels, support and resistance levels, and exponential moving averages (EMAs) for trend direction. The strategy generates buy and sell signals based on crossovers and crossunders of the open and close prices over a specified period.

Uploaded by

ufiihogkr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

Mega Crypto Bot Strategy

The document outlines a trading strategy script for a cryptocurrency bot using Pine Script version 5. It includes features such as candle body resistance channels, support and resistance levels, and exponential moving averages (EMAs) for trend direction. The strategy generates buy and sell signals based on crossovers and crossunders of the open and close prices over a specified period.

Uploaded by

ufiihogkr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//@version=5

strategy(title='Mega crypto bot strategy', shorttitle='megacryptobot_Strategy',


overlay=true, pyramiding=0, initial_capital=10000, currency=currency.USD)

//Candle body resistance Channel-----------------------------//


len = 34
src = input(close, title='Candle body resistance Channel')
out = ta.sma(src, len)
last8h = ta.highest(close, 13)
lastl8 = ta.lowest(close, 13)
bearish = ta.cross(close, out) == 1 and ta.falling(close, 1)
bullish = ta.cross(close, out) == 1 and ta.rising(close, 1)
channel2 = input(false, title='Bar Channel On/Off')
ul2 = plot(channel2 ? last8h : last8h == nz(last8h[1]) ? last8h : na,
color=color.new(color.black, 0), linewidth=1, style=plot.style_linebr,
title='Candle body resistance level top', offset=0)
ll2 = plot(channel2 ? lastl8 : lastl8 == nz(lastl8[1]) ? lastl8 : na,
color=color.new(color.black, 0), linewidth=1, style=plot.style_linebr,
title='Candle body resistance level bottom', offset=0)
//fill(ul2, ll2, color=black, transp=95, title="Candle body resistance Channel")

//-----------------Support and Resistance


RST = input(title='Support / Resistance length:', defval=10)
RSTT = ta.valuewhen(high >= ta.highest(high, RST), high, 0)
RSTB = ta.valuewhen(low <= ta.lowest(low, RST), low, 0)
RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : color.red, linewidth=1, offset=+0)
RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : color.green, linewidth=1, offset=0)

//--------------------Trend colour
ema------------------------------------------------//
src0 = close
len0 = input.int(13, minval=1, title='EMA 1')
ema0 = ta.ema(src0, len0)
falling_1 = ta.falling(ema0, 2)
direction = ta.rising(ema0, 2) ? +1 : falling_1 ? -1 : 0
plot_color = direction > 0 ? color.lime : direction < 0 ? color.red : na
plot(ema0, title='EMA', style=plot.style_line, linewidth=1, color=plot_color)

//-------------------- ema 2------------------------------------------------//


src02 = close
len02 = input.int(21, minval=1, title='EMA 2')
ema02 = ta.ema(src02, len02)
falling_2 = ta.falling(ema02, 2)
direction2 = ta.rising(ema02, 2) ? +1 : falling_2 ? -1 : 0
plot_color2 = direction2 > 0 ? color.lime : direction2 < 0 ? color.red : na
plot(ema02, title='EMA Signal 2', style=plot.style_line, linewidth=1,
color=plot_color2)

//=============Hull MA//
show_hma = input(false, title='Display Hull MA Set:')
hma_src = input(close, title='Hull MA\'s Source:')
hma_base_length = input.int(8, minval=1, title='Hull MA\'s Base Length:')
hma_length_scalar = input.int(5, minval=0, title='Hull MA\'s Length Scalar:')
hullma(src, length) =>
ta.wma(2 * ta.wma(src, length / 2) - ta.wma(src, length),
math.round(math.sqrt(length)))
hullma__1 = hullma(hma_src, hma_base_length + hma_length_scalar * 6)
plot(not show_hma ? na : hullma__1, color=color.new(color.black, 0), linewidth=2,
title='Hull MA')
//============ signal Generator ==================================//
period = input('720')
ch1 = request.security(syminfo.tickerid, period, open)
ch2 = request.security(syminfo.tickerid, period, close)
longCondition = ta.crossover(request.security(syminfo.tickerid, period, close),
request.security(syminfo.tickerid, period, open))
if longCondition
strategy.entry('BUY', strategy.long)
shortCondition = ta.crossunder(request.security(syminfo.tickerid, period, close),
request.security(syminfo.tickerid, period, open))
if shortCondition
strategy.entry('SELL', strategy.short)

///////////////////////////////////////////////////////////////////////////////////
////////

You might also like