double higher than parameter
Author: maninjapan
Creation Date: 1/21/2011 6:43 AM
profile picture

maninjapan

#1
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
profile picture

Eugene

#2
"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?
profile picture

maninjapan

#3
its not in English but its error CS0019 @ (78,11): ' cant use '<' with 'double' and 'Wealthlab.StrategyParameter'
profile picture

Eugene

#4
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)
profile picture

maninjapan

#5
Thanks, fixed that up nice and easy.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).