Author Topic: Get previous day's closing price of an index?  (Read 5591 times)

PrimusUser

  • Guest
Get previous day's closing price of an index?
« on: June 08, 2017, 02:23:13 am »
If I want to get the previous session's close price of an index should I use

IndexClosePrice('.SPX', P1)

or

IndexClosePrice('.SPX', CURRENT)

Will they give the same value or what's the difference between these?

17mako

  • Administrator
  • Newbie
  • *****
  • Posts: 3
    • View Profile
Re: Get previous day's closing price of an index?
« Reply #1 on: June 09, 2017, 07:02:46 am »
You will notice when you pull up IndexClosePrice, the default is P1 which refers to yesterdays close.  Current would refer to the existing day and likely return a value of zero.  Basically P1 is the one to use.

Try using RefStockNumericValue('SPY', numeric_expression)  and replacing numeric_expression with AdjustedClosePrice(P1)

Often ETF's work better for reference than the indexes but try both if you'd like and see what you prefer. 

I can be reached at hbeall@primustrade.com should you need anything further.