Zack_The_Lego

ZTLs Percentage-based Renko Emulator

Here is a version of my Renko script but with percentage-based Renko brick sizes instead of ATR or static brick sizes. This way, you can add dependable alerts that won't need to be adjusted due to fluctuating ATR values but also allows you move through different charts without having to adjust your Renko Brick-sizes for each ticker.

To use: The Renko size setting defaults to ".001" or 10 basis points. So ".01" is 1 percent or 100 basis points. This Renko Script is perfect for those that trade in a strictly percentage based style (instead of price levels).

The yellow lines are where the next brick will be drawn.

Enjoy!!

Zack_the_Lego

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//Zack_the_Lego
study("ZTLs % Renko Emulator", overlay = true)
res = input(.001, minval = .0001, maxval = .30, title = "Resolution of ATR")

BrickSize = close[1] * res
 
Brick1    =  high >
        nz(Brick1[1],close) + BrickSize ? nz(Brick1[1],close) + BrickSize : low <
                    nz(Brick1[1],close) - BrickSize ?
                        nz(Brick1[1],close) - BrickSize
                            : nz(Brick1[1],close)
                            
Brick2 = Brick1 != Brick1[1] ? Brick1[1] : nz(Brick2[1],close)

projected = Brick1> Brick2 ? BrickSize + Brick1: Brick1 - BrickSize
projected2 = Brick1 > Brick2 ? Brick2 - BrickSize : Brick2 + BrickSize
colorer = Brick1 > Brick1[2]  ? aqua: Brick1 < Brick1[2] ? red : gray

plot(projected, color = yellow)
plot(projected2, color = yellow)
p1=plot(Brick1, color = colorer, linewidth= 4, title = "Renko")
p2=plot(Brick2, color = colorer, linewidth= 4, title = "Renko")
fill(p1,p2, color = purple, transp= 50)