Login Page - Create Account

Support Board


Date/Time: Thu, 18 Apr 2024 23:43:53 +0000



Post From: sc.GetBarHasClosedStatus from another chart different time frame ACSIL

[2023-03-25 12:28:17]
User725043 - Posts: 29
1) Per:

Referencing Other Time Frames and Symbols When Using the ACSIL: Referencing Data from Other Time Frames By Direct Referencing of the Other Timeframe

loaded the reference chart base graph data by:

// Define a graph data object to get all of the base graph data
SCGraphData BaseGraphData;

// Get the base graph data from the specified chart
sc.GetChartBaseData(ChartNumber.GetInt(), BaseGraphData);

2) In trying to set a call to sc.GetChartBaseData using sc.GetBarHasClosedStatus get error in Visual Studio saying not a member.

3) Looking at sierrachart.h it appears that sc.GetBarHasClosedStatus is set to an integer:

/*========================================================================

  BHCS_BAR_HAS_CLOSED: Element at BarIndex has closed.

  BHCS_BAR_HAS_NOT_CLOSED: Element at BarIndex has not closed.

  BHCS_SET_DEFAULTS: Configuration and defaults are being set. Allow your SetDefaults code block to run.
  ------------------------------------------------------------------------*/

  int GetBarHasClosedStatus()
  {
    return GetBarHasClosedStatus(Index);
  }

  int GetBarHasClosedStatus(int BarIndex)
  {
    if (SetDefaults)
      return BHCS_SET_DEFAULTS;

    if (BarIndex != ArraySize - 1)
      return BHCS_BAR_HAS_CLOSED;
    else
      return BHCS_BAR_HAS_NOT_CLOSED;
  }


4) set up an int variable in the reference chart and realized this that sc.GetBarHasClosedStatus is setting to 2 or 3 in the reference chart. tried to pass that as a subgraph to the main chart where the automated trading study via ACSIL is, using both Study Overlay/Price and sc.GetStudyArraysFromChartUsingID, but was unsuccessful backtesting in Replay -> All Charts In Chartbook, getting that to work.

5) Can you please provide where the data for sc.GetBarHasClosedStatus is being stored in Sierra Chart and what is the way to use ACSIL to access it?

6) Alternatively can you please create a sc.GetBarHasClosedStatusForChart function similar to the sc.GetBarPeriodParametersForChart discussed here? :

Chart Bar Period Parameters for a Referenced Chart