Accessing chart region 1 data from chart region 2 study? - Sierra Chart Programming | futures io social day trading
futures io futures trading


Accessing chart region 1 data from chart region 2 study?
Updated: Views / Replies:741 / 4
Created: by funk101 Attachments:3

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
 

Accessing chart region 1 data from chart region 2 study?

  #1 (permalink)
Elite Member
Margate, Fl.
 
Futures Experience: Advanced
Platform: NinjaTrader/R
Favorite Futures: Futures
 
Posts: 24 since Jun 2009
Thanks: 5 given, 5 received

Accessing chart region 1 data from chart region 2 study?

Basically I have a cci study that is in chart region 2, and I would like it to access the EMA data I have in chart region 1 (overlayed on price), how can I access the EMA data from the CCI study?

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
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


This would be an example of a CCI study with another study as the input.

 
Code
#include "sierrachart.h"

SCDLLName("Example") 
/*==========================================================================*/
SCSFExport scsf_Example(SCStudyInterfaceRef sc)
{
	SCSubgraphRef CCI = sc.Subgraph[1];
	
	SCInputRef Study1 = sc.Input[0];
	SCInputRef Study1Subgraph = sc.Input[1];
	
	SCInputRef Period = sc.Input[2];
	
	if (sc.SetDefaults)
	{
		sc.FreeDLL = 0;
		sc.AutoLoop = 1;
					
		CCI.Name="CCI of Another Study";		
		CCI.DrawStyle = DRAWSTYLE_BAR;
		CCI.LineWidth = 3;
		
		Study1.Name = "Input Study #";
		Study1.SetStudyID(1);
		Study1Subgraph.Name = "Input Subgraph #";
		Study1Subgraph.SetSubgraphIndex(0);
		
		Period.Name = "CCI Period";
		Period.SetInt(14);
		
		return;
	}
		
	// Do data processing
	sc.DataStartIndex = Period.GetInt() + 5;

	if(sc.Index >= Period.GetInt() + 5)
	{
		
	SCFloatArray Study1Array;
	sc.GetStudyArrayUsingID(Study1.GetStudyID(),Study1Subgraph.GetSubgraphIndex(),Study1Array);
	
	sc.CCI(Study1Array, sc.Subgraph[0], Period.GetInt(), 0.015);
	CCI[sc.Index] = sc.Subgraph[0][sc.Index];
	
	
	}
}

Attached Files
Register to download File Type: cpp Example.cpp (1.1 KB, 6 views)
Reply With Quote
The following 3 users say Thank You to vegasfoster for this post:
 
  #4 (permalink)
Elite Member
Margate, Fl.
 
Futures Experience: Advanced
Platform: NinjaTrader/R
Favorite Futures: Futures
 
Posts: 24 since Jun 2009
Thanks: 5 given, 5 received

My code...

First, thanks for responding, and that did help, however, for some reason I'm running into a snag using multiple studies:
My layout is a ZB daily chart with:
1.EMA 13
2.EMA 34(based on HLC avg)
3.SMA 200

I'm trying to access those three values from my CciSystem.cpp study.
For debugging purposes, I have an sc.AddMessageToLog() spitting out the values. As you can see, the *only* value that is being returned is the emaFast() data. ->(EMA 13);
Last hack, I tried using sc.Subgraph[0].Arrays[x] (Thinking that maybe the values were getting overwritten somehow) and still the same result. What am I missing here?

NOTE: I've been compiling this with VS Studio 2010 so #includes may have to be 'revisited'

Attached Files
Register to download File Type: cpp CciSystem.cpp (5.2 KB, 4 views)
Reply With Quote
 
  #5 (permalink)
Elite Member
Margate, Fl.
 
Futures Experience: Advanced
Platform: NinjaTrader/R
Favorite Futures: Futures
 
Posts: 24 since Jun 2009
Thanks: 5 given, 5 received

Actually, it *does* work...

I'm reposting my cpp file for anyone to see, but it does work. Basically, the cci study uses the ema data in the main graph to color it's (cci) histogram. This, for me, is still not complete, but is a working version of what I am going for. If anyone knows a more 'elegant' way to do this, beautiful, let me know.

Attached Files
Register to download File Type: cpp CciSystem.cpp (5.0 KB, 11 views)
Reply With Quote
The following user says Thank You to funk101 for this post:

Reply



futures io > > > > > Accessing chart region 1 data from chart region 2 study?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Little help with Draw Region jram77 NinjaTrader Programming 14 September 26th, 2013 12:21 AM
Drawing a region in Multicharts Easylanguage buylosellhi MultiCharts 2 October 5th, 2011 04:31 PM
Accessing a chart from a strategy richtobey NinjaTrader Programming 3 December 31st, 2010 05:07 AM
NT7 MA region color indicator Doppio NinjaTrader 10 June 10th, 2010 12:19 AM
MA region color indicator. help needed Doppio NinjaTrader Programming 3 June 8th, 2010 08:32 AM


All times are GMT -4. The time now is 01:56 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-17 in 0.09 seconds with 20 queries on phoenix via your IP 54.226.113.250