• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Indicator to count price from cash session open


New member
Is there any indicator to count a stock price from cash open. Starting from 0 ignoring the premarket action.
Example : A stock opens at 157 which is already up 3 dollars from previous close. I'd like to have indicator which counts the open from 157 after cash session open ignoring the pre market action 3 dollars. If the price goes up 158 the indicator should show +1 dollar or -1 dollar if the price goes to 156


Well-known member
@sasank Do you mean something like this?
def c = close(period = aggregationperiod.day);
def o = open(period = aggregationperiod.day);
def data = c - o;

         if c > o then color.green
         else if c == o then color.gray
         else color.red);

Similar threads