Login Page - Create Account

Support Board


Date/Time: Mon, 28 Oct 2024 11:21:15 +0000



Post From: Alerts Log

[2015-07-15 19:15:52]
Sierra Chart Engineering - Posts: 104368
Use the below code with version 1269:
SCSFExport scsf_LogAndAlertExample(SCStudyInterfaceRef sc)
{
  // Set configuration variables
  
  if (sc.SetDefaults)
  {
    sc.GraphName = "Log and Alert Example";
    
    sc.StudyDescription = "";
    
    sc.GraphRegion = 0;

    sc.AutoLoop = 0;//manual looping

    //During development set this flag to 1, so the DLL can be modified. When development is completed, set it to 0 to improve performance.
    sc.FreeDLL = 0;
    
    return;
  }
  
  
  // Do data processing
  if (sc.GetBarHasClosedStatus(sc.UpdateStartIndex) == BHCS_BAR_HAS_NOT_CLOSED)
    return;
  
  // Show message to log
  sc.AddMessageToLog("Popped up Message", 1);
  sc.AddMessageToLog("Non-Popped up Message", 0);

  // Alert sounds are configured by selecting "Global Settings >> General Settings" in Sierra Chart
  sc.PlaySound(1); // Add alert sound 1 to be played
  sc.PlaySound(50); // Add alert sound 50 to be played
  
  // Add an Alert message to SierraChart Alert Log
  sc.AddAlertLine("Condition is TRUE");

  // Adding an alert line using an SCString. The Alert log will also be opened.
  SCString AlertMessage("Alert Message");
  sc.AddAlertLine(AlertMessage,1);

  // Playing a sound and adding an Alert Line at the same time.
  sc.PlaySound(2, AlertMessage, 1); // Alert Log will open

  sc.PlaySound(3, "Alert Message 2", 0); // Alert Log will not open

  // Can also Play Sound from a text file, for example:
  sc.PlaySound("C:\\Windows\\beep.wav", 2);

  sc.AddAlertLineWithDateTime("Alert message with Date-Time", 0, sc.BaseDateTimeIn[sc.UpdateStartIndex]);
}

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