ACSIL - Getting the VPOC of a CUSTOM Volume Profile - Sierra Chart Programming | futures io social day trading
futures io futures trading


ACSIL - Getting the VPOC of a CUSTOM Volume Profile
Updated: Views / Replies:2,118 / 11
Created: by yonatan 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
 

ACSIL - Getting the VPOC of a CUSTOM Volume Profile

  #1 (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

ACSIL - Getting the VPOC of a CUSTOM Volume Profile

Does ACSIL have a way to get the VPOC of a Volume Profile that was drawn using the TOOLS >> Draw Volume Profile ?

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


Ok, so the solution is that this data can be approached using sc.GetStudyArrayUsingID. The VPOC data is held in the sc.Subgraph[1].Data array of the volume by price study.

Reply With Quote
 
  #4 (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 still need help here,

So far I understand that the VPOC data is held in the sc.Subgraph[1].Data array of the volume by price study, so my idea is to use sc.GetStudyArrayUsingID in order to get the Data of the first subgraph of the Volume by Price study.

What I still don't understand is - Once I pulled the VPOC Subgraph data into a SCFloatArray array I need to specify an Index for the SCFloatArray variable.
for an example:

SCFloatArray VPOC;
sc.GetStudyArrayUsingID(VP_ID.GetStudyID(),VPOC_SG.GetSubgraphIndex(),VPOC);
float POCatIndex = VPOC[Some Index];

(VP_ID, VPOC_SG are the inputs that specify the ID of the Volume Profile study and the SubGraph of the VPOC)

The VPOC is spanning through many bars so which Index should I use?

Reply With Quote
 
  #5 (permalink)
Elite Member
glostrup, denmark
 
Futures Experience: Advanced
Platform: Custom platform
Broker/Data: CQG
Favorite Futures: Futures, Options, Stocks
 
ktrader's Avatar
 
Posts: 249 since Aug 2011
Thanks: 151 given, 274 received


yonatan View Post
I still need help here,

So far I understand that the VPOC data is held in the sc.Subgraph[1].Data array of the volume by price study, so my idea is to use sc.GetStudyArrayUsingID in order to get the Data of the first subgraph of the Volume by Price study.

What I still don't understand is - Once I pulled the VPOC Subgraph data into a SCFloatArray array I need to specify an Index for the SCFloatArray variable.
for an example:

SCFloatArray VPOC;
sc.GetStudyArrayUsingID(VP_ID.GetStudyID(),VPOC_SG.GetSubgraphIndex(),VPOC);
float POCatIndex = VPOC[Some Index];

(VP_ID, VPOC_SG are the inputs that specify the ID of the Volume Profile study and the SubGraph of the VPOC)

The VPOC is spanning through many bars so which Index should I use?


The volumebyprice study uses a structure which is available to your study too. You could consider using this structure directly: sc.VolumeAtPriceForBars.

more information: ACSIL Interface Members - Variables and Arrays - Sierra Chart


--ktrader

Reply With Quote
 
  #6 (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

Hi @ktrader, thanks for your help.

My understanding id that the sc.VolumeAtPriceForBars refers to the volumes at the prices of a specific bar but here I am trying to get the poc of a custom Volume profile that spans through many bars. Am I missing something ?


Last edited by yonatan; March 16th, 2014 at 06:04 AM.
Reply With Quote
 
  #7 (permalink)
Elite Member
Alesia E.U.
 
Futures Experience: Intermediate
Platform: Sierra chart
Favorite Futures: Futures
 
Posts: 166 since Feb 2011
Thanks: 139 given, 109 received

Hi

take a look here
Using Drawing Tools from an Advanced Custom Study - Sierra Chart

hope can be useful

Reply With Quote
 
  #8 (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

Hi @crazybears, thanks.

I was surprised to find that the Volume Profile even appears on the TOOLS section because it is actually a study and not a tool. I will look into it although I doubt that the VPOC value will be there.
Thanks :-)

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
russia kaliningrad
 
Futures Experience: Intermediate
Platform: sc, custom
Favorite Futures: es,zn,zb
 
ludvig's Avatar
 
Posts: 11 since Jan 2011
Thanks: 0 given, 9 received

This code is an example how to get any profile values.
 
Code
#include "C:\SierraChart\ACS_Source\sierrachart.h"
#include <map>
using namespace std;

SCDLLName("Custom Profile Values") 

struct s_VolumeAtPriceV3 : s_VolumeAtPriceV2
{
	s_VolumeAtPriceV3()
		: s_VolumeAtPriceV2(0, 0, 0, 0)
	{
	}
};

SCSFExport scsf_CustomProfileValues(SCStudyInterfaceRef sc)
{
	
	int& FirstIndex = sc.PersistVars->i1;
	int& LastIndex = sc.PersistVars->i2;
	
	SCSubgraphRef VolumePOCPrice = sc.Subgraph[0];
	SCSubgraphRef askVolumePOCPrice = sc.Subgraph[1];
	SCSubgraphRef bidVolumePOCPrice = sc.Subgraph[2];
	SCSubgraphRef POCVolume = sc.Subgraph[3];
	SCSubgraphRef askPOCVolume = sc.Subgraph[4];
	SCSubgraphRef bidPOCVolume = sc.Subgraph[5];
	
	SCInputRef iNumBarsForProfile  = sc.Input[1];
	SCInputRef iBeginProfileBarsBack  = sc.Input[2];
	
	if (sc.SetDefaults)
	{
		sc.GraphName = "POC Volume";

		sc.StudyDescription = "";

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

		sc.FreeDLL = 0;

		sc.MaintainVolumeAtPriceData = 1;  

		iNumBarsForProfile.Name = "Number of bars in profile";
		iNumBarsForProfile.SetInt(10);
		
		iBeginProfileBarsBack.Name = "Bars back start";
		iBeginProfileBarsBack.SetInt(20);

		return;
	}
	
	if (((int)sc.VolumeAtPriceForBars->GetNumberOfBars() < sc.ArraySize)||(sc.Index < iBeginProfileBarsBack.GetInt()))
		return;
	
	if (sc.UpdateStartIndex == 0)
	{
		FirstIndex = 0;
		LastIndex = 0;
	}
	
	if (sc.Index < iBeginProfileBarsBack.GetInt())
		return;
		
		FirstIndex = sc.ArraySize - 1 - iBeginProfileBarsBack.GetInt();
		
		LastIndex  = FirstIndex + iNumBarsForProfile.IntValue; 
	
		if (LastIndex >= sc.ArraySize)
			LastIndex = sc.ArraySize - 1;
				
		
		map<int,s_VolumeAtPriceV3> ProfileMap;
	
		for (int Index = FirstIndex; Index<=LastIndex; Index++)
		{
			int CurrentVAPPriceInTicks = INT_MIN ; 
			const s_VolumeAtPriceV2 *p_VolumeAtPrice;
	
			while (sc.VolumeAtPriceForBars->GetNextHigherVAPElement(Index, CurrentVAPPriceInTicks, &p_VolumeAtPrice))
			{
				ProfileMap[CurrentVAPPriceInTicks] += *p_VolumeAtPrice;
			}
		}
		
			int bidVolumeAtPriceLevel = 0;
			int askVolumeAtPriceLevel = 0;
			int VolumeAtPriceLevel = 0;
			float Price = 0;
		
		for (map<int,s_VolumeAtPriceV3>::iterator VapIt=ProfileMap.begin(); VapIt!=ProfileMap.end(); VapIt++)
		{
			
			Price = VapIt->first*sc.TickSize;
			bidVolumeAtPriceLevel = VapIt->second.BidVolume;
			askVolumeAtPriceLevel = VapIt->second.AskVolume;
			VolumeAtPriceLevel = VapIt->second.Volume;
			
			  if (POCVolume[sc.Index] < VolumeAtPriceLevel)
	  		{
	  			POCVolume[sc.Index] = (float)VolumeAtPriceLevel;
	  			VolumePOCPrice[sc.Index] = Price;
	  		}
	  		if (askPOCVolume[sc.Index] < askVolumeAtPriceLevel)
	  		{
	  			askPOCVolume[sc.Index] = (float)VolumeAtPriceLevel;
	  			askVolumePOCPrice[sc.Index] = Price;
	  		}
	  		if (bidPOCVolume[sc.Index] < bidVolumeAtPriceLevel)
	  		{
	  			bidPOCVolume[sc.Index] = (float)VolumeAtPriceLevel;
	  			bidVolumePOCPrice[sc.Index] = Price;
	  		}
	  		
		}

}


Last edited by ludvig; March 29th, 2014 at 01:08 PM.
Reply With Quote
 
  #10 (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


@ludvig, thank you very much for this code. There is a lot that i can learn from it.

My problem here is that this code requires inputs of the Number of bars in the profile and the beginning Bar. What I need is a code that will scan a chart for all existing profiles on the chart, calculate their POC values and then use those values for other purposes.

But still there is a A LOT that I can learn from your code and I appreciate it very much.

Yonatan.

Reply With Quote

Reply



futures io > > > > > ACSIL - Getting the VPOC of a CUSTOM Volume Profile

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
Volume Profile/Market Profile Snapshot Indicator djkiwi The Elite Circle 63 March 4th, 2015 01:25 AM
TOS Monkey Bars (Mkt Profile) & Volume Profile TonyB ThinkOrSwim 39 November 29th, 2013 11:13 AM
[SC] Emulation of TPO (Market profile) with an ACSIL study Nicolas11 The Elite Circle 5 August 27th, 2013 03:50 AM
Possible Volume Delta, CD, Volume Profile in NT8, vs MC8.5 ilikeread NinjaTrader 9 April 2nd, 2013 02:54 PM
ACSIL: a function that returns the price with the highest volume within a bar yonatan Sierra Chart Programming 14 September 25th, 2012 08:07 PM


All times are GMT -4. The time now is 06:03 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-11 in 0.13 seconds with 19 queries on phoenix via your IP 54.82.79.109