Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 10:39:17 +0000



Post From: [PROGRAMMING HELP] ACSIL compare SCDateTime

[2024-06-11 08:29:18]
aknsyu71@gmail - Posts: 54
this is the full code, Summertime is a subgraph to highlight the bar at a datetime whilest i is sc.Index

#include "sierrachart.h"
SCDLLName("AK_NEWS")
SCSFExport scsf_AK_NEWS(SCStudyInterfaceRef sc)
{
  SCSubgraphRef SummerTime = sc.Subgraph[0];
  
  if (sc.SetDefaults)
  {
    sc.GraphName = "NEWS highlight";
    sc.FreeDLL = 1;
    sc.GraphRegion = 0;
    sc.AutoLoop = 0;
    sc.ValueFormat = 0;
    sc.ScaleRangeType = SCALE_INDEPENDENT;

    SummerTime.Name = "Summer Time";
    SummerTime.DrawStyle = DRAWSTYLE_COLOR_BAR;
    SummerTime.PrimaryColor = RGB(255, 0, 255);
    SummerTime.DrawZeros = false;
  }
  
  int i = sc.Index;
  for (int i = sc.UpdateStartIndex; i < sc.ArraySize; i++)
  {
    SCDateTime IndexDateTime = sc.BaseDateTimeIn[i];
    SCDateTime MySCDateTime(2000, 1, 1, 12, 0, 0);
    if (IndexDateTime == MySCDateTime.GetDateTimeYMDHMS(2024,5,3,13,30,0))    SummerTime[i] = sc.Close[i];
  }
}[/i][/i][/i]

Date Time Of Last Edit: 2024-06-11 08:29:51