Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 20:23:49 +0000



Post From: is it possible to hide/show all studies with a single mouse-click?

[2023-10-30 04:17:08]
Tony - Posts: 519
@raheemrazzak

You are welcome, one of the possible option for your
case is saving multiple study collections, and define
buttons on the tool bar, so that each bar loads
different set of study collections

For ACSIL, unfortunately, I am not aware of a way to
access chronological #, for the time being, this is the
solution I am thinking (tested, works):

Give each study an unique Short Name (see attached image)
with or without space, doesn't matter, just make sure
it matches exactly with the name in the code. That means
it doesn't matter which order you loaded your studies,
you will always be able to identify each one.

I loaded Simple Moving Average, and give it a Short Name
as "My ID2", the previous code would be modified as below:

Then you can do whatever you want, i.e. press "q" to hide/unhide
this group of studies, press "a" to hide/unhide that group of
studies, etc, quite a work though if you have dozens or hundreds
of studies.

I will let you know if I would think of a better way to do it.


#include "sierrachart.h"

SCDLLName("KeyToHide")

SCSFExport scsf_KeyToHide(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    sc.GraphName = "Key To Hide";
    sc.GraphRegion = 0;
    sc.AutoLoop = 1;
    sc.UpdateAlways = 1;
    sc.ReceiveCharacterEvents = 1;    
    return;
  }
  
  static int VisibilityOfGroup1 {1};
  static int VisibilityOfGroup2 {1};
  
  if (sc.CharacterEventCode==113) // "q"uick hide or unhide Group One
    VisibilityOfGroup1 = !VisibilityOfGroup1;
    
  if (VisibilityOfGroup1) {
    sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID2", 1), 1);
    //sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID7", 1), 1);
    //sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID9", 1), 1);
  }
  else {
    sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID2", 1), 0);
    //sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID7", 1), 0);
    //sc.SetStudyVisibilityState(sc.GetStudyIDByName(sc.ChartNumber, "My ID9", 1), 0);
  }
}


Date Time Of Last Edit: 2023-10-30 04:56:39
imageID.png / V - Attached On 2023-10-30 04:16:59 UTC - Size: 95.01 KB - 138 views