- ago
Getting your params names representable of course is part of the best practices but having comments on every param would be helpful as well (especially when you deal with compiled strategies.).

Of course, you can get back to you strategy code and look at your param comments if you have one, but it’s not that convenient you need to go back and forward every time and sometimes look for a place where your params are commented.

The idea is to add something like “string comment” optional argument to AddParameter() method so you can see this comment on mouseover the param name in Strategy Parameters section.

2
1,205
Solved
11 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.10% )
- ago
#1
We already have this in place, it's called the Hint property of the Parameter class.

0
- ago
#2
Oh, great!

Btw, what section is it? I meant this one. - I can't see any hints here.

0
Glitch8
 ( 12.10% )
- ago
#3
The hints don't appear in the slider control, only in the parameter editor panel (used by indicators and other parameters editors). I can add the hints to the slider control as well!
0
- ago
#4
Would be great, thanks, as I use this pane quite often. It's especially useful when you run strategy you haven't dealt with for a long time.
0
Glitch8
 ( 12.10% )
- ago
#5
Agree, it's already done and ready for Build 14.
1
Best Answer
Cone8
 ( 6.32% )
- ago
#6
Example (when Build 14 is ready)...

CODE:
      public MyStrategy() : base()       {          Parameter p = AddParameter("Percent", ParameterTypes.Double, 0.98, 0.92, 0.99, 0.01);          p.Hint = "% of band";          p = AddParameter("Some Number", ParameterTypes.Int32, 5, 2, 10, 1);          p.Hint = "An integer 2 to 10";       }
0
- ago
#7
Thanks, Cone.

CODE:
AddParameter("Some Number", ParameterTypes.Int32, 5, 2, 10, 1).Hint = "Hint";

will also work I hope - I like one-liners).
1
- ago
#8
Yes it will.
1
Cone8
 ( 6.32% )
- ago
#9
Sure, and for this particular Parameter member it makes good sense to do it that way... but we'll leave the one-liners for the pros. :)
0
Glitch8
 ( 12.10% )
- ago
#10
I'm unquestionably a pro but I never use one-liners, prefer code clarity above brevity! :)
0
- ago
#11
This .Hint property is not documented on either the website or in the QuickRef for Build 14. Correction; it's there but not in the list of parameter choices in the QuickRef.

Even when there isn't any hints, when I mouseover the slider window, I get an empty "attempted" tooltip showing. Is that right?
0

Reply

Bookmark

Sort