Change color of 9:30 Bar


Category:
0
0

To make things easier for me to testa strategies i want to highlight every 930 am bar with a different color or a symbol of some sort identifying the 930 am bar.How would i go about doing that?

Marked as spam
Posted by (Questions: 2, Answers: 6)
Asked on January 26, 2018 1:51 pm
132 views
0
Private answer

Give this a shot:

input targetTime = 900;
def secondsTillTargetTime = SecondsTillTime(targetTime);
def targetBar = secondsTillTargetTime == 0;
AssignPriceColor(if targetBar then Color.GRAY else Color.CURRENT);

I haven’t tested it. Just borrowed some code from another post and reconfigured it. The chart must be set to a time based aggregation period. Furthermore that aggregation period must end in a zero. Otherwise you will have to adjust the input value for targetTime.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 26, 2018 3:08 pm