View Full Version : Pulling the correct values in a strategy?
Burga1
11-19-2007, 09:21 PM
Greetings,
I'm trying to put together a strategy using the wizard. My question is fairly simple I think--how do I know if the strategy is correctly using the correct variable within the indicator I wish? For example, using the attached screens, how can I be sure that the "SMI Signal" variable within the strategy called "SMI" is the variable being correctly used in my examples? How do I know it's not pulling the values of one of the other variables?
Thanks in advance.
NinjaTrader_Josh
11-19-2007, 10:18 PM
Hi Burga1,
I am unfamiliar with the way your SMI indicator is coded. From the looks of the screenshots, it would appear your SMI indicator's signal variable is defined once at start and never modified.
Normally, you don't check variables per se because those are user definable when you call the indicator. You would check the indicator's plot values which are dynamically changing. For instance, take a look at the Bollinger indicator in the condition builder. You will see a property called "Plot" and you can see you can select 3 different plots: Upper, Middle, Lower.
Burga1
11-19-2007, 10:28 PM
Yes, I see that "plot" field where variables can be selected. I guess what I need to know is how to create that in my SMI indicator...I've tried doing so by exposing a public property for the variable...this causes it to show as an entry field but not as a "plot"...I'm confused about how to go about this. Thanks.
NinjaTrader_Josh
11-19-2007, 10:48 PM
If you generate your indicator through the wizard there is a page where it asks you about Plots. You can add plots there. After you the plot you can use .Set to set values to that plot. Then you can start using it.
If you run the indicator wizard on all default settings you will notice at the end the line in the OnBarUpdate() is this: Plot0.Set(Close[0]);
What that is saying set the plot named "Plot0" to take the value of the current bar's close. Basically Plot0 will be associated with every bar's close. On bar 1 Plot0 will have the value of the close of that bar. On bar 2 Plot0 will have the value of the close of bar 2. etc etc. Hope that makes sense. Just mimic the way the wizard generates the plots and you should be able to use it.
Burga1
11-20-2007, 09:30 AM
Thank you Josh, that makes more sense to me...I'll give it a shot.