SC programming help. Newbie question. - Sierra Chart Programming | futures io social day trading
futures io futures trading


SC programming help. Newbie question.
Updated: Views / Replies:584 / 5
Created: by gryandc Attachments:0

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 90,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

Reply
 
Thread Tools Search this Thread
 

SC programming help. Newbie question.

  #1 (permalink)
Trading Apprentice
Amsterdam
 
Futures Experience: Beginner
Platform: Sierracharts
Favorite Futures: ES
 
Posts: 8 since Nov 2015
Thanks: 7 given, 0 received

SC programming help. Newbie question.

Hi all!

I'm trying to create a simple (I thought it would be simple!) study using sc.GetStudyArrayUsingID() to overlay onto my volume by price study. Maybe I shouldn't be using this function?

I am wanting to draw a horizontal line based on a calculation involving either the high or low of the day and the POC.

I would like to add the POC to the low of the day value if the POC is above the mid point of the day (another line that I have on the chart)

or

If the POC is below the mid point of the day I would like the POC subtracted from the high of the day.

I hope this makes sense!

Any help greatly appreciated.

Thanks Gordon

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)
Energy futures Superfreak
charlotte nc
 
Futures Experience: Master
Platform: Sierra Chart, TOS, Tradestation, NinjaTrader
Favorite Futures: energy
 
Posts: 114 since Jul 2012
Thanks: 81 given, 164 received


busy trading, but this code shows examples of how to reference other studies to perform secondary work on them

 
Code
// The top of every source code file must include this line
// SM_CCI_Alerts.cpp

#include "sierrachart.h"
#include <math.h>


/*****************************************************************************

	For reference, you want to look at the Advanced Custom Study Interface
	and Language documentation on the Sierra Chart website. 
	
*****************************************************************************/


// This line is required.
// Change the text within the quote marks to what you want to name
// your group of custom studies. 

SCDLLName("SM_CCI_Alerts DLL") 

//This is an empty study function.  Auto looping is enabled. 
SCSFExport scsf_CCI_Alerts_SM(SCStudyGraphRef sc)
{

	// Section 1 - Set the configuration variables     
	
	if (sc.SetDefaults)  // This section only run once upon adding an instance of the study to a chart
	{
		// Set the configuration and defaults
		
		sc.GraphName = "SM_CCI_Alerts";
		
		sc.StudyDescription = "CCI Alerts";
		
		sc.AutoLoop = 1;  // true
		
		sc.GraphRegion = 0;  // On main price chart.
		
		//sc.AlertOnlyOncePerBar = 1;
		
		// Uncomment the following line when you're done with your
		// development.  This makes calling your function faster.
		sc.FreeDLL = 0;  // Production setting
		//sc.FreeDLL = 1;  // Development setting
				
		return;
		
	}
		
	
	// Everything below here is run on every chart update or when the chart is
	// reloaded.
	
		sc.CCI(
			sc.BaseDataIn[SC_HLC],  // This is the input array or source data -- this is using the Last or Close from each bar
			sc.Subgraph[0],  // This designates your output array (subgraph/plot) -- this is using Subgraph 1
			sc.Index,  // This parameter is always sc.CurrentIndex
			5, 0.015);  // This is the length for the CCI and float multiplier, which is from Input 0
			
		sc.CCI(
			sc.BaseDataIn[SC_HLC],  // This is the input array or source data -- this is using the Last or Close from each bar
			sc.Subgraph[1],  // This designates your output array (subgraph/plot) -- this is using Subgraph 1
			sc.Index,  // This parameter is always sc.CurrentIndex
			20, 0.015);  // This is the length for the CCI and float multiplier, which is from Input 0
			
		sc.CCI(
			sc.BaseDataIn[SC_HLC],  // This is the input array or source data -- this is using the Last or Close from each bar
			sc.Subgraph[2],  // This designates your output array (subgraph/plot) -- this is using Subgraph 1
			sc.Index,  // This parameter is always sc.CurrentIndex
			50, 0.015);  // This is the length for the CCI and float multiplier, which is from Input 0
	

		
		//  This section is checking for CCI locations/values  //
	
		if (sc.Subgraph[0][sc.Index] >= 100)
			if (sc.Subgraph[1][sc.Index] >= 100)
				if (sc.Subgraph[2][sc.Index] >= 100)
					sc.SetAlert(7);   // all CCI's in pos. zoom
					
		if (sc.Subgraph[0][sc.Index] <= -100)
			if (sc.Subgraph[1][sc.Index] <= -100)
				if (sc.Subgraph[2][sc.Index] <= -100)
					sc.SetAlert(8);	  // all CCI's in neg. zoom
			
		float CCIdiff = abs(sc.Subgraph[0][sc.Index] - sc.Subgraph[2][sc.Index]);
		
		if (sc.Subgraph[0][sc.Index] > sc.Subgraph[2][sc.Index])
			if (CCIdiff >= 150)
				sc.SetAlert(9);  // snap back down
				
		if (sc.Subgraph[0][sc.Index] < sc.Subgraph[2][sc.Index])
			if (CCIdiff >= 150)
				sc.SetAlert(10);  // snap back UP
		
	
}

Reply With Quote
The following user says Thank You to hobart for this post:
 
  #4 (permalink)
Trading Apprentice
Amsterdam
 
Futures Experience: Beginner
Platform: Sierracharts
Favorite Futures: ES
 
Posts: 8 since Nov 2015
Thanks: 7 given, 0 received

Thanks hobart,

Appreciate the reply during the trading day.
I still have a fair bit of study to do because that is still making very little sense to me! lol

Gordon

Reply With Quote
 
  #5 (permalink)
Energy futures Superfreak
charlotte nc
 
Futures Experience: Master
Platform: Sierra Chart, TOS, Tradestation, NinjaTrader
Favorite Futures: energy
 
Posts: 114 since Jul 2012
Thanks: 81 given, 164 received

 
Code
sc.CCI(
			sc.BaseDataIn[SC_HLC],  // This is the input array or source data -- this is using the Last or Close from each bar
			sc.Subgraph[2],  // This designates your output array (subgraph/plot) -- this is using Subgraph 1
			sc.Index,  // This parameter is always sc.CurrentIndex
			50, 0.015);  // This is the length for the CCI and float multiplier, which is from Input 0
	

		
				if (sc.Subgraph[2][sc.Index] >= 100)
					sc.SetAlert(7);   // all CCI's in pos. zoom
In this snippit, i call the built in study CCI, store the result in sc.Subgraph[2], then reference if its current bar value (sc.index) is greater than 100.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Amsterdam
 
Futures Experience: Beginner
Platform: Sierracharts
Favorite Futures: ES
 
Posts: 8 since Nov 2015
Thanks: 7 given, 0 received

Great, Thanks again for the information Hobart.

I am slowly getting there, and all of this helps.

Gordon

Reply With Quote

Reply



futures io > > > > > SC programming help. Newbie question.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
SC Programming Start point/Tutorial crawfells Sierra Chart Programming 3 August 25th, 2015 07:28 AM
Simple SC Horizontal Line Question Babool Sierra Chart 2 September 13th, 2014 12:39 PM
Programming Newbie JGSmith EasyLanguage Programming 19 September 4th, 2013 03:51 AM
Couple of SC (C++) programming questions vegasfoster Sierra Chart Programming 9 July 21st, 2011 05:29 PM
Another CrossBelow/Above question from newbie Al2010 NinjaTrader Programming 3 December 4th, 2010 08:15 PM


All times are GMT -4. The time now is 04:51 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-11 in 0.11 seconds with 19 queries on phoenix via your IP 54.226.132.197