NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-30-2008, 06:13 PM   #1
ATI user
Senior Member
 
ATI user's Avatar
 
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
Default StrategyPlot

gapSeconds = DateTime.Now.Subtract(startTime).TotalSeconds;
plotvar = Math.Round( total/gapSeconds ,1);
Print("");
Print("total " +total);
Print("Time elapsed is " +gapSeconds + " seconds.");
Print("plotvar "+plotvar );
StrategyPlot(0).Value.Set( plotvar );

the above code will not plot
it would appear that gapSeconds can not be used to divide
StrategyPlot will plot gapSeconds...or total...but not plotvar...even though all variables print to the output window properly...

is there something about the DateTime method that allows the number to be used to print but not divide?

thanks
ATI user is offline  
Reply With Quote
Old 06-30-2008, 10:23 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Please take note that you cannot plot in the Strategy Analyzer. Other than that you need to debug. If you can print it you should be able to set it.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:43 AM.