Is it possible to Get graphics/Windows control in SC/ACSIL? - Sierra Chart Programming | futures io social day trading
futures io futures trading


Is it possible to Get graphics/Windows control in SC/ACSIL?
Updated: Views / Replies:831 / 1
Created: by ejtrader 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
 

Is it possible to Get graphics/Windows control in SC/ACSIL?

  #1 (permalink)
Elite Member
Portland, OR
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES
 
Posts: 269 since Jan 2011
Thanks: 326 given, 179 received

Is it possible to Get graphics/Windows control in SC/ACSIL?

Hello - Need some help/guidance/clarification dealing with better graphics control in Sierra platform for generic graphics related tasks.

In Ninja - One can have better control over plots using plot(Graphics graphics, Rectangle bounds, double min, double max) etc and can use various brushes etc to draw text/rectangles etc with ease. I am trying to mimic something similar in Sierra but so far stuck with this task.

Has anyone done any work in this space in Sierra? Can any one review this code and suggest any options?

Wondering if anyone has done any work with Windows GDI so that I can convert portion of the code from Ninja to Sierra ( Graphics graphics, Rectangle bounds, double min, double max) - https://www.sierrachart.com/supportboard/showthread.php?t=32647

PS: Have opened a thread in Sierra forum as well - https://www.sierrachart.com/supportboard/showpost.php?p=233188&postcount=12

Code:
 
Code
	if (sc.SetDefaults)
	{
		sc.GraphName = "UseTool";
		sc.StudyDescription = "UseTool";
		sc.GraphRegion = 0;
		sc.FreeDLL = 1;
		
		sc.AutoLoop = 0; 

		return;
	}

	if (sc.UpdateStartIndex == 0)
	{
		sc.NumFillSpaceBars = 20;
		sc.PreserveFillSpace = true;
		sc.UpdateAlways=1;
	}
	
        static const int UniqueLineNumber = (sc.ChartNumber+sc.StudyGraphInstanceID)*1000;

	s_UseTool Tool;
	Tool.Clear();

	Tool.ChartNumber = sc.ChartNumber;
	Tool.Region = sc.GraphRegion;
	Tool.DrawUnderneathMainGraph=1;
	Tool.TextAlignment = DT_RIGHT | DT_VCENTER;

	int BarIndex=sc.IndexOfLastVisibleBar;
	float BarValue=sc.Close[BarIndex];
	SCString ValueText=sc.FormatGraphValue(BarValue,sc.GetValueFormat());
	int offset=(int)(sc.NumFillSpaceBars/3);
	int lineStartIdx=BarIndex;
	int lineEndIdx=BarIndex+offset;
	int rectStartIdx=lineEndIdx;
	int rectEndIdx=rectStartIdx+ValueText.GetLength();  // Is this the correct way to get the string length? Based on the image - it doesn't look like
	int textStartIdx=rectStartIdx;

	Tool.Clear();
	Tool.Tool=DRAWING_LINE;
	Tool.TextAlignment=DT_RIGHT;
	Tool.LineNumber =  UniqueLineNumber + 1;
	Tool.BeginIndex=lineStartIdx;
	Tool.EndIndex=lineEndIdx;
	Tool.BeginValue=BarValue;
	Tool.EndValue=BarValue;
	Tool.Color = RGB(255,0,0);
	Tool.LineWidth = 1;
	Tool.AddMethod = UTAM_ADD_OR_ADJUST;
	sc.UseTool(Tool);

	Tool.Clear();
	Tool.ChartNumber = sc.ChartNumber;
	Tool.Tool = TOOL_RECTANGLE_HIGHLIGHT;
	Tool.LineNumber = UniqueLineNumber + 2;
	Tool.BeginIndex=rectStartIdx;
	Tool.EndIndex=rectEndIdx;
	// Ideally Begin/End Values for Rectangle should be calculated based on the Text Real Height - which is dependent on the font-size
	// But Don't know how to calculate this in SC..
	Tool.BeginValue=BarValue+(sc.TickSize/2);  // there should be an intelligent way to handle this based on font size and should be independent of the scaling/instrument
	Tool.EndValue=BarValue-(sc.TickSize/2);   // there should be an intelligent way to handle this based on font size and should be independent of the scaling/instrument
	Tool.Color = RGB(255,0,0); // Red
	Tool.LineWidth = 1;
	Tool.SecondaryColor = RGB(0,255,0); // Green
	Tool.TransparencyLevel = 90;
	Tool.AddMethod = UTAM_ADD_OR_ADJUST;
	sc.UseTool(Tool);

	Tool.Clear();
	Tool.DrawingType = DRAWING_TEXT;
	Tool.LineNumber = UniqueLineNumber + 3;
	//Tool.UseRelativeValue = true;
	Tool.Color = RGB(255,255,255);  //WHITE
	Tool.TextAlignment = DT_RIGHT | DT_VCENTER;
	Tool.FontBackColor = sc.ChartBackgroundColor; //   GREEN;
	Tool.FontBold = false;

	Tool.Text = ValueText;
	Tool.BeginValue = BarValue;
	//Tool.BeginIndex=textStartIdx;  // Don't know why can't get this to work instead of BeginDateTime
	Tool.BeginDateTime=sc.BaseDateTimeIn[BarIndex+10];  // Would be nice to get this into BarIndex mode rather than time
	Tool.FontSize = 10;
	Tool.AddMethod = UTAM_ADD_OR_ADJUST;
	Tool.ReverseTextColor = false;
	sc.UseTool(Tool);

Attached Thumbnails
Is it possible to Get graphics/Windows control in SC/ACSIL?-sc_text_rectangle_1.png   Is it possible to Get graphics/Windows control in SC/ACSIL?-sc_text_rectangle_2.png   Is it possible to Get graphics/Windows control in SC/ACSIL?-ninja_text_in_rectangles.png  

Last edited by ejtrader; February 10th, 2013 at 09:09 PM.
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.


Reply



futures io > > > > > Is it possible to Get graphics/Windows control in SC/ACSIL?

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
Graphics cards c12345 Tech Support 24 April 30th, 2017 01:16 AM
Instructional videos about ACSIL with Visual studio and other ACSIL programming t yonatan Sierra Chart Programming 2 January 29th, 2013 03:34 PM
virtual desktop and extra windows control gktk Tech Support 0 January 27th, 2012 07:31 AM
Graphics question zeller4 NinjaTrader Programming 3 July 3rd, 2009 10:11 AM
More graphics Poocher Feedback and Announcements 1 June 15th, 2009 11:12 PM


All times are GMT -4. The time now is 11:21 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-14 in 0.08 seconds with 20 queries on phoenix via your IP 54.227.51.103