Is it possible to put an expiration date on a trading system code without the user being able to see or modify it? If the answer is yes, how?
Thank you
You simply have to clear any signal, in case of expiration, just before the line with RETURN.
Assuming your indicator returns data in a variable named SIGNAL, this is the code to clear it on expiration (say on and after Dec. 31, 2023):
.
.
.
IF Date >= 20231231 THEN
Signal = 0
ENDIF
RETURN Signal AS "My Signal"
to make an indicator hidden you’ll have to export it selecting one of the two options that prevent the code from being modified (and read). The last one adds the restriction that it can only be imported once, so that it cannot be shared with someone else nor used on multiple accounts (as from attached pic).
Thanks Roberto, but what if it’s a trading system and not an indicator instead?
As you will know, there you don’t use the RETURN statement except only to plot elements on the graph if I’m not mistaken.
Only indicators can be hidden, so you will have to split the strategy into two parts, an indicator (protected) and a strategy (not protected) which CALLs the indicator fron which to get signals. A better alternative is to use MarketPlace.
Here you can find some links and info: https://www.prorealcode.com/topic/hidden-the-strategy-code/#post-223224.