PDA

View Full Version : Exposing a Variable for use in a strategy


daven
08-20-2009, 02:55 PM
I am working on a strategy which will go long if certain conditions are met and an avg line, which changes color depending on its slope, is the right color. To make the "color" available to a strategy I have created a variable which is set to a number depending on the color of the plot. I've embedded along with the plot statement but I don't know how to make it accessible to a strategy. Here's a sample of the code:

if (Rising(SMA(Period)))
{
// Connects the rising plot segment with the other plots
RisingPlot.Set(1, SMA(Period)[1]);
LColText = 1;
}

I'm pretty sure I need to somehow add a statement in the "Properties" section
or perhaps do that as well as create a dataseries but the things I've tried don't work. If there is a code sample somewhere that outlines this I would be grateful to see it.
Thanks
DaveN

NinjaTrader_Bertrand
08-20-2009, 03:06 PM
You would need to expose this dataseries in the indicator to access it in the strategy then - http://www.ninjatrader-support2.com/vb/showthread.php?t=4991

daven
08-20-2009, 09:59 PM
Bertrand,
Thanks for your help and guidance to the sample code. It works though I am still having trouble making the text variable visible outside the indicator so that it can be used in a strategy.
Thanks
DaveN