Skip to content

Commit

Permalink
Create #20-尋找高低點3.pine
Browse files Browse the repository at this point in the history
  • Loading branch information
TaichiS authored Jun 25, 2021
1 parent 77562bd commit 7e28838
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions #20-尋找高低點3.pine
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//@version=4
study("教學:尋找高低點3", overlay=true)

// 尋找高低點3:調整成可隨意變更初始數值
// highest、lowest的使用,但是讓使用者可以自行變更初始值

barnum = input(title="左右K棒數", defval=4, type=input.integer, minval=2)
cond = high[barnum] == highest(high, barnum*2+1)

//plotchar(cond, char="*", text="H", offset=-barnum) // 在當前這根確認條件,則最高點必須往前4根

if cond
labelh = label.new(x=bar_index-barnum, y=na, text="H",
size=size.normal, color=#EEEEEE, textcolor=color.red, yloc=yloc.abovebar,
style=label.style_label_down
)

0 comments on commit 7e28838

Please sign in to comment.