Hi – I am completely new to programming and I have a very simple request. I am trying to write code that will create an alert when a doji candle, on a given timeframe, is closed. Let’s say the criterium is body <= 5% of the range. Would be very grateful if anyone can help. Thanks.
Hi! here you have the code.
body=abs(open-close)
doji=body<=range*0.05
return doji
Next step, configure an alert.
Hi Iván – thank you very much for your help with this. I’ve loaded the code ok as a new indicator. I’ve set up an Alarm which I’ve configured to go off each time. I get an alarm notification when I hit Create/Modify Alerts but non when qualifying dojis form. Just wondered if you have any advice. I have attached the Alarm setting. Many thanks.
Please ignore my last message it’s now working fine, I had the alert set incorrectly. Thanks again for your help!