Login Page - Create Account

Support Board


Date/Time: Wed, 26 Jan 2022 04:36:52 +0000



Detect changes in Window Size/scale

View Count: 1455

[2013-04-29 23:03:35]
ejtrader - Posts: 663
SC Team - Have been using the new GDI capabilities you have introduced and has been working fine.

In order to avoid un-necessary calculations - Need some kind of an universal flag to say - Window properties is changed so that I can re-polulate data meant for GDI.

Typical conditions for this that I can think of:
- Scroll bar is used ( value of 1 )
- Window Height is changed ( value of 2 )
- Chart scale is changed ( value of 3 )
- or any other typical window property is changed that you can think of that would cause the display dimentions/visible candles to change. ( some numeric value )

Would it be possible for you to provide a function - that says - " sc.ChangeWinProp " ? Basically need a function determine whether the recalculation of any co-ordinates are needed in an efficient manner rather than performing the objects/co-ordinates on every tick. However I do understand the need to "paint" on every tick.

PS: you might be already capturing these events already to account for all the above events.

Thanks
Date Time Of Last Edit: 2013-04-30 03:16:19
[2013-04-30 18:59:15]
Sierra Chart Engineering - Posts: 100044
It would be better if we pass to the drawing function, the functions to calculate Pixel coordinates from bar indexes and graph values.

Seems as though this would solve the underlying issue.

If any of the events you have described occur, the window is simply redrawn and then we use those functions to determine the actual coordinates when drawing study graphs.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-04-30 18:59:51
[2013-04-30 19:49:40]
ejtrader - Posts: 663
Thank you SC team.

However the problem at present is: As the SC Structure is not available to DrawChart function - need to "pre-polulate" the pixel information by a separate function let's say "PopulatePixels". This function need to be aware of the window size etc(what bars are visible, whether the High/Low Price visibility changed, did the scroll bar used which would make the visible bars changed etc all the time and need to be calculated constantly - and probably a little bit costly operation). At present only way to control this is to keep populating this information for every tick(PopulatePixels) - though the information might not necessarily changed.

In general circumstances - we tend to reduce the CPU usage either calculate at the first tick or bar close but when it comes to GDI - we can't depend on the bar to close - there could be several events that are likely to change which would require PopulatePixels to be re-calculated - and this specific function - I want to trigger if there is an external function made available like "sc.ChangeWinProp".

Even if you don't provide this function it's alright.. GDI support is probably one of the "best/Powerful" enhancements you have introduced to this platform recently that I can think of :) Just trying to best make use of it in an efficient manner.. If SC structure was available to "DrawChart" function - then it would be an entirely different story and what you mentioned about letting SC handle the populate/draw functions handled by draw function..

In any case - even if you don't make any further improvements in this area - this is good enough this way..

Thanks



PopulatePixels(sc); // This needs to be called on every tick as this function is dependent on visible data on chart
sc.p_GDIFunction = DrawChart; // Code in DrawChart would make use of the Global values populated by above function


Ideally wanted to have the code like this if the window function was available:


// pseudo Code
if ( sc.WindowChanged or "Bar Number changed(pseudo)" ) PopulatePixels(sc); // I would imagine this might be an optimal way
sc.p_GDIFunction = DrawChart;

Date Time Of Last Edit: 2013-04-30 20:41:03
[2013-05-05 11:03:53]
Sierra Chart Engineering - Posts: 100044
We have some ideas about this. We will get back to this in the next few days.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-06-04 21:14:27]
ejtrader - Posts: 663
SC Team - Just thought of bumping up to hear your ideas about this - whenever you would have a chance to get to them. No rush on this as you are busy with several other tasks on hand.

Thanks
[2013-06-06 00:12:51]
Sierra Chart Engineering - Posts: 100044
Please allow another 30 days. We apologize but that's the best we can do.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account