پییوٹ پوائنٹس اعلی کم ملٹی ٹائم فریم

مصنف:چاؤ ژانگ، تاریخ: 2022-05-16 15:12:10
ٹیگز:محور

ہیلو سب،

پبلک لائبریری میں بلٹ ان اور شائع شدہ پییوٹ پوائنٹ ہائی لو اشارے موجود ہیں لیکن جہاں تک میں دیکھتا ہوں ان میں سے کوئی بھی اعلی ٹائم فریم کے لئے نہیں ہے۔ لہذا میں نے اس اسکرپٹ کو لکھنے اور شائع کرنے کا فیصلہ کیا۔ مجھے امید ہے کہ یہ آپ کی اپنی اسکرپٹس کی تجارت یا ترقی کرتے وقت مفید ثابت ہوگا۔ میں نے یہ بھی اپنے مستقبل کے منصوبوں میں سے ایک میں استعمال کرنے کے لئے کیا (ہم اسے کچھ ہفتوں / مہینوں میں دیکھیں گے) ۔

میں نے تمام ترتیبات اختیاری بنانے کی کوشش کی، تاکہ آپ ان کے ساتھ اپنی مرضی کے مطابق کھیل سکتے ہیں.

نوٹ: اگر چارٹ کا ٹائم فریم آپشنز کے ٹائم فریم سے کم ہو تو کوئی کنٹرول میکانزم نہیں ہے۔ لہذا آپ کو چارٹ ٹائم فریم سے زیادہ ٹائم فریم آپشنز میں سیٹ کرنا بہتر ہے۔

لطف اٹھائیں!

بیک ٹسٹ

img


/*backtest
start: 2022-05-08 00:00:00
end: 2022-05-14 23:59:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © LonesomeTheBlue

//@version=5
indicator("Pivot Points High Low Multi Time Frame", overlay = true, max_lines_count = 500, max_labels_count = 500)
timeframe = input.timeframe(defval = '240')
leftBars  = input.int(defval = 2, title = "Left Bars", minval = 1)
rightBars  = input.int(defval = 2, title = "Right Bars", minval = 1)
phlinecol = input(defval = color.lime, title = "Pivot High/Low Line Colors", inline = "lc")
pllinecol = input(defval = color.red, title = "", inline = "lc")
phbgcol = input(defval = color.lime, title = "Pivot High BG/Text Colors", inline = "ph")
phtextcol = input(defval = color.black, title = "", inline = "ph")
plbgcol = input(defval = color.red, title = "Pivot Low BG/Text Colors", inline = "pl")
pltextcol = input(defval = color.white, title = "", inline = "pl")

get_phpl()=>
    float ph = ta.pivothigh(leftBars, rightBars)
    float pl = ta.pivotlow(leftBars, rightBars)
    phtimestart = ph ? time[rightBars] : na
    phtimeend = ph ? time[rightBars - 1] : na
    pltimestart = pl ? time[rightBars] : na
    pltimeend = pl ? time[rightBars - 1] : na

    [ph, phtimestart, phtimeend, pl, pltimestart, pltimeend]

// get if there if Pivot High/low and their start/end times
[ph, phtimestart, phtimeend, pl, pltimestart, pltimeend] = request.security(syminfo.tickerid, timeframe, get_phpl(), lookahead = barmerge.lookahead_on)

// keep time of each bars, this is used for lines/labels
var mytime = array.new_int(0)
array.unshift(mytime, time)

// calculate end of the line/time for pivot high/low
bhend = array.get(mytime, math.min(array.indexof(mytime, phtimeend) + 1, array.size(mytime) - 1))
blend = array.get(mytime, math.min(array.indexof(mytime, pltimeend) + 1, array.size(mytime) - 1))

// to draw once
float pivothigh = na(ph[1]) and ph ? ph : na
float pivotlow  = na(pl[1]) and pl ? pl : na
    

if not na(pivothigh)
    strategy.entry("Enter Long", strategy.long)
else if not na(pivotlow)
    strategy.entry("Enter Short", strategy.short)

متعلقہ

مزید