ترسیم یک روند از قسمت پایین قبلی تا آخرین قسمت پایین

ساخت وبلاگ

enter image description here

لطفاً در زیر اسکریپت و تصویر ، به عنوان نمونه ، برای اوج های بالاتر و پایین ترین سطح پایین مشاهده کنید. متغیر برای پایین تر: "_lh" است. در نمودار ، می توانیم اوج های پایین را فقط پس از 5 میله (افست = -5) نشان دهیم که خوب است. من نمی دانم که چگونه می توان یک روند را از پایین پایین قبلی تا آخرین قسمت پایین (با افست = -5) که تازه اتفاق افتاده است ترسیم کنید و وقتی قیمت از بالا می رود ، هشدار برای آن اضافه کنید؟من می دانم که من باید از fonction ساختم استفاده کنم. متشکرم

//@version=5 indicator("Lower Low trendlines", shorttitle = "Lower Low trendlines", overlay=true) ////////////////////////////////////////////////// ////////////// HIGHER HIGH LOWER LOW ///////////// ////////////////////////////////////////////////// // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © LonesomeThecolor.blue //@version=5 //indicator('Higher High Lower Low Strategy', overlay=true, max_lines_count=500) lb = input.int(5, title='Left Bars', minval=1, group="Higher High Lower Low") rb = input.int(5, title='Right Bars', minval=1, group="Higher High Lower Low") //showsupres = input.bool(true, title='Support/Resistance', inline='srcol', group="Higher High Lower Low") showsup = input.bool(true, title="Support only", inline="srcol_sup", group="Higher High Lower Low") showres = input.bool(true, title="Resistance only", inline="srcol_res", group="Higher High Lower Low") supcol = input.color(color.lime, title='', inline="srcol_sup", group="Higher High Lower Low") rescol = input.color(color.red, title='', inline="srcol_res", group="Higher High Lower Low") srlinestyle = input.string(line.style_dotted, title='Line Style/Width', options=[line.style_solid, line.style_dashed, line.style_dotted], inline='style', group="Higher High Lower Low") srlinewidth = input.int(3, title='', minval=1, maxval=5, inline='style', group="Higher High Lower Low") //changebarcol = input.bool(true, title='Change Bar Color', inline='bcol', group="Higher High Lower Low") //bcolup = input.color(color.blue, title='', inline='bcol', group="Higher High Lower Low") //bcoldn = input.color(color.black, title='', inline='bcol', group="Higher High Lower Low") ph = ta.pivothigh(lb, rb) pl = ta.pivotlow(lb, rb) iff_1 = pl ? -1 : na // Trend direction hl = ph ? 1 : iff_1 iff_2 = pl ? pl : na // similar to zigzag but may have multiple highs/lows zz = ph ? ph : iff_2 valuewhen_1 = ta.valuewhen(hl, hl, 1) valuewhen_2 = ta.valuewhen(zz, zz, 1) zz := pl and hl == -1 and valuewhen_1 == -1 and pl>ارزش WHEN_2؟NA: ZZ ValueWHEN_3 = TA. ValueWhen (HL ، HL ، 1) ValueWhen_4 = ta. valuewhen (ZZ ، ZZ ، 1) ZZ: = pH و HL == 1 و ValueWhen_3 == 1 و pHارزش WHEN_6؟NA: HL ValueWhen_7 = ta. valuewhen (HL ، HL ، 1) ValueWhen_8 = ta. valuewhen (ZZ ، ZZ ، 1) HL: = HL == 1 و ValueWhen_7 == -1 و ZZ// finds previous three points (b, c, d, e) ehl = hl == 1 ? -1 : 1 loc1 = 0.0 loc2 = 0.0 loc3 = 0.0 loc4 = 0.0 xx = 0 for x = 1 to 1000 by 1 if hl[x] == ehl and not na(zz[x]) loc1 := zz[x] xx := x + 1 break ehl := hl for x = xx to 1000 by 1 if hl[x] == ehl and not na(zz[x]) loc2 := zz[x] xx := x + 1 break ehl := hl == 1 ? -1 : 1 for x = xx to 1000 by 1 if hl[x] == ehl and not na(zz[x]) loc3 := zz[x] xx := x + 1 break ehl := hl for x = xx to 1000 by 1 if hl[x] == ehl and not na(zz[x]) loc4 := zz[x] break [loc1, loc2, loc3, loc4] float a = na float b = na float c = na float d = na float e = na if not na(hl) [loc1, loc2, loc3, loc4] = findprevious() a := zz b := loc1 c := loc2 d := loc3 e := loc4 e _hh = zz and a> b and a> c and c> b and c>D _ll = zz و a= c and b> c and b> d and d> c and d>e یا aج و بد) طرح ریزی (_hl ، text = 'hl' ، عنوان = 'LIFT HIGHT' ، style = shape. labelup ، color = color. new (color. lime ، 0) ، textColor = color. new (color. black ، 0)، مکان = مکان. belowbar ، افست = -rb) plotshape (_hh ، text = 'hh' ، عنوان = 'Higher High' ، style = shape. labeldown ، color = color. new (color. lime ، 0) ، textColor =color. new (color. black ، 0) ، location = location. abovebar ، Offset = -rb) plotshape (_ll ، text = 'll' ، عنوان = 'پایین پایین' ، سبک = شکل. labelup ، color = color. new..= شکلres: = _lh؟zz: res [1] sup: = _hl؟zz: sup [1] int trend = na iff_3 = بستنres؟1: iff_3 res: = trend == 1 و _hh یا trend == -1 و _lh؟zz: res sup: = trend == 1 و _hl یا trend == -1 و _ll؟zz: sup rechange = res! = res [1] supange = sup! = sup [1] var line resline = na var line supline = na // اگر showsupres // اگر rechange // line. set_x2 (resline ، bar_index) // line. set_extend (resline ، extend = extend. none) // resline: = line. new (x1 = bar_index - rb ، y1 = res ، x2 = bar_index ، y2 = res ، color = rescol ، extend = extend. right ،style = srlinestyle ، width = srlinewidth) // resline // // اگر suchange // ine. set_x2 (supline ، bar_index) // line. set_extend (supline ، extend = extend. none) // supline: = line. new (x1 = bar_index - rb ، y1 = sup ، x2 = bar_index ، y2 = sup ، color = supcol ، extend = extend. right ، style = srlinestyle ، width = srlinewidth) // supline اگر نشان می دهد اگر خط rechange. set_x2 (resline ، bar_index) line. set_extend (resline ، extend = extend. none) resline: = line. new (x1 = bar_index - rb ، y1 = res ، x2 = bar_index ، y2 = res ، color = rescol ، extend = extend. right ، style =srlinestyle ، width = srlinewidth) resline در صورت نمایش اگر lineange line. set_x2 (supline ، bar_index) line. set_extend (supline ، extend. none) supline: = line. new (x1 = bar_index - rb ، y1 = sup ، x2 =bar_index ، y2 = sup ، color = supcol ، extend = extend. right ، style = srlinestyle ، width = srlinewidth) supline // iff_4 = trend == 1؟ 
حساب اسلامي...
ما را در سایت حساب اسلامي دنبال می کنید

برچسب : نویسنده : کامران فیوضات بازدید : <-PostHit-> تاريخ : چهارشنبه 3 خرداد 1402 ساعت: 20:16