Applying ParameterN.ValueInt to code
Author: EddySue1
Creation Date: 7/2/2009 7:14 AM
profile picture

EddySue1

#1
Having a little trouble applying ParameterN.ValueInt to the code.
CODE:
Please log in to see this code.



Can someone tell me what the code should look like after applying the change? Everything I try compiles with errors. I have added one parameter to my code with the following results

CODE:
Please log in to see this code.


Thanks...Ed

profile picture

Eugene

#2
QUOTE:
Can someone tell me what the code should look like after applying the change?

The best is to peek inside one of canned Strategies and study it. Most of them make some use of Straps. For example, "Bandwagon Trade" or "DipBuyer".

If you're interested in getting more than just guesswork about what you did wrong and what errors you may have, consider posting the full code -- or at least the error messages.
profile picture

Cone

#3
You probably want to edit your parameter range, but just substitute 22 with strategyParameter1.ValueInt
profile picture

EddySue1

#4
Let me try again. I created the following code with wizard.

CODE:
Please log in to see this code.


I would like to Optimize "DataSeries maFast = SMA.Series(Close, 20);" and the instructions tell me to do the following:
------------------------------------------------------------------------------------------------------
Add New Parameter

Whether or not you plan to optimize, it's easiest to add Straps to your script using the O.C. Note that once you've added them and clicked Apply Changes to Code, you must modify the Strategy to actually use the parameter(s)! For example, assume that want to optimize the period of a moving average. Your code will have a statement like this one:

DataSeries fastMA = SMA.Series(Close, 20);

After adding a Strap and applying it to the code, you need to modify the line above with the Strap variable, parameterN, where N is the parameter number in the list.

DataSeries fastMA = SMA.Series(Close, parameterN.ValueInt);
-----------------------------------------------------------------------------------------------------------
I made several changes like the following which all compiled with errors.
....DataSeries maFast = SMA.Series(Close, strategyParameter1);

I did take a look at your suggested code/programs and alot more code is needed. So I must be missing something in the User Guide / Optimixation Control.


Thanks again...Ed



profile picture

Eugene

#5
CODE:
Please log in to see this code.
profile picture

EddySue1

#6
Thank you....Ed
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).