Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 02:48:47 +0000



Post From: Kiwi's countdown alarm clock APP

[2014-11-15 23:14:41]
Kiwi - Posts: 374
Heres my old files.

I now just use a bit of acsil code to give me a countdown in each relevant SC window. If you use it the bits that refer to up and down can be removed or just set to zero.




  /*----------------------------------------------------------------------*/
  // Output to text ... following active tool

  int Hour, Minute, Second;
  int& timesave = sc.PersistVars->i11;
SCDateTime BarTime = sc.SecondsPerBar;
SCString StrRemainingTime;
SCDateTime RemainingTime = barTime[as].GetTime() +
sc.SecondsPerBar - sc.CurrentSystemDateTime.GetTime();

if(sc.IsReplayRunning()) RemainingTime = barTime[as].GetTime() +
sc.SecondsPerBar - sc.LatestDateTimeForLastBar.GetTime();

if(RemainingTime != timesave) {
timesave=RemainingTime;
if(sc.CurrentlySelectedDrawingTool == 2 &&
        sc.CurrentlySelectedDrawingToolState) {
up = Up[sc.ActiveToolIndex];
dn = Dn[sc.ActiveToolIndex];
}
up = (up > 99) ? 99.0 : up;
dn = (dn > 99) ? 99.0 : dn;

s_UseTool Tool;
Tool.Clear(); // reset tool structure for our next use
float High, Low;
sc.GetMainGraphVisibleHighAndLow(High,Low);
if (C[sc.IndexOfLastVisibleBar] < ((High+Low)/2))
      if (sc.ScaleRangeType == SCALE_AUTO)
        Tool.BeginValue = High-(0.1 * (High-Low));
      else
        Tool.BeginValue = sc.ScaleRangeTop - 8;
else
      if (sc.ScaleRangeType == SCALE_AUTO)
        Tool.BeginValue = Low+(0.1 * (High-Low));
      else
        Tool.BeginValue = sc.ScaleRangeBottom + 8;
Tool.BeginDateTime =
barTime[sc.IndexOfLastVisibleBar - shiftleft.IntValue];
Tool.ChartNumber = sc.ChartNumber;
Tool.Tool = TOOL_TEXT;
Tool.LineWidth = 1; Tool.FontSize = fontsize.GetInt();
Tool.Region = 0;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.Color = RGB(28,28,28);

char output[40] = "";
if(RemainingTime <= 0 && RemainingTime >= -BarTime) {
RemainingTime = RemainingTime+sc.SecondsPerBar;
Tool.Color = RGB(255,0,0);
}
    else if(RemainingTime > BarTime || RemainingTime < -BarTime)
RemainingTime = 0;
Hour = (int) (RemainingTime / 3600);
Minute = ((int) (RemainingTime / 60)) - (Hour * 60);
Second = RemainingTime - (Hour * 3600)-(Minute * 60);
if(Second >= 10) {
StrRemainingTime.Format(" %d:%d %2.0f %2.0f", Minute,
Second, up, dn);
}
else {
StrRemainingTime.Format(" %d:0%d %2.0f %2.0f", Minute,
Second, up, dn);
if(Minute == 0) {
if((Second == 8 || Second == 6 || Second == 4 ||
          Second == 2 || Second == 0))
Tool.Color = RGB(0,0,255);
else Tool.Color = RGB(255,0,255);
}
}
Tool.Text = StrRemainingTime;
Tool.LineNumber = 164;
sc.UseTool(Tool);
}

attachmenttimer_source_lite.zip - Attached On 2014-11-15 23:06:53 UTC - Size: 21.05 KB - 505 views
attachmentTimerLiteKiwi2.zip - Attached On 2014-11-15 23:07:35 UTC - Size: 880.98 KB - 464 views