Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 19:04:16 +0000



Marketdelta-like background mouse cursor.

View Count: 1642

[2013-07-03 16:11:53]
marcovth - Posts: 61
Hello ...

A freebee ... it's code for a Marketdelta-like background mouse cursor.
It uses the ACS_TOOL7 button, but you can change that.

Just load the study for the main price GraphRegion, and duplicate the study (load a second+) for other GraphRegions.

Enjoy.


#include "sierrachart.h"
SCDLLName("MousePointer")
SCSFExport scsf_ChangeTimeFrame(SCStudyGraphRef sc){
  SCSubgraphRef background = sc.Subgraph[0];
  if (sc.SetDefaults){
    sc.GraphName = "MousePointer";
    background.Name = "background";
    background.PrimaryColor = RGB(80,80,80);
    background.DrawStyle = DRAWSTYLE_BACKGROUND;
    sc.DrawZeros = false;
    sc.FreeDLL = 0;
    sc.AutoLoop = 1;
    sc.GraphRegion = 0;
    sc.ScaleRangeType = SCALE_INDEPENDENT;
    return;
  }

  int i=sc.Index;
  background[i]=0;
  sc.ReceiveMousePointerEvents= true;
  int& MenuID7 = sc.PersistVars->i1;
  
  if (sc.UpdateStartIndex == 0){
    sc.SetACSToolToolTip(7,"Mouse");
    sc.SetACSToolButtonText(7, "Mouse");
    if (MenuID7 <= 0) MenuID7 = sc.AddACSChartShortcutMenuItem(sc.ChartNumber, "Mouse");
  }

  if (sc.LastCallToFunction){
    sc.RemoveACSChartShortcutMenuItem(sc.ChartNumber, MenuID7);
  }

  if (sc.MenuEventID != 0){
    if (sc.MenuEventID == SC_ACS_TOOL7){
      if (sc.MouseEventType == SC_MOUSE_MOVE){
        for (int m = 0; m < sc.ArraySize-1; m++){
          background[m]=0;
        }
        background[sc.ActiveToolIndex]=sc.Close[sc.ActiveToolIndex];
}
}
}
}

[2013-07-03 17:29:01]
ganz - Posts: 1048
hi

great idea! very cool :)

gd lck
[2013-07-03 18:29:18]
Sierra Chart Engineering - Posts: 104368
This is not an efficient study and can create a high CPU load.
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

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account