चंदे क्रॉल स्टॉप

लेखक:चाओझांग, दिनांकः 2022-05-09 17:05:34
टैगःआरएमए

प्रिय टेलीविजन दर्शकों,

यहाँ एक स्क्रिप्ट है जहां मैंने एक सरल रणनीति बनाई है जो कि कम मूल्यवान चंडे क्रॉल स्टॉप इंडिकेटर का उपयोग करती है। शॉर्ट सिग्नल तब होता है जब बंद नारंगी रेखा के नीचे पार होता है और एक लंबा सिग्नल नीली रेखा के बंद मोमबत्ती के क्रॉसओवर पर उत्पन्न होता है। इसके अतिरिक्त आपके पास एडीएक्स का उपयोग करके फ़िल्टर करने का विकल्प है ताकि एक चंचल बाजार में कम से कम प्राप्त हो सके।

सौदेबाजी में शुभकामनाएँ!

बैकटेस्ट

img


//@version=5
strategy(title = "Chande Kroll Stop", overlay=true)
p = input.int(10, minval=1)
x = input.int(1, minval=1)
q = input.int(9, minval=1)
first_high_stop = ta.highest(high, p) - x * ta.atr(p)
first_low_stop = ta.lowest(low, p) + x * ta.atr(p)
stop_short = ta.highest(first_high_stop, q)
stop_long = ta.lowest(first_low_stop, q)
plot(stop_long, color=color.blue)
plot(stop_short, color=color.orange)

adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
ADX_sig = input.int(20, title="minimum ADX threshold for signal")
dirmov(len) =>
	up = ta.change(high)
	down = -ta.change(low)
	plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
	minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
	truerange = ta.rma(ta.tr, len)
	plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
	minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
	[plus, minus]
adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)


if ta.crossunder(close, stop_long) and sig>ADX_sig
    strategy.entry("long", strategy.long)
if ta.crossover(close, stop_short) and sig>ADX_sig
    strategy.entry("short", strategy.short)

संबंधित

अधिक