Hi guys not sure if someone can help me. I want to send a strategy to someone but I need to code an expiry date so after 1 month they can’t access any longer. Can anyone help me or point me in right direction. Just need help with code for expiration date.
Thanks
Since you are asking this, I assume you already know how to protect a strategy.
Si you only need to set an expiration date in your protected indicator, like this (assuming your RETURNed value is X:
// your indicator
.
.
. X = ....
IF Date <= 20291231 THEN //expires on Dec. 31st 2029
x = 0
ENDIF
RETURN X
Please DO NOT double post.
I removed the other one.
Thank you 🙂
Apologies for the double post I posted in Spanish and English site I haven’t used a forum before. Thank you for your response but I don’t have a protected indicator I just want to pass my strategy to a colleague but only allow him to use it for 1 month. I’m just not sure what sentence / formula I should insert in the code of the strategy. Its extremely kind of you to respond to me really appreciated.
Strategies cannot be protected, so no expiration is possible.
Indicators, on the other hand, CAN BE protected, so the solution is to RETURN long/short signals via an indicator CALLed from within your strategy, which will remain open, but only to manage orders and positions.
Your client will see your strategy but will never know why signals are returned.
To know more you can read
https://www.prorealcode.com/topic/prorealcode-marketplace-sell-your-trading-products-to-thousands-of-prorealtime-users/
https://www.prorealcode.com/topic/call-function-guidance/#post-135323
https://www.prorealcode.com/topic/hidden-code/