Login Page - Create Account

Support Board


Date/Time: Fri, 14 Mar 2025 13:44:12 +0000



Post From: CustomChart is incompatible with GDI function call

[2022-01-11 21:33:08]
ejtrader - Posts: 688
SC Team - When the custom chart is used unable to use any GDI calls from that custom study chart.

Rather than marking as programming help - could you please test it internally and confirm? Do have a requirement to draw GDI objects from Customchart itself and appreciate if there is a fix for this.
Thanks


sc.fp_ACSCustomChartBarFunction = CustomChartBarBuildingFunction; --- this line works fine and builds the custom chart
sc.p_GDIFunction = DrawToChart_1; --> call to this GDI function is not working when used in the same code as customstudy code. However when inserted as a seperate study on this chart based on the customchart study - it works fine.

  if (sc.SetDefaults)
  {
    // Set the configuration and defaults
    sc.GraphRegion = 0;
    sc.GraphName = "Custom Chart Bars Example";
    sc.UsesCustomChartBarFunction = 1;

    // This function is called from another thread.
    sc.fp_ACSCustomChartBarFunction = CustomChartBarBuildingFunction;

sc.p_GDIFunction = DrawToChart_1; // This line doesn't work when used in Custom Chart Bars code. But when a seperate study is built using this function it works fine

    sc.AutoLoop = 0;//Always use manual looping.

    //sc.MaintainAdditionalChartDataArrays = 1;
    //sc.AllocateAndNameRenkoChartBarArrays = 1;

    Input_VolumePerBar.Name = "Volume Per Bar";
    Input_VolumePerBar.SetInt(1000);
    Input_VolumePerBar.SetIntLimits(1, INT_MAX);

    return;
  }

Date Time Of Last Edit: 2022-01-12 02:19:01