Login Page - Create Account

Support Board


Date/Time: Mon, 23 Dec 2024 19:29:45 +0000



Post From: ACSIL: accessing the DailyChange (DChg)

[2015-10-05 22:01:31]
User44052 - Posts: 34
Thanks for the suggestions. This is how I ended up doing this:

  float myDailyChange;

  float myOpen, myHigh, myLow;
  float previousDayClose;
  
  SCDateTime todaysDate = sc.BaseDateTimeIn[sc.Index].GetDate();
  SCDateTime previousTradingDay;

  if (todaysDate.GetDayOfWeek() == MONDAY)
  {
    previousTradingDay = todaysDate - 3;
  }
  else
  {
    previousTradingDay = todaysDate - 1;
  }

  sc.GetOHLCForDate(previousTradingDay, myOpen, myHigh, myLow, previousDayClose);

  myDailyChange = sc.Close[sc.Index] - previousDayClose;