Login Page - Create Account

Support Board


Date/Time: Mon, 28 Oct 2024 08:57:40 +0000



Changes to Chart Settings > Chart Data > Dates to Exclude ignored

View Count: 132

[2024-09-09 00:24:07]
Mark Lewis - Posts: 25
I'm using sc.AddDateToExclude() in my custom study. It successfully adds a date to Dates to Exclude but it is ignored. I have tried using sc.FlagToReloadChartData = 1 and opened Chart Settings > Chart Data > Dates to Exclude directly to apply settings. The only way the date is excluded from the data is if I make a change directly in settings. Perhaps the setting is cached causing the additions via ACSIL to be ignored?

Here is the code that successfully adds the date to the Chart Settings > Chart Data > Dates to Exclude. The code works, but the information is not used.


  if (sc.MenuEventID != 0)
  {
    if (sc.MenuEventID == r_ExcludeDateMenuID)
    {
      SCDateTime SelectedTPODateTime = sc.BaseDateTimeIn[sc.ActiveToolIndex];  

      sc.AddDateToExclude(ChartNumber, SelectedTPODateTime);

      sc.FlagToReloadChartData = 1;
    }

    if (sc.MenuEventID == r_ClearExcludedDatesMenuID)
    {
      sc.DatesToExcludeClear(ChartNumber);

      sc.FlagToReloadChartData = 1;
    }
  }


Thank you for looking into this!
Date Time Of Last Edit: 2024-09-09 00:26:46
[2024-09-09 02:16:30]
Sierra_Chart Engineering - Posts: 16755
We will solve this.



Update: we need more time to look into this because it does not look to us there is a problem.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-09-09 13:39:56
[2024-09-09 19:00:25]
Mark Lewis - Posts: 25
Update: we need more time to look into this because it does not look to us there is a problem.

To clarify, I'm trying to accomplish this on a chart accompanied by the built-in TPO Profile Chart study. I have isolated the code to the following study and can reproduce the problem consistently on my end.

Thanks again for looking into this!


#include "sierrachart.h"

SCDLLName("TPO Test")

/*==========================================================================*/
SCSFExport scsf_TPOTest(SCStudyInterfaceRef sc)
{
  // Set configuration variables  
  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "TPO Test";

    sc.GraphRegion = 0;
sc.AutoLoop = 0;

    return;
  }

  int& r_ExcludeDateMenuID = sc.GetPersistentInt(1);
  int& r_ClearExcludedDatesMenuID = sc.GetPersistentInt(2);

  if (sc.IsFullRecalculation != 0)
  {
    if (r_ExcludeDateMenuID <= 0)
    {
      r_ExcludeDateMenuID = sc.AddACSChartShortcutMenuItem(sc.ChartNumber, "Add date to exclude list");
      r_ClearExcludedDatesMenuID = sc.AddACSChartShortcutMenuItem(sc.ChartNumber, "Clear excluded dates");
    }
  }

if (sc.MenuEventID != 0)
  {
    if (sc.MenuEventID == r_ExcludeDateMenuID)
    {
      SCDateTime SelectedTPODateTime = sc.BaseDateTimeIn[sc.ActiveToolIndex];  

      sc.AddDateToExclude(sc.ChartNumber, SelectedTPODateTime);

      sc.FlagToReloadChartData = 1;
    }

    if (sc.MenuEventID == r_ClearExcludedDatesMenuID)
    {
      sc.DatesToExcludeClear(sc.ChartNumber);

      sc.FlagToReloadChartData = 1;
    }
  }
}

[2024-10-11 18:30:38]
Sierra_Chart Engineering - Posts: 16755
The problem is this date-time has a small time component:
SCDateTime SelectedTPODateTime = sc.BaseDateTimeIn[sc.ActiveToolIndex];


That needs to be removed like this:
SCDateTime SelectedTPODateTime = sc.BaseDateTimeIn[sc.ActiveToolIndex].GetDateAsSCDateTime();

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-10-11 18:30:59

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account