Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 12:22:19 +0000



[Programming Help] - Modification of Spreadsheet Formula Study

View Count: 476

[2023-12-03 10:30:12]
User61168 - Posts: 403
Hello ASCIL developers,

I read some posts where SC allows modification of delivered studies via ASCIL. I am curious if anyone could modify the spreadsheet formula study >> Spreadsheet Formula to include the following two features:

1) Create an enable/disable switch for this study
2) Include a new input parameter to calculate the formula only at Bar Close.

Also/kindly share if there exists a list of all such modifiable studies.
Date Time Of Last Edit: 2023-12-03 10:34:07
[2023-12-03 11:37:00]
User431178 - Posts: 543
Here you go, built on version 2567.
attachmentSpreadsheetFormula.cpp - Attached On 2023-12-03 11:36:40 UTC - Size: 2.19 KB - 421 views
attachmentSpreadsheetFormula_64.dll - Attached On 2023-12-03 11:36:52 UTC - Size: 889 KB - 158 views
[2023-12-03 11:39:57]
User431178 - Posts: 543
Also/kindly share if there exists a list of all such modifiable studies.
You can search the studies available for modification etc by following in the instructions linked below.

How to Build an Advanced Custom Study from Source Code: Searching for Source Code for Sierra Chart Built-In Studies
[2023-12-03 13:27:59]
User61168 - Posts: 403
Wow! That was unbelievably quick. Thanks a lot. I have been wanting this feature for a long time. I will try it out for color bar based on Alert condition study as well... mainly to improve performance via disabling the study. As I have suggested in the past, every study should have a enable/disable feature. You just made my day!
Date Time Of Last Edit: 2023-12-03 13:33:58
[2023-12-03 16:37:22]
User431178 - Posts: 543
There is a copy/paste error in the earlier code.
It still works fine, but should be set a lower precedence level.
Updated code attached.
attachmentSpreadsheetFormula.cpp - Attached On 2023-12-03 16:37:12 UTC - Size: 2.24 KB - 230 views
[2023-12-04 05:53:54]
User61168 - Posts: 403
Thanks dude. I was able to remote build and it works great! I can now move all my coded spreadsheet formula (40+) studies into my baseline study collection and just disable/enable them as and when I need to use them in my strategies. Hopefully having too many disabled studies won't take a performance hit.

Since you are soooooo good, let me ask you if there is a way in ASCIL to:
1) completely disable the entire study collection? This will allow me to have a lot of charts in a single chartbook without taking any performance hit.
2) disable data feed going into a single chart. I am trying to avoid CPU/GPU overhead caused by charts that are open in chartbook but inactive or not-in-use state. Looking for a simple one-click toggle operation to reduce load of CPU/GPU.

Much appreciated.
[2023-12-04 09:36:50]
User61168 - Posts: 403
Hello User431178,

Sorry to nudge you again. Looking at the cpp codeset, it appears most (if not all) studies that comes delivered with SC platform are developed in ASCIL. If this is true then does it makes sense for me to eventually convert all my simple alert automated strategies into ASCIL just to improve execution performance? So far, I have intentionally stayed with simple alerts and ignored spreadsheet based autotrading with the desire to eventually move my strategies directly into ASCIL after a year or so of live trading.

I am curious if you would have any recommendation on the path I should take. So far, I have not felt the need to move away from simple alerts as my contract size/MM will remain small for 8-12 months and slippage has been bearable except during news time (I ignore news and prefer my algos to run during news releases).

I think performance gain is probably the only reason why I would want to convert my strategies into ASCIL. If there are any published metrics on how much better is ASCIL vs simple alerts, that would be great. Also, most of my algos have 50+ studies and over 70% of these studies are only for "visual aid" and post trade analysis. I usually hide/disable such studies during trade executions.
[2023-12-04 14:03:12]
User431178 - Posts: 543
Hello

To answer your first questions:

1) No, not that I am aware of.
2) No, the best you can do is hide the chart window, which will reduce the graphics load.

Window, CB and CW Menus: Hide Window (Window)

Hopefully having too many disabled studies won't take a performance hit.
You'd have to benchmark it in some way, as it will be somewhere in between, i.e. disabled is not going to be equivalent to removed.

I am not aware of any published metrics with regards to ACSIL vs. simple alerts, and honestly it probably wouldn't be very useful anyway, given that there are a million and one different ways to configure each. You could work out what sort of improvement would be needed to have a positive effect on your bottom line, then benchmark what you already have to see if there is even a realistic possiblity of making such gains.
[2023-12-04 22:04:56]
User61168 - Posts: 403
Thanks again. I should probably mention that adding too many disabled studies will only be during the development/test phase as I am finding it quite hard to manage all my collections and keep track of which strategy does what with tradestats in which sim account etc. Just trying to simplify the SDLC process and release/version control by creating a single set of baseline studies and one universal chart configuration. For now, I will stick to simple alerts until latency/slippage becomes unacceptable.

disabled is not going to be equivalent to removed
- I am hoping disabled study works the same as "commented" code in C++ for the compiler to simple ignore. If the platform is going to check for each study whether it is enabled or disabled at every tick then it would definitely add some load to process. I will run some tests to confirm this even though disabled shows a 0ms in studies window.
Date Time Of Last Edit: 2023-12-04 22:05:37
[2023-12-06 04:14:01]
User61168 - Posts: 403
Hello User431178,

Wondering if you can help me with one more request. I have been looking for a way to do a max zoomin and max zoomout one-click feature. Maxzoomin should show only one entire bar on the chart (so zooming needs to work on both x and y axis to place the bar in the middle of the chart). max zoom out should show the entire chart proportionally to the x and y axis. I googled and found the attached cpp on github from Frozen Tundra. Would it be possible to alter the zooming logic to do a complete and full max zoom in and zoom out feature. It uses the spacebar as hotkey which is fine. Or if it is easier, a rapid multi-press of spacebar to zoomin/out is also fine. I am just tired of dragging mouse left/right on x-axis numerous times to zoom in and out. I would really appreciate your time.

Edit: Alternatively, you could have two inputs... one for zoomin level and another one for zoomout level. whichever option is easier and quicker to modify.
Edit: It should also not mess up my scale settings. I use "scale range: Constant Range" on all my charts. The ASCIL should simulate what the mouse does when you drag left/right on x-axis.
Date Time Of Last Edit: 2023-12-06 04:21:15
attachmentFrozenTundra-zoom_toggle.cpp - Attached On 2023-12-06 04:13:55 UTC - Size: 4.14 KB - 147 views

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

Login

Login Page - Create Account