I am trying to develop an indicator like the TTM trend anchor (http://www.tradethemarkets.com/products/item294.cfm). The idea is look at say a daily chart with a heiken ashi and link it to a weekly timeframe. If both the daily and weekly bars are blues, then the indicator is blue, if both are red, the indicator is red, and if one is blue and one is red, the indicator is grey (neutral). This is shown in the attachment. All is going well until I hit the weekly bar of 16/6/12 on AUDUSD as shown in the attachement. I have a blue weekly bar and 5 blue daily bars, but the indicator is grey.
I have used the print command to get the order of calculations, and everything seems to line up so I am very confused. Code is attached. Call up 2 charts of AUDUSD, one weekly, one daily with heiken ashi on both. Apply the indicator to the daily chart and look at the weekly bar for 16/6/12 and the corresponding 5 daily bars.
Any help appreciated.
Comment