SC Custom Menu Items - Sierra Chart | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart

SC Custom Menu Items
Started:April 8th, 2013 (10:34 PM) by josh Views / Replies:463 / 0
Last Reply:April 8th, 2013 (10:34 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

SC Custom Menu Items

Old April 8th, 2013, 10:34 PM   #1 (permalink)
Elite Member
Georgia, US
Futures Experience: None
Platform: Various
Favorite Futures: Various
josh's Avatar
Posts: 4,898 since Jan 2011
Thanks: 5,143 given, 11,193 received

SC Custom Menu Items

In this thread, a generous user contributed some code that takes advantage of Sierra's new ACS functionality which allows catching mouse events when a custom button is pressed.

The thing is, I hate toolbars, particularly those in Sierra. So, I decided to implement what I needed as a menu. Basically, I wanted a way to hide/show 2 or more studies at the same time. The region data line right-click show/hide menu in SC is helpful but it only shows/hides one study at a time, and if you are using several to implement shading, etc., then you may have 5 or more that need to all work together. So, this was the reason to explore this option.

Here is the SC documentation. It is not scary, and is pretty easy to understand. I encourage you to read it. The relevant section is the first one, though the subsequent sections are related:
Advanced Custom Study Interaction With Menus, ToolBar Buttons, Mouse Pointer Events - Sierra Chart

The first code block on that page really tells the story. You use a persistent variable, and add a menu item. Do this for as many menu items as you need. Then, you listen for a menu click and if it's the particular one you want, then you perform some action. Here is my code block for the "VWAP RTH" menu item:

if (sc.MenuEventID != 0 && sc.MenuEventID == MenuID1)
		sc.SetStudyVisibilityState(CH01_STDY_01, t);
		sc.SetStudyVisibilityState(CH01_STDY_02, f);
		sc.SetStudyVisibilityState(CH01_STDY_03, f);
		sc.SetStudyVisibilityState(CH01_STDY_04, f);
		sc.SetStudyVisibilityState(CH01_STDY_05, f);
		sc.SetStudyVisibilityState(CH01_STDY_06, f);
		sc.SetStudyVisibilityState(CH01_STDY_07, f);
		sc.SetStudyVisibilityState(CH01_STDY_08, f);
I use #define at the top to define CH01_STDY_ZZ as study numbers in my chart that I want to hide or show. You could take these as input variables but I prefer just to put them in the code as it's easy to change if using a #define or variable. So I have

#define CH01_STDY_01 4
#define t 0
"4" is the study ID of a study I will want to hide or show. In this case it's the RTH VWAP. 2-8 are the ETH VWAP, SD bands, and shading studies. For some reason in the SetStudyVisibilityState(num, state) function, 0 appears to set the study visible and 1 makes it invisible, so I am able to quickly change true and false if SC changes this by using the #define at the top.

As the SC documentation mentions in the 2nd section and as shown in the code block, you need to remove whatever menu items you are not using when the study unloads.

That's it! Just use this to hide/show whatever study you like! If I can answer any questions I'll be happy to. The best thing to do is fire up the CPP editor in Sierra and give it a go. For a single menu item the code shouldn't be more than 30 or 40 lines long, it is very simple, as shown above.

Please register on to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 9 users say Thank You to josh for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart > SC Custom Menu Items

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thanks to SC josh Sierra Chart 3 April 9th, 2013 02:42 AM
Multiple Menu selection for NT7 indicators gavetso NinjaTrader Programming 2 June 26th, 2012 02:01 PM
The Fed's Secret Phone Menu Big Mike Off-Topic 1 June 15th, 2012 11:57 AM
Greek Restructuring: Off the Table, Not Off the Menu Quick Summary News and Current Events 0 June 1st, 2011 05:50 AM
NT-7 Context Menu Items Prtester NinjaTrader Programming 10 January 13th, 2010 10:02 AM

All times are GMT -4. The time now is 05:14 PM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-25 in 0.07 seconds with 19 queries on phoenix via your IP