SuperJump Multi Time Frame Heiken Ashi Color
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SuperJump

//@version=5
indicator("SuperJump Multi Time Frame Heiken Ashi Color",shorttitle="SJump Heiken Color", overlay=true)

TopAreaRes = input.timeframe(title="Top Area Time Frame",defval="")
BotAreaRes = input.timeframe(title="Bottom Area Time Fame",defval="15")
IsActiveBotArea = input.bool(title="Auto Time Frame for Bottom Area", defval = false)

BotTF1 = input.timeframe(title="Input TF", defval = "5", inline = '1')
BotTF1T = input.timeframe(title=" > Convert TF", defval = "15", inline = '1')
BotTF2 = input.timeframe(title="Input TF", defval = "15", inline = '2')
BotTF2T = input.timeframe(title=" > Convert TF", defval = "60", inline = '2')
BotTF3 = input.timeframe(title="Input TF", defval = "60", inline = '3')
BotTF3T = input.timeframe(title=" > Convert TF", defval = "240", inline = '3')

TargetBottomRes = IsActiveBotArea == false ? BotAreaRes : timeframe.period == BotTF1 ? BotTF1T : timeframe.period == BotTF2 ? BotTF2T : timeframe.period == BotTF3 ? BotTF3T : ""

[hkOpen, hkHigh, hkLow, hkClose] = request.security(ticker.heikinashi(syminfo.tickerid), TopAreaRes, [open, high, low, close])
haColor = hkClose > hkOpen ? hkLow == hkOpen ? color.green : color.new(#26a69a,50)  : hkHigh==hkOpen ? color.red : color.new(#ef5350,50) 
plotshape(hkOpen,style=shape.square,color=haColor,location=location.top,size=size.tiny,title = "Top Area Heiken Color")


[bhkOpen, bhkHigh, bhkLow, bhkClose] = request.security(ticker.heikinashi(syminfo.tickerid), TargetBottomRes, [open, high, low, close])
bhaColor = bhkClose > bhkOpen ? bhkLow == bhkOpen ? color.green : color.new(#26a69a,50)  : bhkHigh==bhkOpen ? color.red : color.new(#ef5350,50) 
plotshape(bhkOpen,style=shape.square,color=bhaColor,location=location.bottom,size=size.tiny,title = "Bottom Area Heiken Color")

alertcondition(hkClose > hkOpen and hkLow == hkOpen ,"TOP 양봉"," TOP 꽉찬 양봉" )
alertcondition(hkClose < hkOpen and hkHigh==hkOpen  ,"TOP 음봉", "TOP 꽉찬 음봉" )
alertcondition(bhkClose > bhkOpen and bhkLow == bhkOpen ,"BOTTOM 양봉","BOTTOM 꽉찬 양봉" )
alertcondition(bhkClose < bhkOpen and bhkHigh==bhkOpen  ,"BOTTOM 음봉", "BOTTOM 꽉찬 음봉" )

