Renko Bars Alert


0
0

Hi Pete,

I am wondering if there is a way to create an alert for when a new renko bar is form? I found the following thinkscript that shows renko bars on a time based chart, yet regardless, the alert should work regardless of chart type. I recognize that a person could create this alert manually simply by creating an alert above/below the current renko then adding/subtracting the brick size. Yet like I said, I am wondering if there is a way to automate this?

# Renko_R1V2
# Written by KumoBob aka Bob Campbell
# http://fibonacci-financial.blogspot.com/

# R1V1 2010.06.22:21:17
# R1V1 2011.08.20:08:30
# Added Hint about the input value for BrickSize

input BrickSize = 0.5000; # <<<< Feel free to edit the default value.

#Hint BrickSize: This value will vary widely depending on the time period of the chart and the instrument you are charting. \nPlay with this number until you find what you want. \nFeel free to edit the default value. \nSomething in between 0.0001 to 100.00 should work

rec Mortar = compoundValue(1, if Close >
Mortar[1] + BrickSize then
Mortar[1] + BrickSize
else if Close <
Mortar[1] – BrickSize then
Mortar[1] – BrickSize
else Mortar[1] , Close);

plot bricks = Mortar;
rec Stack = If Mortar != Mortar[1] then Mortar[1] else Stack[1];
plot Renko = Stack;
Addcloud( Bricks,Renko);

 

 

RESOLVED
Marked as spam
Posted by (Questions: 15, Answers: 23)
Asked on December 23, 2019 4:30 am
550 views
0
Thanks Pete! That works.
( at December 23, 2019 5:18 pm)
0
Private answer

The code uses recursion so we cannot apply this to a Study Alert or a Conditional Order.

If you want to generate sms/email notifications from the this that leaves only the custom scan. Modify the following lines of code (retain the rest of the code as it is):

plot bricks = Mortar;
rec Stack = If Mortar != Mortar[1] then Mortar[1] else Stack[1];
plot Renko = Stack;
Addcloud( Bricks,Renko);

The following modifications convert those lines of code to work as a scan

def bricks = Mortar;
rec Stack = If Mortar != Mortar[1] then Mortar[1] else Stack[1];
def Renko = Stack;
plot scan = mortar <> mortar[1];

If you simply what to add an audible alert to the chart study:

Then you don't change any lines of code but simply add this one to the bottom of the code.

Alert(mortar <> mortar[1], "New Brick", Alert.BAR, Sound.RING);

Marked as spam
Posted by (Questions: 37, Answers: 4089)
Answered on December 23, 2019 8:19 am