Zack_The_Lego

Flex Renko Emulator

update:
As far as my algorithm design will take me this is it. So It's complete in my eyes. Here is a "working" version of something I've been looking for for a long time: "Flex" Renko Charting.
Bricks' sizes are determined by ATR and are set by simply choosing a resolution for the ATR calculation. No need to go in and choose renko granulation(resolution) AND brick size. Renko granulation is current chart resolution. Feel free to send me feedback on how to manage the reversal bricks' calculation or any other thoughts and ideas.

Replace the "close" in the main body of the renko calculation with 'high' and 'low' to get more consistent paintings across different aggregations since renkos aren't technically based off closing prices but where the price has been. Of course it's all a matter of preference:
Brick1 = high >
nz(Brick1) + BrickSize ? nz(Brick1) + BrickSize : low <
nz(Brick1) - BrickSize ?
nz(Brick1) - BrickSize
: nz(Brick1)


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

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

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

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

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//Zack_the_Lego
study("Flex Renko Emulator", overlay = true)
res = input(type=resolution, defval = "D", title = "Resolution of ATR")
xATR = atr(14)
//TF = x78tf ? "78" : "39"
BrickSize = security(tickerid,res, xATR)

Brick1    =  close >
        nz(Brick1[1]) + BrickSize ? nz(Brick1[1]) + BrickSize : close <
                    nz(Brick1[1]) - BrickSize ?
                        nz(Brick1[1]) - BrickSize
                            : nz(Brick1[1])
                            
Brick2 = Brick1 != Brick1[1] ? Brick1[1] : nz(Brick2[1])
colorer = Brick1 > Brick2 ? green:red
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)