Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 09:55:34 +0000



Post From: request for a very simple ACSIL study

[2015-02-14 23:46:07]
Kiwi - Posts: 375
Heres the code and a dll (just save it in your data directory then follow the "Add Custom Study using custom dll instructions" to find the function within it. You can look at the first two subgraphs Strobe and Time to help you check that its doing what you expect. Default time is 60 seconds.

SCSFExport scsf_RecalcChart(SCStudyInterfaceRef sc) {
  if (sc.SetDefaults) {
    sc.GraphName = "Recalc";
    sc.StudyDescription = "Recalc Chart every x secs based on real time";
    sc.Subgraph[0].Name = "Strobe";
    sc.Subgraph[1].Name = "Time";
    sc.Subgraph[0].DrawStyle=DRAWSTYLE_IGNORE;
    sc.Subgraph[1].DrawStyle=DRAWSTYLE_IGNORE;
    sc.Input[0].Name="Seconds between recalcs";
    sc.Input[0].SetInt(60);
    sc.UpdateAlways=1;
    sc.FreeDLL = 1;
    return;
  }

  if (sc.CurrentSystemDateTime.GetTime() % sc.Input[0].GetInt() == 0) {
    if (sc.Subgraph[0][sc.ArraySize-1] < 999660) {
      sc.Subgraph[0][sc.ArraySize-1] = 999666;
      sc.Subgraph[1][sc.ArraySize-1] = sc.CurrentSystemDateTime.GetTime();
      sc.FlagFullRecalculate = 1;
    }
  }
  else
    sc.Subgraph[0][sc.ArraySize-1] = 0;
}




DLL: * Kiwi's Stuff 2015 * (kiwi15.dll)
Function: Recalc
How to add a custom study: http://www.sierrachart.com/index.php?page=doc/doc_DLLUsage.html
Date Time Of Last Edit: 2015-02-14 23:49:36
attachmentkiwi15.cpp - Attached On 2015-02-14 23:44:50 UTC - Size: 15.45 KB - 742 views
attachmentkiwi15.dll - Attached On 2015-02-14 23:45:09 UTC - Size: 160.5 KB - 708 views