NexusFi: Find Your Edge


Home Menu

 





How to obtain values from another Indicator using ACSIL


Discussion in Sierra Chart

Updated
    1. trending_up 2,421 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

How to obtain values from another Indicator using ACSIL

  #1 (permalink)
TheDuke
Houston Texas/USA
 
Posts: 11 since Feb 2018
Thanks Given: 2
Thanks Received: 1

How do we go about in obtaining Values from another indicator?

I remember seeing a guide on Sierra but can't seem to find it. I've done the following but my array is empty.

 
Code
// Get the study data from the specified chart
    sc.GetStudyArraysFromChartUsingID(Input_Subgraph3Reference.GetChartNumber(), Input_Subgraph3Reference.GetStudyID(), StudyData);

    //Check if the study has been found.  If it has, GetArraySize() will return the number of Subgraphs in the study.
    if (StudyData.GetArraySize() > 0)
    {

        // Define a reference to the first subgraph array
        SCFloatArrayRef Array1 = StudyData[0];

        // Check if array is not empty.
        if (Array1.GetArraySize() != 0)
        {
            // Get last value in array
            float LastValue = Array1[Array1.GetArraySize() - 1];
        }

    }

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
 
  #2 (permalink)
ondafringe
Albuquerque, NM, USA
 
Posts: 124 since Jul 2012
Thanks Given: 87
Thanks Received: 117


TheDuke View Post
How do we go about in obtaining Values from another indicator?

I remember seeing a guide on Sierra but can't seem to find it. I've done the following but my array is empty.

 
Code
// Get the study data from the specified chart
    sc.GetStudyArraysFromChartUsingID(Input_Subgraph3Reference.GetChartNumber(), Input_Subgraph3Reference.GetStudyID(), StudyData);

    //Check if the study has been found.  If it has, GetArraySize() will return the number of Subgraphs in the study.
    if (StudyData.GetArraySize() > 0)
    {

        // Define a reference to the first subgraph array
        SCFloatArrayRef Array1 = StudyData[0];

        // Check if array is not empty.
        if (Array1.GetArraySize() != 0)
        {
            // Get last value in array
            float LastValue = Array1[Array1.GetArraySize() - 1];
        }

    }

I *think* you have to do something like this:
 
Code
SCSFExport scsf_StudyName(SCStudyInterfaceRef sc)
{

     // Define a reference to the first subgraph array
      
    SCGraphData StudyData;
    SCFloatArrayRef Array1 = StudyData[0];



// Get the study data from the specified chart
    sc.GetStudyArraysFromChartUsingID(Input_Subgraph3Reference.GetChartNumber(), Input_Subgraph3Reference.GetStudyID(), StudyData);


    Array1 = StudyData[0];

    //Check if the study has been found.  If it has, GetArraySize() will return the number of Subgraphs in the study.
    if (StudyData.GetArraySize() > 0)
    {
        // Check if array is not empty.
        if (Array1.GetArraySize() != 0)
        {
            // Get last value in array
            float LastValue = Array1[Array1.GetArraySize() - 1];
        }

    }
}


If that doesn't work, maybe one of the ACSIL gurus around here can straighten us out.

Reply With Quote
  #3 (permalink)
TheDuke
Houston Texas/USA
 
Posts: 11 since Feb 2018
Thanks Given: 2
Thanks Received: 1


Yeah same thing...

Reply With Quote
  #4 (permalink)
ondafringe
Albuquerque, NM, USA
 
Posts: 124 since Jul 2012
Thanks Given: 87
Thanks Received: 117


TheDuke View Post
Yeah same thing...

Is the indicator you are trying to access located on the same chart or a different chart?

If on a different chart, is that chart in the same chart book and using the same time frame as the primary chart?

And what is the indicator you are trying to access?

Reply With Quote
  #5 (permalink)
TheDuke
Houston Texas/USA
 
Posts: 11 since Feb 2018
Thanks Given: 2
Thanks Received: 1

It's and indicator that was added on the chart. It is the bollinger squeeze. So this is getting plotted below the main chart...

Reply With Quote
  #6 (permalink)
ondafringe
Albuquerque, NM, USA
 
Posts: 124 since Jul 2012
Thanks Given: 87
Thanks Received: 117


TheDuke View Post
It's and indicator that was added on the chart. It is the bollinger squeeze. So this is getting plotted below the main chart...

I did a quick setup of the Bollinger Squeeze like this:

 
Code
SCSFExport scsf_StudyName(SCStudyInterfaceRef sc)
{

    SCGraphData StudyData;

    sc.GetStudyArraysFromChartUsingID(1, 10, StudyData);

    SCFloatArrayRef Array1 = StudyData[0];
    
    float test = Array1[sc.Index];
	
}

And test shows the value for the Bands Ratio (SG1).

Since the subgraph reference is 0-Based...

If I change to this:

SCFloatArrayRef Array1 = StudyData[1];

Then test shows the value for the Squeeze Indicator (SG2)

If you still can't access your indicator values like that, then not sure what's going on.

One thing to check: Click on Analysis -> Studies and make certain all your Study IDs are sequentially numbered. I seem to recall that if there is a missing Study ID number in the middle, studies after that can't be accessed.

So if you had five studies, IDs 1, 2, 3, 4, 5... and you deleted Study 3, and were left with 1, 2, 4, 5... then study 4 and 5 can't be accessed. As I recall, that happened to me in the past and I had to delete 4 and 5 and re-add them as 3 and 4.

But don't quote me on that! lol

And this may be what you were looking for on Sierra Chart:

Get Study Arrays From Chart Using ID

Reply With Quote
Thanked by:
  #7 (permalink)
TheDuke
Houston Texas/USA
 
Posts: 11 since Feb 2018
Thanks Given: 2
Thanks Received: 1

Wow! It ended up being that I had 2 charts open. So It was throwing me off....I appreciate your input on this. You really helped me navigate this wonderful world of Sierra ACSIL programming.

Reply With Quote
Thanked by:




Last Updated on October 16, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts