|05-10-2008, 02:12 PM||#1|
Join Date: Apr 2008
Thanked 20 times in 11 posts
One indicator, two functions
I am trying to develop an indicator with a plot and data trapping. I would like the plot to be continuous intrabar and the data trap to be at bar close, trapping the plot closing values depending on signals/variables generated by the plot, so not every bar would be trapped. Is there a way to have one function running intrabar with a second running at bar close?
If not, is there a way for one indicator function (the data trap) to access signals/variables from a second indicator (the plot). I hate to have a second indicator calculating the same thing as the first, just so it can trap at bar close, but monitoring variables in the first might not be so cpu intensive.
|05-10-2008, 02:38 PM||#2|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Thanked 106 times in 70 posts
You can do this by limiting code segments in your code with this if statement:
While you are inside the if-statement make sure you are using an index value of  to get to the just closed bar's values though. For instance everything should be applied to Close, Open, etc. If you forget to do this you will be getting the values of the first tick of the new bar instead of the values of the closed bar.
NinjaTrader Customer Service
Last edited by NinjaTrader_Josh; 05-10-2008 at 06:20 PM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|renaming functions||z32000||General Programming||3||12-03-2007 10:47 AM|
|Order functions||gert74||Strategy Development||1||06-27-2007 01:20 AM|
|Accessing Custom Indicator Functions in Strategies||ThePatientOne||Strategy Development||1||05-29-2007 01:29 PM|
|Creating NinjaTrader compatible functions from TS ShowMe and indicator email alerts||robinso||Miscellaneous Support||1||04-11-2007 05:33 PM|
|using DLL interface functions in c#||Futures_Shark||Automated Trading||4||01-03-2007 02:17 AM|