Hello,
I need to code a lot of indicators and share it with friends or other people. But I need to set a “end date” to use it. Example: This indicator is ending one year later to 10/14/2020 and is function is off.
With which code can I realize?
Thanks
enuxx
You can add something like this to your code:
if opendate < 20201014 then
result = average[200] //replace with your indicator code
else
result = undefined
if not done then
drawtext("Warning - this indicator has expired",barindex,result[1],SansSerif,Bold,16)coloured(128,0,0)
done = 1
endif
endif
return result
You could even give advanced warning that an indicator is about to expire:
expirydate = 20180101
advancewarningdate = 20171201
if opendate >= advancewarningdate then
if not donewarning then
drawtext("Warning - this indicator will expire in one month",barindex,result[1],SansSerif,Bold,16)coloured(128,0,0)
donewarning = 1
endif
endif
if opendate < expirydate then
result = average[200] //replace with your indicator code
else
result = undefined
if not done then
drawtext("Warning - this indicator has expired",barindex,result[1],SansSerif,Bold,16)coloured(128,0,0)
done = 1
endif
endif
return result