Hi,
in an attempt to build an indicator, I tumbled over this piece of code in the source of Community.Indicators:
CODE:
Please log in to see this code.
I am interestet in the RangeBound function. I thougth that this would disable the user to input values > 300. However I can enter 310 and have the indicator plotted to the chart. How can prevent the user from using greater values than 300?
Size:
Color:
Hi,
Answer: in the constructor of your DataSeries, manually introducing logic that would prevent calculations based on entered value should work fine. You can't entirely stop the user from entering a value above the upper range of RangeBoundIt32, but Wealth-Lab will warn the user that doing this might be against the indicator's design.
Size:
Color:
Okay, then it should warn me when I enter a value > 300 in the Beta indicator, but it does not.
Size:
Color:
The warning comes from a manual slider entry that's out of range. It's not going to warn if someone enters a parameter in the code, but you can do your own check in the code for that.
Size:
Color:
Good. Did it directly in the code with a messagebox.
Size:
Color: