Atmos Bitcoin
Atmos Bitcoin
stt = false
ett = false
if timex
stt := time(timeframe.period,s) and timex
else
stt := true
ab = time(timeframe.period,e)
if timex
ett := time(timeframe.period,e) and timex
else
ett := false
// Ichimoku Cloud
// fill(p1, p2, color = leadLine1 > leadLine2 ? color.rgb(67, 160, 71, 90) :
color.rgb(244, 67, 54, 90))
FSSA = leadLine1
FSSB = leadLine2
CSSA = leadLine1[25]
CSSB = leadLine2[25]
PSSA = leadLine1[50]
PSSB = leadLine2[50]
CSC = close[25]
CS = close
TK = conversionLine
KJ = baseLine
// plot(Chart_display==false ? FSSA : na, title = "FSSA", color = color.lime)
// plot(Chart_display==false ? FSSB : na, title = "FSSB", color = #e600cb)
// plot(Chart_display==false ? CSSA : na, title = "CSSA", color = #7fe600)
// plot(Chart_display==false ? CSSB : na, title = "CSSB", color = #d3e600)
// plot(Chart_display==false ? PSSA : na, title = "PSSA", color = #e61f00)
// plot(Chart_display==false ? PSSB : na, title = "PSSB", color = #ff3078)
// plot(Chart_display==false ? CSC : na, title = "CSC", color = #00dee6)
// plot(Chart_display==false ? CS : na, title = "CS", color = #005ce6)
// plot(Chart_display==false ? TK : na, title = "TK", color = #9c12ff)
// plot(Chart_display==false ? KJ : na, title = "KJ", color = #c891ff)
// CHOPPINESS INDEX
Buffer = syminfo.mintick
int buy = 0
int buy1 = 0
int sell = 0
int short = 0
int short1 = 0
int cover = 0
var bflag = 0
var sflag = 0
var buyprice = 0.00
var shortprice = 0.00
var Long_tp = 0.00
var Long_sl = 0.00
var Long_tsl = 0.00
var Short_tp = 0.00
var Short_sl = 99999999.99
var Short_tsl = 99999999.99
var LTSL_f = 0
var STSL_f = 0
var Long_QTY_EX = 0.00000
var Short_QTY_EX = 0.00000
FL_sell = 0
FL_cover = 0
var LTP_flag = 0
var STP_flag = 0
sell_close = 0
cover_close = 0
tarminbodysize = input.float(9, title = "Min Body Size(TAR)", group = "Candle
Conditions")
tarclosewrtsize = input.float(0.32, title = "Close WRT Size(TAR)", group = "Candle
Conditions")
tarMinbodysize = input.float(0.12, title = "Min Body WRT Size(TAR)", group =
"Candle Conditions")
tarMinbodysurge = input.float(0.12, title = "Max size surge(TAR)", group = "Candle
Conditions")
refminbodysize = input.float(2, title = "Min Body Size(REF)", group = "Candle
Conditions")
refclosewrtsize = input.float(0.12, title = "Close WRT Size(REF)", group = "Candle
Conditions")
refMinbodysize = input.float(0.12, title = "Min Body WRT Size(REF)", group =
"Candle Conditions")
refMinbodysurge = input.float(0.12, title = "Max size surge(REF)", group = "Candle
Conditions")
Open = open
Close = close
High = high
Low = low
Long_con_2 = ((Close >= (Low + ((High - Low) * 0.5052))) and (close > Short_sl and
sflag[1]==1) and STP_flag==0)[1]
short_con_2 = ((Close <= (High - ((High - Low)*0.5052))) and (close < Long_sl and
bflag[1]==1) and LTP_flag==0)[1]
if (sun_S and sun) or (mon_S and mon) or (tue_S and tue) or (wed_S and wed) or
(thu_S and thu) or (fri_S and fri) or (sat_S and sat)
if high > (high[1] + Buffer) and Long_con and bflag==0 and sflag==0 and stt
buy := 1
bflag := 1
buyprice := (high[1] + Buffer)
Long_tp := High[1] + (ATR[1]*TP_Input)
Long_sl := math.max(High[1] - (ATR[1]*SL_Input), KJ[1])
STP_flag := 0
LTP_flag := 0
// alert("Long Entry")
if low < (low[1] - Buffer) and Short_con and bflag==0 and sflag==0 and stt
short := 1
sflag := 1
shortprice := (low[1] - Buffer)
Short_tp := Low[1] - (ATR[1]*TP_Input)
Short_sl := math.min(Low[1] + (ATR[1]*SL_Input), KJ[1])
STP_flag := 0
LTP_flag := 0
if (Long_con_2 and (high > (high[1] + Buffer))) and LTP_flag==0 and bflag==0
and sflag==0 and stt
buy1 := 1
bflag := 1
buyprice := High[1]
Long_tp := buyprice + (ATR[1]*TP_Input)
Long_sl := math.max(buyprice - (ATR[1]*SL_Input), KJ[1])
if Long_sl > buyprice
Long_sl := (buyprice - (ATR[1]*SL_Input))
Short_sl := 99999999.99
if (short_con_2 and (low < (low[1] - Buffer))) and STP_flag==0 and bflag==0 and
sflag==0 and stt
short1 := 1
sflag := 1
shortprice := Low[1]
Short_tp := shortprice - (ATR[1]*TP_Input)
Short_sl := math.min(shortprice + (ATR[1]*SL_Input), KJ[1])
if Short_sl < shortprice
Short_sl := (shortprice + (ATR[1]*SL_Input))
Long_sl := 0.00
if FL_sell[1]==1
Long_QTY_EX := 0
if FL_cover[1]==1
Short_QTY_EX := 0
hma= ta.sma(high,20)
lma= ta.sma(low,20)
// plotshape(buy==1 ? hma*1.15 : na, title="BUY", text="BUY",
location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.green,
textcolor=color.white, force_overlay = true)
// plotshape(sell==1 ? lma*1.15 : na, title="SELL", text="SELL",
location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.red,
textcolor=color.white, force_overlay = true)
// plotshape(short==1 ? high : na, title="SHORT", text="SHORT",
location=location.absolute, style=shape.labeldown, size=size.tiny,
color=color.fuchsia, textcolor=color.white, force_overlay = true)
// plotshape(cover==1 ? low : na, title="COVER", text="COVER",
location=location.absolute, style=shape.labelup, size=size.tiny, color=color.blue,
textcolor=color.white, force_overlay = true)
// plot(bflag==1 and buyprice > 0.00 ? buyprice : sflag==1 and shortprice <
99999999.99 and shortprice > 0.00 ? shortprice : na, title = "Entry Price", color =
color.white, style = plot.style_linebr, linewidth = 2, force_overlay = true)
// plot(bflag==1 and Long_tp > 0.00 and Long_tp < 99999999.99 ? Long_tp : sflag==1
and Short_tp > 0.00 ? Short_tp : na, title = "Target", color = color.green, style =
plot.style_linebr, linewidth = 3, force_overlay = true)
// plot(bflag==1 and Long_sl > 0.00 ? Long_sl : sflag==1 and Short_sl > 0.00 and
Short_sl < 99999999.99 ? Short_sl : na, title = "Stoploss", color = color.red,
style = plot.style_linebr, linewidth = 3, force_overlay = true)
// plot(bflag==1 and Long_tsl > 0.00 ? Long_tsl : sflag==1 and Short_tsl > 0.00 and
Short_tsl < 99999999.99 ? Short_tsl : na, title = "Trailing Stoploss", color =
color.rgb(185, 0, 0), style = plot.style_linebr, linewidth = 3, force_overlay =
true)
firstTrail = 8
secondTrail = 2
abc = (sun_S and sun) or (mon_S and mon) or (tue_S and tue) or (wed_S and wed) or
(thu_S and thu) or (fri_S and fri) or (sat_S and sat)
def = (high > (high[1] + Buffer) and Long_con and bflag==0 and sflag==0 and stt)
//
===================================================================================
======================================
// LONG ENTRY
//
===================================================================================
======================================
optionsSymbolCE = "NIFTY03AUG24000"
if buy==1
alert("pineBuy", alert.freq_once_per_bar_close)
// label.new(bar_index, low - (low*0.0001), text = "Buy QTY:" +
str.tostring(QTY_buy), style = label.style_label_up, color = #1a7a1d, textcolor =
color.white, force_overlay = true)
strategy.entry("Long", strategy.long, qty = QTY_buy, alert_message = "{Symbol:"
+ optionsSymbolCE + ", transType : Long" + ",quantity :" + str.tostring(QTY_buy) +
"}" )
//
===================================================================================
======================================
// SHORT ENTRY
//
===================================================================================
======================================
// if (sell==1) or (sell_close==1)
// alert("pineSell", alert.freq_once_per_bar_close)
// // label.new(bar_index, high + (high*0.0001), text = "Sell QTY:" +
str.tostring(Long_QTY_EX), style = label.style_label_down, color = color.red,
textcolor = color.white, force_overlay = true)
// strategy.entry("Short", strategy.short, qty = QTY_buy, alert_message =
"{Symbol:" + optionsSymbolCE + ", transType : Long" + ",quantity :" +
str.tostring(QTY_buy) + "}" )
// if (short==1)
// alert("pineShort", alert.freq_once_per_bar_close)
// // label.new(bar_index, high + (high*0.0001), text = "Short QTY:" +
str.tostring(QTY_buy), style = label.style_label_down, color = color.fuchsia,
textcolor = color.white, force_overlay = true)
// strategy.close("Short", "Short Exit", qty = math.ceil(Long_QTY_EX),
alert_message = "{Symbol:" + optionsSymbolCE + ", transType : Long Exit" +
",quantity :" + str.tostring(Long_QTY_EX) + "}" )
// // alert("Short Entry")
// // alertcondition(short==1, "Short Entry")
// if (cover==1) or (cover_close==1)
// alert("pineCover", alert.freq_once_per_bar_close)
// // label.new(bar_index, low - (low*0.0001), text = "Cover QTY:" +
str.tostring(Short_QTY_EX), style = label.style_label_up, color = color.blue,
textcolor = color.white, force_overlay = true)
// strategy.close("Short", "Short Exit", qty = math.ceil(Short_QTY_EX),
alert_message = "Short Exit")
// if Short_QTY_EX >=8
// strategy.close("Short", "Short Exit", qty = firstTrail)
// if Short_QTY_EX <=2
// strategy.close("Short", "Short Exit", qty = secondTrail)
// alert("Short Exit")
// alertcondition((cover==1) or (cover_close==1), "Short Exit")
// if (short1==1)
// alert("pineRevSHort", alert.freq_once_per_bar_close)
// label.new(bar_index, low - (low*0.0001), text = "RevShort QTY:" +
str.tostring(QTY_buy), style = label.style_label_up, color = #6b05ca, textcolor =
color.white, force_overlay = true)
// strategy.entry("Short", strategy.short, qty = 10)
// alert("Rev Short")
// alertcondition((short1 == 1), "RevShort")
// if (buy1==1)
// alert("pineRevBuy", alert.freq_once_per_bar_close)
// label.new(bar_index, high + (high*0.0001), text = "RevBuy QTY:" +
str.tostring(QTY_buy), style = label.style_label_down, color = #034921, textcolor
= color.white, force_overlay = true)
// strategy.entry("Long", strategy.long, qty = 10)
// alert("Rev Buy")
// alertcondition((buy1 == 1), "Revbuy")
//
===================================================================================
=========================================================
// FROM INTRABLAST
//
===================================================================================
=========================================================
lenn = 98
mult = 2.5
tc = 25
len = lenn
// signal(source) =>
src = close
y = 1 - grad / 100
y := y > 100 ? 100 : y < 0 ? 0 : y
barcolor(src > upper ? upColor : src < lower ? downColor : upColor)
// ===================================
// MOVING AVERAGE
// ===================================
//shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=false)
lenMA100 = 100
srcMA100 = close
offset1 = 0
out = ta.ema(srcMA100, lenMA100)
plot(out, title="MomentumA", color=color.green, offset=offset1, linewidth=3)
typeMA100 = "SA"
smoothingLength100 =100
//@version=5
//"Moving Average Exponential 200",
//shorttitle="EMA200", overlay=true, timeframe="", timeframe_gaps=false)
lenMA120 = 120
srcMA120 = close
offset120 = 0
out120 = ta.ema(srcMA120, lenMA120)
plot(out120, title="MomentumB", color=color.red, offset=offset1, linewidth=3)
typeMA120 = "SP"
smoothingLength120 = 5
//@version=5
//"Moving Average Exponential 100",
//shorttitle="EMA1000", overlay=true, timeframe="", timeframe_gaps=false)
lenMA1000 = 1000
srcMA1000 = close
offset1000 = 0
out1000 = ta.ema(srcMA1000, lenMA1000)
plot(out1000, title="SupportAndResistance", color=color.purple, offset=offset1,
linewidth=4)
typeMA1000 = "sp"
smoothingLength1000 = 5