Need help modifying an existing SC study - Sierra Chart Programming | futures io social day trading
futures io futures trading

Need help modifying an existing SC study
Updated: Views / Replies:568 / 3
Created: by boze man Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Need help modifying an existing SC study

  #1 (permalink)
Elite Member
South Jersey
Trading Experience: Advanced
Platform: Sierra
Broker/Data: IB
Favorite Futures: ES, CL
Posts: 98 since Apr 2011
Thanks: 19 given, 59 received

Need help modifying an existing SC study

I want to modify the stock 'Highest High Lowest Low over N bars' study to include the "use current bar value" input (see below)

I have been able to hack this piece of code into some of the easier studies (SCStudyGraphRef sg.) but not the more complex (SCStudyInterfaceRef sc.)

sg.Input[5].Name="Use current bar value?";
sg.Input[5].SetYesNo(0);  // No
Here is the code for HH LL over N bars from STUDIES7.cpp

Thanks in advance for any help

SCSFExport scsf_HighestHighLowestLowOverNBars(SCStudyInterfaceRef sc)
	SCSubgraphRef HighestHigh = sc.Subgraph[0];
	SCSubgraphRef LowestLow = sc.Subgraph[1];

	SCInputRef Length = sc.Input[3];
	SCInputRef InputDataHigh = sc.Input[5];
	SCInputRef InputDataLow = sc.Input[6];

	if (sc.SetDefaults)
		sc.GraphName = "Highest High / Lowest Low Over N Bars";

		sc.GraphRegion = 0;
		sc.AutoLoop = 1;

		HighestHigh.Name= "Highest High";
		HighestHigh.DrawStyle = DRAWSTYLE_LINE;
		HighestHigh.PrimaryColor = RGB(0,255,0);
		HighestHigh.DrawZeros = true;

		LowestLow.Name = "Lowest Low";
		LowestLow.DrawStyle = DRAWSTYLE_LINE;
		LowestLow.PrimaryColor = RGB(255,0,255);
		LowestLow.DrawZeros = true;

		Length.Name = "Length";
		Length.SetIntLimits(1, MAX_STUDY_LENGTH);

		InputDataHigh.Name = "Input Data High";

		InputDataLow.Name = "Input Data Low";


	sc.DataStartIndex = Length.GetInt()  - 1;

	if (sc.Index < sc.DataStartIndex)

	double Lowest = FLT_MAX;
	double Highest = -FLT_MAX;
	for(int BarIndex = sc.Index - (Length.GetInt() - 1); BarIndex <= sc.Index; BarIndex++)
		if(Highest < sc.BaseDataIn[InputDataHigh.GetInputDataIndex()][BarIndex])
			Highest = sc.BaseDataIn[InputDataHigh.GetInputDataIndex()][BarIndex];

		if(Lowest > sc.BaseDataIn[InputDataLow.GetInputDataIndex()][BarIndex])
			Lowest = sc.BaseDataIn[InputDataLow.GetInputDataIndex()][BarIndex];

	HighestHigh[sc.Index] = (float)Highest;
	LowestLow[sc.Index] = (float)Lowest;

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Elite Member
Trading Experience: Advanced
Platform: SierraChart
Posts: 64 since Jul 2009
Thanks: 6 given, 70 received

I have created a version that I think does what you want.

Hope this helps.

Attached Files
Register to download File Type: cpp ModifiedHighestHighLowestLow.cpp (2.0 KB, 24 views)
Reply With Quote
The following user says Thank You to swandro for this post:
  #4 (permalink)
Elite Member
South Jersey
Trading Experience: Advanced
Platform: Sierra
Broker/Data: IB
Favorite Futures: ES, CL
Posts: 98 since Apr 2011
Thanks: 19 given, 59 received


Will give it a go.

Reply With Quote


futures io > > > > > Need help modifying an existing SC study

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!


3 Excellent Entries, and How To Automate Them w/Kevin Davey

Feb 21

The Driving Force Behind the Market w/Earn2Trade

Mar 5

TBA w/Stage5 & iSystems

Mar 12

TBA w/John Grady @ No BS Day Trading

Mar 19

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying existing fib tool PandaWarrior NinjaTrader 5 April 14th, 2015 10:24 AM
[SC] Example of study for extended rectangles Nicolas11 The Elite Circle 12 July 14th, 2014 12:20 PM
Daily OHLC Study in SC Traderwolf Sierra Chart 2 June 7th, 2013 01:24 PM
Create a new study by modifying an existing needed boze man Sierra Chart 6 May 8th, 2013 02:58 PM
[SC] Overlay a study, but only at bar open Nicolas11 Sierra Chart Programming 3 August 13th, 2012 09:59 AM

code, information, sierra_chart

All times are GMT -4. The time now is 08:19 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
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 2019-02-22 in 0.20 seconds with 15 queries on phoenix