ACSIL: How do I get the time value of a Vertical line that I have drawn on the chart - Sierra Chart Programming | futures io social day trading
futures io futures trading


ACSIL: How do I get the time value of a Vertical line that I have drawn on the chart
Updated: Views / Replies:1,287 / 7
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: How do I get the time value of a Vertical line that I have drawn on the chart

  #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: How do I get the time value of a Vertical line that I have drawn on the chart

I want my study to use the Time value of a Vertical line that I have manually drawn on the chart and the Price value of a Horizontal line that I have manually drawn on the chart. Any idea how I can get those values ?

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

Getting line values



yonatan View Post
I want my study to use the Time value of a Vertical line that I have manually drawn on the chart and the Price value of a Horizontal line that I have manually drawn on the chart. Any idea how I can get those values ?

You can do like this:

 
Code
#include "C:\Sierrachart\ACS_Source\sierrachart.h"

SCDLLName("GetLineValue")

SCSFExport scsf_GetLineValues(SCStudyInterfaceRef sc)
{	
	if (sc.SetDefaults)
	{
		sc.GraphName = "GetLineValues";		
		sc.StudyDescription = "";		
		sc.GraphRegion = 0;		
		sc.FreeDLL = 1;		
		return;
	}


	s_UseTool line;
	
	if (sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 0))
 	{

		SCString str;	
		float val = line.BeginValue;
		str.Format("Horizontal line, value: %f",val);
 		sc.AddMessageToLog(str, 0);
 	}

	if (sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 0))
 	{

		SCDateTime dt = line.BeginDateTime;
		int yy,mm,dd,h,m,s;
		dt.GetDateTimeYMDHMS(yy, mm, dd, h, m, s);
		int barindex = line.BeginIndex;
		SCString str;	
		str.Format("Vertical line, barindex:%d, time: %d:%d",barindex,h,m);
 		sc.AddMessageToLog(str, 0);
 	}
}

Reply With Quote
The following user says Thank You to ktrader for this post:
 
  #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


ktrader View Post
You can do like this:

 
Code
#include "C:\Sierrachart\ACS_Source\sierrachart.h"

SCDLLName("GetLineValue")

SCSFExport scsf_GetLineValues(SCStudyInterfaceRef sc)
{	
	if (sc.SetDefaults)
	{
		sc.GraphName = "GetLineValues";		
		sc.StudyDescription = "";		
		sc.GraphRegion = 0;		
		sc.FreeDLL = 1;		
		return;
	}


	s_UseTool line;
	
	if (sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 0))
 	{

		SCString str;	
		float val = line.BeginValue;
		str.Format("Horizontal line, value: %f",val);
 		sc.AddMessageToLog(str, 0);
 	}

	if (sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 0))
 	{

		SCDateTime dt = line.BeginDateTime;
		int yy,mm,dd,h,m,s;
		dt.GetDateTimeYMDHMS(yy, mm, dd, h, m, s);
		int barindex = line.BeginIndex;
		SCString str;	
		str.Format("Vertical line, barindex:%d, time: %d:%d",barindex,h,m);
 		sc.AddMessageToLog(str, 0);
 	}
}

Awesome ktrader, much thanks.

Now, if I have a few Horizontal and Vertical lines on the chart and I wish to retrieve those values for a specific line am I correct by assuming that I will have to create this specific line with an ACSIL code and assign to it a "LineNumber" and then I will be able to get its values with sc.GetUserDrawingByLineNumber() ?

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
Awesome ktrader, much thanks.

Now, if I have a few Horizontal and Vertical lines on the chart and I wish to retrieve those values for a specific line am I correct by assuming that I will have to create this specific line with an ACSIL code and assign to it a "LineNumber" and then I will be able to get its values with sc.GetUserDrawingByLineNumber() ?

Yes, you can do that. Or if you know how many lines you add you can utilize they are numbered sequentially so:

first horizontal line you add (manually on the chart) you get by:

sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 0)

second one with
sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 1)

first vertical: sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 0)
second vertical: sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 1)

Reply With Quote
The following user says Thank You to ktrader for this post:
 
  #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


ktrader View Post
Yes, you can do that. Or if you know how many lines you add you can utilize they are numbered sequentially so:

first horizontal line you add (manually on the chart) you get by:

sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 0)

second one with
sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, line, 1)

first vertical: sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 0)
second vertical: sc.GetChartDrawing(0, DRAWING_VERTICALLINE, line, 1)


Great. Thanks again ktrader. This was very very helpful.

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

Along these same lines...

I'm auto-drawing ellipses, I have:

s_UseTool EllipseTool;
EllipseTool.AddMethod = UTAM_ADD_OR_ADJUST;

and when the tool gets drawn I set:

int uid = rand();
EllipseTool.LineNumber = uid;

The Ellipse drawing starts and then a couple of bars later, when certain parameters are met, I want to "close" the Ellipse.
How do I call *that* particular Ellipse?

I have this, and works about 90%:

if (sc.LineExists(sc.ChartNumber, uid)
{
blah;
}

many tools are drawn and closed as expected, however one seems to be hanging from the beginning of the chart to the current index. Which leads me to believe the code has missed this particular LineNumber, or something. Which then leads me to believe that I need more control and how to call each generated Ellipse. Any ideas?

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


funk101 View Post
I'm auto-drawing ellipses, I have:

s_UseTool EllipseTool;
EllipseTool.AddMethod = UTAM_ADD_OR_ADJUST;

and when the tool gets drawn I set:

int uid = rand();
EllipseTool.LineNumber = uid;

The Ellipse drawing starts and then a couple of bars later, when certain parameters are met, I want to "close" the Ellipse.
How do I call *that* particular Ellipse?

I have this, and works about 90%:

if (sc.LineExists(sc.ChartNumber, uid)
{
blah;
}

many tools are drawn and closed as expected, however one seems to be hanging from the beginning of the chart to the current index. Which leads me to believe the code has missed this particular LineNumber, or something. Which then leads me to believe that I need more control and how to call each generated Ellipse. Any ideas?


Hi Funk101, I think you better post this in the main sierra charts programming forum (Sierra Chart Programming - Big Mike's Trading Forum) so it will not hide here in this thread.

Reply With Quote

Reply



futures io > > > > > ACSIL: How do I get the time value of a Vertical line that I have drawn on the chart

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
Daily Vertical line indicator deandavis NinjaTrader 22 October 15th, 2017 08:49 AM
Shorter vertical line with DrawLine Randwulf NinjaTrader Programming 3 May 3rd, 2012 08:49 AM
Drawn trend line automatically on other charts, How? hector24 NinjaTrader 4 November 2nd, 2011 01:32 PM
Global Vertical Line Indicator EDGE NinjaTrader Programming 1 October 12th, 2010 12:09 AM
Vertical line for Jeff Castille AkLio The Elite Circle 32 May 1st, 2010 04:50 PM


All times are GMT -4. The time now is 10:37 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-10 in 0.10 seconds with 19 queries on phoenix via your IP 54.221.73.186