本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Shauryam_or
//@version=05
indicator(title="High and low" ,overlay=true)
h = input.int(09 , "Hour" , minval=0, maxval=23, inline='hm',group="Select Time for Signal")
m = input.int(15, ": Min", minval=0, maxval=59, inline='hm',group="Select Time for Signal")
//select Gmt time
gmt=input.string("Asia/Kolkata",title="Gmt",options=["America/New_York","America/Los_Angeles","America/Chicago","America/Phoenix","America/Toronto"
,"America/Vancouver","America/Argentina/Buenos_Aires","America/El_Salvador","America/Sao_Paulo","America/Bogota"
,"Europe/Moscow" ,"Europe/Athens" ,"Europe/Berlin","Europe/London" ,"Europe/Madrid" ,"Europe/Paris" ,"Europe/Warsaw",
"Australia/Sydney","Australia/Brisbane","Australia/Adelaide","Australia/ACT" ,"Asia/Almaty"
,"Asia/Ashkhabad" ,"Asia/Tokyo" ,"Asia/Taipei" ,"Asia/Singapore" ,"Asia/Shanghai" ,"Asia/Seoul" ,"Asia/Tehran" ,"Asia/Dubai" ,"Asia/Kolkata"
,"Asia/Hong_Kong" ,"Asia/Bangkok" ,"Pacific/Auckland","Pacific/Chatham","Pacific/Fakaofo" ,"Pacific/Honolulu" ],group="Select Time for Signal",inline="hm")
select_gmt=gmt=="America/New_York"? "GMT-4:00":gmt=="America/Los_Angeles"? "GMT-7:00":gmt=="America/Chicago"? "GMT-5:00":gmt=="America/Phoenix"?"GMT-7:00":
gmt=="America/Toronto"?"GMT-4:00":gmt=="America/Vancouver"?"GMT-7:00": gmt=="America/Argentina/Buenos_Aires"?"GMT-3:00": gmt=="America/El_Salvador" ?"GMT-6:00":
gmt=="America/Sao_Paulo"?"GMT-3:00": gmt=="America/Bogota"?"GMT-5:00":gmt=="Europe/Moscow"?"GMT+3:00": gmt=="Europe/Athens"?"GMT+3:00":
gmt=="Europe/Berlin" ?"GMT+2:00": gmt=="Europe/London"?"GMT+1:00": gmt=="Europe/Madrid"?"GMT+2:00": gmt=="Europe/Paris"?"GMT+2:00":gmt=="Europe/Warsaw"?"GMT+2:00":
gmt=="Australia/Sydney"?"GMT+11:00":gmt=="Australia/Brisbane"?"GMT+10:00":gmt=="Australia/Adelaide"?"GMT+10:30":gmt=="Australia/ACT"?"GMT+9:30":
gmt=="Asia/Almaty"?"GMT+6:00":gmt=="Asia/Ashkhabad"?"GMT+5:00":gmt=="Asia/Tokyo"?"GMT+9:00":gmt=="Asia/Taipei"?"GMT+8:00":gmt=="Asia/Singapore"?"GMT+8:00":
gmt=="Asia/Shanghai"?"GMT+8:00":gmt=="Asia/Seoul"?"GMT+9:00":gmt=="Asia/Tehran" ?"GMT+3:30":gmt=="Asia/Dubai" ?"GMT+4:00":gmt=="Asia/Kolkata"?"GMT+5:30":
gmt=="Asia/Hong_Kong"?"GMT+8:00":gmt=="Asia/Bangkok"?"GMT+7:00":gmt=="Pacific/Auckland"?"GMT+13:00":gmt=="Pacific/Chatham"?"GMT+13:45":gmt=="Pacific/Fakaofo" ?"GMT+13:00":
gmt=="Pacific/Honolulu"?"GMT-10:00": na
// Highlights the first bar of the new day.
isNewDay = timeframe.change("1D")
bgcolor(isNewDay ? color.new(color.green, 80) : na)
var s_high = 0.0
var s_low = 0.0
if (hour(time,select_gmt) ==h and minute(time,select_gmt) == m)
s_high:=high
s_low:=low
plot(s_high,style = plot.style_cross,color=color.green)
plot(s_low,style = plot.style_cross,color=color.red)
buy_cond=ta.crossover(close[2],s_high) and high[1]>high[2] and high>high[1]
sell_cond=ta.crossunder(close[2],s_low) and low[1]<low[2] and low<low[1]
plotshape(buy_cond,title = "Buy",style = shape.labelup,location = location.belowbar,color = color.green,text = "Buy",textcolor =color.white)
plotshape(sell_cond,title = "Sell",style = shape.labeldown,location = location.abovebar,color = color.red,text = "Sell",textcolor =color.white)
alertcondition(buy_cond,title = "Buy",message ="Buy Signal Formed")
alertcondition(sell_cond,title = "Sell",message ="Sell Signal Formed")