I am looking to do a show bar when true. I have modified the code below but it is not working – I want to know whether anytime in the last 50 days whether there was a 365 day high – True or false.
Further to the below the calculation should be satisfied across month, week and day charts when assessing whether the 365 day high was in the last 50 days (ie the requirement is 50 days not 50 bars). I hope that makes sense. Coding is below.
I have attached a chart using the coding. The green star at the top is the criteria but it is showing more than 1 star for the weekly and monthly charts. How do I get it to show just 1 star above the relevant bar (in each of the daily, weekly and monthly charts)?
It’s because the V1 and V2 variables are loading daily data in a weekly chart, so you can have 5 true results within a weekly bar (and 20+ in a monthly), hence the duplication.
Change V1 and V2 to the following, and it will look back a year no matter the timeframe of the chart, instead of data for 365 calendar days.
The formula results are still not working the way it is intended to work. Please see attached chart - if you scroll to the very start of the chart there are green stars when there are no red stars. I basically am trying to achieve a green star where a red star has appeared provided it is within 80 days of the red star occurring (and this should apply for daily, weekly and monthly charts accordingly). I have tried all types of combinations of codes and if functions but cannot get it to work.
Can you please have a look at it and let me know what is wrong with the formula please.
It’s because a value of zero is being returned at the very start, which passes the criteria of V3 (less than or equal to 80). You need to adjust that variable so that 0 is also excluded.