Kurbelklaus

KK_Traders Dynamic Index_Bar Highlighting

Hey guys,

this is one of my favorite scripts as it represents a whole trading system that has given me very good results!
I have only used it on Bitcoin so far but I am sure it will also work for other instruments.

The original code to this was created by LazyBear, so all props to him for this great script!
I have linked his original post down below.

You can find the full rules to the system in this PDF (which has also been taken from LBs post):
www.forexmt4.com/_MT...s Dynamics/TDI_1.pdf

Here is a short summary of the rules:
Go long when (all conditions have to be met):
  • The green line is above 50
  • The green line is above the red line
  • The green line is above the orange line
  • The close is above the upper Band of the Price Action Channel
  • The candles close is above its open
  • (The green line is below 68)

Go short when (all conditions have to be met):
  • The green line is below 50
  • The green line is below the red line
  • The green line is below the orange line
  • The close is below the lower band of the Price Action Channel
  • The candles close is below its open
  • (The green line is above 32)

Close when:
  • Any of these conditions aren't true anymore.

I have marked two of the rules in brackets as they seem to cut out a lot of the profits this system generates. You can choose to still use these rules by checking the box that says "Use Original Ruleset" in the options.

The system also contains rules regarding the Heiken Ashi bars. However these aren't as specific as the other rules. This is where your personal judgement comes in and this part is hard to explain. Take a look at the PDF I have linked to get a better understanding.

So far, this is just the TDI trading system and LBs script, now what have I changed?
I have incorporated the Price Action Channel to the system and changed it so that it highlights the bars whenever the system is giving a signal. As long as the bars are green the system is giving a long signal, as long as they are red the system is giving a short signal. Keep in mind that this doesn't consider the bar size of the HA bars. I recommend coloring all bars grey via the chart settings in order to be able to see the bar highlighting properly.
I have also published the Price Action Channel seperately in case some of you wish to view the Channel.

I am fairly new to creating scripts so use it with caution and let me know what you think!

LBs original post:
The seperate Price Action Channel script:
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//
// @author LazyBear
// If you use this code in its orignal/modified form, do drop me a note. 
// 
//modified by Kurbelklaus
study("KK_Traders Dynamic Index_Bar Highlighting", shorttitle="KK_TDI_BH")
lengthrsi=input(13)
src=close
lengthband=input(34)
lengthrsipl=input(2)
lengthtradesl=input(7)
lenH = input(5, minval=1, title="PAC Length High")
lenL = input(5, minval=1, title="PAC Length Low")
Ruleset=input(false,title="Use original Ruleset")

r=rsi(src, lengthrsi)
ma=sma(r,lengthband)
offs=(1.6185 * stdev(r, lengthband))
up=ma+offs
dn=ma-offs
mid=(up+dn)/2
mab=sma(r, lengthrsipl)
mbb=sma(r, lengthtradesl)

hline(32)
hline(50)
hline(68)
upl=plot(up, color=blue)
dnl=plot(dn, color=blue)
midl=plot(mid, color=orange, linewidth=2)
fill(upl,midl, red, transp=90)
fill(midl, dnl, green, transp=90)
plot(mab, color=green, linewidth=2)
plot(mbb, color=red, linewidth=2)

// Bar - Highlighting, TDI TS
    // PAC
srcH = high
srcL = low
smmaH = na(smmaH[1]) ? sma(srcH, lenH) : (smmaH[1] * (lenH - 1) + srcH) / lenH
smmaL = na(smmaL[1]) ? sma(srcL, lenL) : (smmaL[1] * (lenL - 1) + srcL) / lenL
    //

long= Ruleset ? mab > mbb and mab > mid and mab > 50 and mab < 68 and close > smmaH and close > open : mab > mbb and mab > mid and mab > 50 and close > smmaH and close > open
short= Ruleset ? mab < mbb and mab < mid and mab < 50 and mab > 32 and close < smmaL and open > close : mab < mbb and mab < mid and mab < 50 and close < smmaL and open > close

barcolor(long ? green : na)
barcolor(short ? red : na)
//