What is wrong with that ? Arraly pole1 and pole2 empty ?!?! - Sierra Chart Programming | futures io social day trading
futures io futures trading


What is wrong with that ? Arraly pole1 and pole2 empty ?!?!
Updated: Views / Replies:285 / 6
Created: by bluewave65 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 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
 

What is wrong with that ? Arraly pole1 and pole2 empty ?!?!

  #1 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 22 since Nov 2015
Thanks: 1 given, 0 received

What is wrong with that ? Arraly pole1 and pole2 empty ?!?!

Hi, i got a simple code , but arrays pole1 and pole2 remain empty ? Why ?
Pls HELP ....

dave

p.s.: Original sierra code with
InputArray1.SetStudySubgraphValues(0,0);
sc.GetStudyArrayUsingID(

works just fine ...... i don`t get it
I just need get arrays from another chart ....



 
Code
#include "c:\uziv\trade\1510\ACS_Source\sierrachart.h"

SCDLLName("KORELACE") 

/*==========================================================================*/
SCSFExport scsf_korelace(SCStudyInterfaceRef sc)
{
	SCSubgraphRef CC1 = sc.Subgraph[0];

	SCInputRef InputArray1 = sc.Input[0];
	SCInputRef InputArray2 = sc.Input[1];

	SCInputRef Length = sc.Input[6];

	if(sc.SetDefaults)	
	{
		sc.GraphName = "KORELACE";

		sc.GraphRegion = 1;

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

					
		InputArray1.Name = "CC1 - Instrument 1";
		InputArray1.SetChartStudySubgraphValues(1, 0, 0);
		InputArray2.Name = "CC1 - Instrument 2";
		InputArray2.SetChartStudySubgraphValues(1, 0, 0);


		Length.Name = "Interval";
		Length.SetInt(200);

		sc.AutoLoop = 1;
		sc.FreeDLL = 1;
		sc.CalculationPrecedence = LOW_PREC_LEVEL;
		
		return;
	}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Definovani Poli Pro Prevzeti Dat z Externich Grafu

	sc.DataStartIndex = Length.GetInt();

	SCFloatArray pole1;
	sc.GetStudyArrayFromChartUsingID(InputArray1.GetChartStudySubgraphValues(), pole1);
	if(pole1.GetArraySize() < sc.ArraySize)
		return;

	SCFloatArray pole2;
	sc.GetStudyArrayFromChartUsingID(InputArray2.GetChartStudySubgraphValues(), pole2);
	if(pole2.GetArraySize() < sc.ArraySize)
		return;

	CC1[sc.Index] = sc.GetCorrelationCoefficient(pole1, pole2, Length.GetInt());

}

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
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 90 since Apr 2012
Thanks: 49 given, 65 received


As you ca see here:

InputArray1.Name = "CC1 - Instrument 1";
InputArray1.SetChartStudySubgraphValues(1, 0, 0);
InputArray2.Name = "CC1 - Instrument 2";
InputArray2.SetChartStudySubgraphValues(1, 0, 0);

Both InputArray1 and InputArray2 point to Subgraph 0 of Study 0 on Chart 1.
Is this want you want? Are you using the default settings ?

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 22 since Nov 2015
Thanks: 1 given, 0 received

I know ... but it isn`t a problem ....
If i change it ........ no solution ........ same problem .......

Reply With Quote
 
  #5 (permalink)
Elite Member
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 90 since Apr 2012
Thanks: 49 given, 65 received

I added to the code a few lines that send the values of the compared 2 arrays to the message log. As you can see in the attached txt file the arrays are definitely not empty. I compared the Sp-TICK and NYSE-Tick, not CCIs.
One reason for getting zeros in the arrays is if the chart on which you apply the study has a larger sc.ArraySize (More bars) than the charts that you reference. In this case pole1[sc.Index] and pole2[sc.Index] will have zeros for sc.Index values that are larger than the last sc.Index on those charts.

p.s here is your code with the addition of the lines that send the arrays values to the message log.

#include "sierrachart.h"

SCDLLName("KORELACE")

/*=============================================*/
SCSFExport scsf_korelace(SCStudyInterfaceRef sc)
{
SCSubgraphRef CC1 = sc.Subgraph[0];

SCInputRef InputArray1 = sc.Input[0];
SCInputRef InputArray2 = sc.Input[1];

SCInputRef Length = sc.Input[6];

if(sc.SetDefaults)
{
sc.GraphName = "KORELACE";

sc.GraphRegion = 1;

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


InputArray1.Name = "CC1 - Instrument 1";
InputArray1.SetChartStudySubgraphValues(1, 0, 0);
InputArray2.Name = "CC1 - Instrument 2";
InputArray2.SetChartStudySubgraphValues(1, 0, 0);


Length.Name = "Interval";
Length.SetInt(200);

sc.AutoLoop = 1;
sc.FreeDLL = 1;
sc.CalculationPrecedence = LOW_PREC_LEVEL;

return;
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Definovani Poli Pro Prevzeti Dat z Externich Grafu

sc.DataStartIndex = Length.GetInt();

SCFloatArray pole1;
sc.GetStudyArrayFromChartUsingID(InputArray1.GetChartStudySubgraphValues(), pole1);
if(pole1.GetArraySize() < sc.ArraySize)
return;


SCFloatArray pole2;
sc.GetStudyArrayFromChartUsingID(InputArray2.GetChartStudySubgraphValues(), pole2);
if(pole2.GetArraySize() < sc.ArraySize)
return;

SCString str;
str.Format("NYSE_ Tick = %f ------ SP Tick = %f",pole1[sc.Index], pole2[sc.Index]);
sc.AddMessageToLog(str, 0);




CC1[sc.Index] = sc.GetCorrelationCoefficient(pole1, pole2, Length.GetInt());

}

Attached Files
Register to download File Type: txt KORELACE_Arrays.txt (304.0 KB, 7 views)

Last edited by yonatan; February 27th, 2017 at 06:45 AM.
Reply With Quote
The following user says Thank You to yonatan for this post:
 
  #6 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 22 since Nov 2015
Thanks: 1 given, 0 received

 
Code
#include "c:\uziv\trade\1510\ACS_Source\sierrachart.h"

SCDLLName("KORELACE") 

/*==========================================================================*/
SCSFExport scsf_korelace(SCStudyInterfaceRef sc)
{
	SCSubgraphRef CC1 = sc.Subgraph[0];


	SCInputRef InputArray1 = sc.Input[0];
	SCInputRef InputIndex = sc.Input[1];
	

	SCInputRef Length = sc.Input[3];

	if(sc.SetDefaults)	
	{
		sc.GraphName = "KORELACE";

		sc.GraphRegion = 1;

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


		InputArray1.Name = "Instrument 1";
		InputArray1.SetChartNumber(1);

		InputIndex.Name = "Input Index";
		InputIndex.SetInputDataIndex(SC_LAST);


		Length.Name = "Interval";
		Length.SetInt(200);

		sc.AutoLoop = 1;
		sc.FreeDLL = 1;
		sc.CalculationPrecedence = LOW_PREC_LEVEL;
		
		return;
	}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Definovani Poli Pro Prevzeti Dat z Externich Grafu

	sc.DataStartIndex = Length.GetInt();


	SCFloatArray pole1;
	sc.GetChartArray(-InputArray1.GetChartNumber(), InputIndex.GetInputDataIndex(), pole1 );
	
	int Chart1Index = sc.GetNearestMatchForDateTimeIndex(InputArray1.GetChartNumber(), sc.Index);
	

	//CC1[sc.Index] = pole1[Chart1Index];
	CC1[sc.Index] = sc.GetCorrelationCoefficient(pole1[Chart1Index], sc.BaseDataIn[SC_LAST] , Length.GetInt());

	
}
------

I got a problem with make this function work ......

error C2664: 'float s_sc::GetCorrelationCoefficient(SCFloatArrayRef,SCFloatArrayRef,int)' : cannot convert parameter 1 from 'float' to 'SCFloatArrayRef'

Howto get a correlation coefficient from basedata and referenced sc_last ..... ?


Thanks a lot
dave

Reply With Quote
 
  #7 (permalink)
Elite Member
Columbus, OH
 
Futures Experience: Intermediate
Platform: SierraChart
Favorite Futures: CL
 
Posts: 14 since May 2013
Thanks: 39 given, 8 received

If you delete this [Chart1Index] from your function call it should compile.

The last line should read sc.GetCorrelationCoefficient(pole1, sc.BaseDataIn[SC_LAST] , Length.GetInt());

Reply With Quote

Reply



futures io > > > > > What is wrong with that ? Arraly pole1 and pole2 empty ?!?!

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
Exclude empty values for calculations tonycashflow NinjaTrader Programming 7 June 23rd, 2014 12:15 PM
empty days on gomiMP chart - how to fill them ebdvi NinjaTrader 1 March 7th, 2012 07:04 AM
empty area on chart meyer99 NinjaTrader 4 May 31st, 2011 08:50 AM
12,000 Empty goverment buildings kbit Off-Topic 0 May 11th, 2011 12:48 PM


All times are GMT -4. The time now is 04:09 AM.

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-15 in 0.11 seconds with 20 queries on phoenix via your IP 54.234.255.29