Login Page - Create Account

Support Board


Date/Time: Sat, 28 Dec 2024 09:17:37 +0000



sc.OpenChartOrGetChartReference

View Count: 1167

[2016-04-20 20:11:22]
User99735 - Posts: 234
Hi,
I am using function sc.OpenChartOrGetChartReference to open charts from a strategy. If I open more than 10 charts, get an error message
"Caught an unhandled exception in c_MainMDIWindow::WindowProc. Message: 273, wParam: 32787, lParam: 0"

Is there a restriction of 10 charts which can be opened from a strategy? If not how to avoid this error?

Regards

Vivek
[2016-04-20 20:26:57]
Sierra Chart Engineering - Posts: 104368
There are no restrictions within Sierra Chart. But how many charts in total are open at the time?


This is going to be due to an error at the operating system due to limitations there which is causing an exception. Also once you encounter this, the Sierra Chart process has become unstable and has to be restarted.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-04-20 20:35:12]
Sierra Chart Engineering - Posts: 104368
There are ways of managing this kind of problem and we do plan to implement a solution but we want to get more information.

What we need to know is how many charts in total are currently open at the time this occurs?
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-04-20 20:37:07]
User99735 - Posts: 234
Hi,
There were 20 charts open at time, and the 10 charts which were opened from the strategy, most of them would already be open.

Regards

Vivek
[2016-04-20 21:07:10]
Sierra Chart Engineering - Posts: 104368
That should not be a problem at all.

Post the block of code that you are using to open those charts and we will test it.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-04-20 21:09:44]
User99735 - Posts: 234

void LoadChartsFunc(SCStudyGraphRef sc, int CALLPUT, int index, char* OptionName)
{
  s_ACSOpenChartParameters OpenChartParameters;
  OpenChartParameters.ChartDataType = INTRADAY_DATA; //This can also be set to: DAILY_DATA
  OpenChartParameters.Symbol = OptionName;//When want to use the symbol of the chart the study function is on, use sc.GetRealTimeSymbol()
  OpenChartParameters.IntradayBarPeriodType = IBPT_DAYS_MINS_SECS;
  OpenChartParameters.IntradayBarPeriodLength = SECONDS_PER_MINUTE; // 30 minutes
  OpenChartParameters.DaysToLoad = 0;//same as calling chart

  OpenChartParameters.PriorChartNumber = 0;


  sc.OpenChartOrGetChartReference(OpenChartParameters);

}

void LoadCharts(SCStudyGraphRef sc)
{
  char OptionName[100];
  int lowPrice = (int)(round(sc.BaseData[SC_LAST][sc.Index]) - OPTIONCHARTCOUNT / 2);
  int highPrice = lowPrice + OPTIONCHARTCOUNT;
  int index = 0;
  for (int price = lowPrice; price < highPrice; price++)
  {
    for (int CALLPUT = 0; CALLPUT < 2; CALLPUT++)
    {
      strcpy(OptionName, sc.Symbol);
      strcat(OptionName, "-OPT-");
      char temp[32];
      sprintf(temp, "%i", PermData->NextFridayInt);
      strcat(OptionName, temp);
      strcat(OptionName, "-");
      sprintf(temp, "%i", price);
      strcat(OptionName, temp);
      if (CALLPUT == CALL)
        strcat(OptionName, "-C");
      else
        strcat(OptionName, "-P");
      strcat(OptionName, OptionSuffix);

      LoadChartsFunc(sc, CALLPUT, index, OptionName);
    }
    index++;
  }
}


[2016-04-23 23:50:49]
User99735 - Posts: 234
Hi,
Can you provide a time line for the fix to the above mentioned issue?

Regards

Vivek
[2016-04-24 00:33:58]
Sierra Chart Engineering - Posts: 104368
We have not yet tested this. We are putting together a test procedure for opening a large number of charts using the sc.OpenChartOrGetChartReference function.

Also, it is doubtful there is anything that has to be fixed. We would be surprised to even encounter the problem. We are going to be running a test in the next hour.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-04-24 01:16:01]
Sierra Chart Engineering - Posts: 104368
We tested opening 100 charts during a single study function call and there were no exceptions and no problems. It all worked perfectly.

Here is the test function. Test it on your side.

There must be some other reason for the problem. It is not merely related to using sc.OpenChartOrGetChartReference.


SCSFExport scsf_OpenLargeNumberCharts(SCStudyInterfaceRef sc)
{

  if (sc.SetDefaults)
  {
    sc.GraphName = "Test: Open Large Number of Charts";

    sc.AutoLoop = 0;
    return;

  }

  for (int ChartIndex = 0 ; ChartIndex < 100; ChartIndex ++)
  {
    s_ACSOpenChartParameters OpenChartParameters;
    OpenChartParameters.ChartDataType = INTRADAY_DATA; //This can also be set to: DAILY_DATA

    OpenChartParameters.Symbol = sc.Symbol;

    OpenChartParameters.IntradayBarPeriodType = IBPT_DAYS_MINS_SECS;
    OpenChartParameters.IntradayBarPeriodLength = 1 + ChartIndex;

    OpenChartParameters.DaysToLoad = 5;

    OpenChartParameters.PriorChartNumber = 0;


    sc.OpenChartOrGetChartReference(OpenChartParameters);
  }

}

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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-04-24 01:32:04
[2016-04-24 09:26:57]
User99735 - Posts: 234
Hi,
In your test you are openng charts of same symbol as the chart on which the strategy is run.

Please repeat your tests with charts of different symbols, as per the sample code provided.

Regards

Vivek
[2016-04-24 10:00:29]
Sierra Chart Engineering - Posts: 104368
This will not make a difference. We are 100 % certain of that. You need to understand we developed the software and know how it works.

If you think it will make a difference, then use the Sierra Chart Historical Data Service and open 100 stock symbols:
Sierra Chart Historical Data Service


You can find stock symbols here:
https://www.sierrachart.com/index.php?page=doc/SierraChart_RealTime_And_Historical_Symbols.php&SymbolsPage=Stocks&ID=3#NASD


But this is not going to change anything. You will get the same result.

Also we cannot use your sample code because it is incomplete, and we do not have an Interactive Brokers account which will provide data which can be used to test unless a demo account will provide options data.

Also, if the problem is opening too many charts at once, our test is sufficient to determine a problem. You will need to work with our code as a base and modify it until you can create the problem and show us there is something that we can resolve.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-04-24 10:02:36

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

Login

Login Page - Create Account