PDA

View Full Version : Passing variable


caldolegare
11-17-2008, 08:47 AM
Is there a way to make a switch in NT?
For instance say 50 bars ago i set a variable to 1 and is there a way to check to see if it has changed to 2. if so then i play alert1.wav.

Hope that isn't too cryptic.

NinjaTrader_Josh
11-17-2008, 08:59 AM
caldolegare,

This is possible through custom NinjaScript programming. You would create a variable and set it to take a value. Then whenever you want access that variable.

caldolegare
11-17-2008, 09:03 AM
Ok I'm thinking you didn't finish this post or am I totally missing the point of the post? lol

caldolegare,

This is possible through custom NinjaScript programming. You would create a variable and set it to take a value. Then whenever you want access that variable.

NinjaTrader_Josh
11-17-2008, 09:09 AM
caldolegare,

The post was complete. The point is that you can do it, but you will need to custom program it to fit your needs.

caldolegare
11-17-2008, 09:11 AM
Ah ok my bad. I already have my indicator up and running. i'm just not sure how to make the variable accessable a few bars later. all my variables reset once a new bar form.

NinjaTrader_Josh
11-17-2008, 09:13 AM
If you want your variables past values to be accessible you will want to create them into DataSeries objects. Please take a look at this article: http://www.ninjatrader-support.com/HelpGuideV6/DataSeriesObject.html

caldolegare
11-17-2008, 09:23 AM
Thanks that helped a lot.