Im trying to write a condition so that it enters if Percentrank is above a certain value.
If I use an actual number. Say > 0.5 , it compiles ok. If I try > percent_parameter it comes back with an error. Ehats the correct way to write 'if a double is bigger than a parameter'
(Or this should work, but the issue is with something else in my code not listed here?)
Thanks
Size:
Color:
"An error" with some "code not listed here" - what a nice guesswork session could it be! ;)
Could you type in here the error message as it appears in the editor?
Size:
Color:
its not in English but its error CS0019 @ (78,11): ' cant use '<' with 'double' and 'Wealthlab.StrategyParameter'
Size:
Color:
That's a pure C# 101 syntax error. You're comparing apples (type double) and oranges (type WealthLab.StrategyParameter).
Before comparing, convert the StrategyParameter type to their corresponding integer or double (in your case) parameter inside the Execute method using the ValueInt or Value properties, respectively.
(More details in WealthScript Programming Guide > Programming Trading Strategies > Strategy Parameters)
Size:
Color:
Thanks, fixed that up nice and easy.
Size:
Color: