Login Page - Create Account

Support Board


Date/Time: Wed, 30 Oct 2024 22:56:05 +0000



[Programming Help] - Protecting studycollection with an 'expiration date'

View Count: 734

[2023-01-06 05:06:42]
User61168 - Posts: 403
Hello,

This is my very first request for assistance since I began using Sierra Chart on Oct 1st 2018! I have an algo developed for automated trading using simple alerts only. I know I can password protect each study in the collection. What I am struggling to do is disable the study collection once an expiration date is passed (i.e. prevent the algo from running if it gets stolen or hacked) . I do not want the collection to show any bar data or even run in market replay mode after this expiration date is passed. If there is a simple feature or solution available for use, I would really appreciate it.

I also need to know how to do this in simple alert formula:

1) check the system date (today's date and time and not the current BARDATE and BARTIME). Edit: I know of the NOW() function but need an example
2) How to set the bar color to whatever the chart background color is when a alert condition is met (in essence, conditionally hide the bar color (or entire chart for that matter) to make it invisible when condition is met without selecting the background color for the subgraph in the study)

Thanks for your assistance in advance.

EDIT: moving to user discussion to see if someone has developed a solution.
EDIT1: Please ignore question #1... TODAY()>DATEVALUE("1/31/2023") should do the trick.
Date Time Of Last Edit: 2023-01-06 07:13:02
[2023-01-06 14:06:08]
Sawtooth - Posts: 4103
2) Try this:
Add the Spreadsheet Formula (Bar) study.
- Set the Chart Region to 1.
- Put your expiration formula in all 4 Formula fields:
=TODAY()>DATEVALUE("1/31/2023")

When TRUE, the OHLC values will all have a value of 1, drawing a line at the value of 1.
Date Time Of Last Edit: 2023-01-06 14:28:25
[2023-01-06 17:35:06]
User61168 - Posts: 403
Thanks Tom. I really appreciate it very much. This is not what I am looking for. If today() exceeds the expiration date then I want ALL historical bars loaded in the chart along with all indicators etc to go completely blank and not just the bars past a certain expiration date... in essence 'locking' the entire study collection or chart or chartbook to avoid reverse engineering. Also, my chart type is renko and not a time-based chart.
[2023-01-06 19:50:24]
Sawtooth - Posts: 4103
You could filter each indicator individually with a Spreadsheet Formula study, using the same expiration formula.
You would Hide each indicator, and its value would instead be displayed by the Spreadsheet Formula study, which has the expiration filter.

This would not prevent the user from deleting the Spreadsheet Formula studies, and unhiding the unfiltered indicators.
So I suspect that the only real solution is to create a custom ACSIL study.
[2023-01-06 20:04:08]
ForgivingComputers.com - Posts: 952
A custom study can be authorized on a per-user basis, and expiration dates can be applied. When the study expires, it will no longer show any previous signals on the chart. If there are standard indicators you want to add an expiration to, and if the source code has been provided by Sierra Chart, then they can be locked as well. This works with all bar period types. Any method that has the date in the spreadsheet itself complicates having individual dates per user.

While the user can no longer use the studies once the chartbook is reopened after the expiration date, there is no guaranteed way to delete the Study Collection files, as backups could have been done before the deletion.

DM or email me for more information.

brad (at) forgivingcomputers (dot) com
[2023-01-06 20:27:20]
User61168 - Posts: 403
Thanks Brad and Tom.

Brad - I will email you more specifics on what I am trying to accomplish in next month or so... it's much more than complex than what I have written here as far as needing a longer term "universal" solution. I need something that I can plug-n-play into all my live study collections running on a VPS server as I plan to hire couple of remote IT system administrators to manage and monitor these algos and the underlying infrastructure on cloud. To start off, I was just thinking of a simple way to blank out the entire chart, hide all the indicators and then password protect each of the individual studies and put an expiration date in the entries alert study... just to address the risk of someone running off with my algo.

I wish there was a way to create a "read-only" login credential in Sierra Chart that I can give to their IT guys so they don't mess with any chart settings and fudge around.
[2023-01-06 20:32:02]
User61168 - Posts: 403
...This would not prevent the user from deleting the Spreadsheet Formula studies, and unhiding the unfiltered indicators.
So I suspect that the only real solution is to create a custom ACSIL study.

Tom - wouldn't password protecting each of the formula studies prevent the deletion of studies? I hope that is the case otherwise what is the point of doing a password protect if they can just delete the study... I don't get the benefit of this feature.
[2023-01-06 21:10:11]
Sawtooth - Posts: 4103
wouldn't password protecting each of the formula studies prevent the deletion of studies?
TBH, I don't know. If it does, then the workaround should work, albeit clumsily.
[2023-01-29 06:23:00]
User61168 - Posts: 403
Hi Tom, Sierra chart is allowing me to delete a password-protected study within the study collection. The main purpose of password-protected studies is to just hide the underlying study parameters and alert formulas and that's about it. Not a whole lot of practical use of it imo. Introducing a password to protect the entire study collection is what I am looking for and perhaps to also prompt user to enter password every time it is applied to a chart.
[2023-01-29 13:15:37]
Sawtooth - Posts: 4103
Introducing a password to protect the entire study collection is what I am looking for
Sierra Chart is extremely flexible for many things users want to do, but this is one where ACSIL is required.
[2023-01-29 19:26:42]
User61168 - Posts: 403
It's a struggle but I might be overthinking this. Knowing that all password protected studies in a collection could be deleted, I could do the following:
- password protect all studies
- Create a new password protected "Check Expiration" Alert condition (say ID5.SG1 which returns 1 on success) to put background color as "black" to "hide" all bars if today (i.e. server system date and not local desktop system date) is past 2/15/2023. This should "blank out" all bars in history as well as all future bars... something like ServerDateTime>DATEVALUE("02,15,2023"). Could you please help me with this formula to fetch server date? local desktop system clock could be manipulated so it has to be server date.

- in my alert formula for trade entry study, I simply put a criteria ID5.SG1<>1 as a criteria to allow trade entries if today's system date is not past the expiration date.

If ID5 is deleted, then my entry alert condition should result in a error/failure resulting in no live or simulated or replay trades :-)

Edit: Not background color, I mean Color bar. Even if i am unable to "hide" the bars, that fine as setups are coded via alert formulas
Date Time Of Last Edit: 2023-01-29 19:35:23
[2023-01-29 19:50:30]
ForgivingComputers.com - Posts: 952
This should "blank out" all bars in history as well as all future bars... something like ServerDateTime>DATEVALUE("02,15,2023"). Could you please help me with this formula to fetch server date? local desktop system clock could be manipulated so it has to be server date.

Hiding the bars on the chart will not remove their values from a spreadsheet study.
[2023-01-29 19:58:54]
User61168 - Posts: 403
Hiding the bars on the chart will not remove their values from a spreadsheet study.
Hi Brad, I am only using Simple Alert formulas which I am trying to protect from reverse engineering. I have gone thru the over-simplification journey of removing all the 50+ studies by converting them into custom formulas so I am not too worried about hiding the visuals. I just want to prevent the algo from executing in a live/simulated/replay modes after a given date.

Edit: Thinking further, I understand now what you are saying Brad. That's a very good point to take into consideration. A single universal password protection at the entire study collection level is required to have a solid protection.
Date Time Of Last Edit: 2023-01-29 22:33:19
[2024-09-08 04:41:24]
User61168 - Posts: 403
Hi guys,

I am returning here after 20 months with the same pending need to password protect my entire study collection in order to "outsource" some of the routine/mundane administrative and platform monitoring tasks. I am curious if there are any new features introduced in ASCIL to add this protection? I can't be the only one needing this feature :-(

Moving to Programming help section
Date Time Of Last Edit: 2024-09-08 04:41:54
[2024-09-08 17:50:24]
ondafringe - Posts: 281
If I needed to create/distribute an ACSIL custom study, and I was *serious* about treating this like a business, and I wanted to retain *complete* control over every aspect, especially the ability to grant/restrict access, using Visual Studio, I think I would:

1. Create a single, ACSIL custom study that includes everything I wanted to protect (and C++ is harder to reverse engineer)
2. Make certain my custom study was created in a way that prevents memory conflicts should the study be loaded on multiple charts
3. Create a C# Minimal Web API that uses some flavor of SQL as a database
4. Create a number of SQL stored procedures to perform relevant tasks on the database
5. Add Authentication/Authorization to the API
6. Register a domain name, find a domain/SQL host, and deploy my API to that host
7. Add code to my custom study that runs in the background to get the user's account number, and access my API's endpoints
8. Create a C# Windows app -- for my use only -- to access my API in order to perform admin tasks on the database

As far as distribution: I would create an email address with an auto-responder. If someone sends an email to that address, the auto-responder would send them instructions on how to use the custom study... and it would either send them a copy of the study as an attachment, or include a link where the study could be downloaded.

Once I had all that, my custom study would automatically add new users to the database... allow free trials... check for access permission. And using my admin app, I could grant/restrict access for one, multiple, or all users... force users to download and use a new version... check for payment... and who knows what else. And since one study/same code works for all users, it wouldn't matter if users passed my study around to anyone or everyone. In fact, passing the study around to other users would simply add one more distribution channel.

But, hey, that's just the way I would do it! lol
Date Time Of Last Edit: 2024-09-08 18:11:56
[2024-09-08 18:30:50]
User61168 - Posts: 403
Thanks ondafringe. Quite the robust process you got there. All good except there is no “distribution” involved. I will have one study collection run on a single instance of SC per symbol and scale up is done horizontally via subaccounts and across more symbols(algo design constraints) instead of vertical via increasing position qty and via order allocation.

I would hire one or two of my old friends/colleagues on payroll to monitor SC platform and perform some admin function related to accounting, reporting, account admin functions like intra sub-account funds transfer etc. I also do not want to watch my own algo running every darn day. Everything will run on dedicated server.

Eventually, after this process matures (6-12 months), I will hire ASCIL programmer to convert my entire study collection into a single custom study with all the bells/whistles and distribution capabilities. For now, I just want a simple capability of “leakage/theft protection”.

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

Login

Login Page - Create Account