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 05-25-2012, 12:19 PM   #1
RonSims
Junior Member
 
Join Date: May 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default Time series

I am trying to put in a time series with the strategy wizard. FROM 6PM TO 3 AM. When I run the strategy analyzer it doesn't work.

>= 6:00 PM
<= 3:00 AM
RonSims is offline  
Reply With Quote
Old 05-25-2012, 12:55 PM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello RonSims,
Welcome to the forum and I am happy to assist you.

The logic >=6:00PM and <=3:00AM will return true only from Midnight to 3:00AM

You could set a code like
Code:
if ((ToTime(Time[0]) >= ToTime(18, 0 ,0) && ToTime(Time[0]) <= ToTime(23,59,0)) || (ToTime(Time[0]) >= ToTime(0,0,0) && ToTime(Time[0]) <= ToTime(3,0,0)))
{
  //do something
}
Also please make sure what session template you are using. If you are using a session template which has a break at midnight then you can expect a different result from what you are expecting.

Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 06-29-2012, 10:51 AM   #3
RonSims
Junior Member
 
Join Date: May 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

Can I put 2 time periods on the strategy wizard ? 12 am to 3 am - 9am to 1 pm
RonSims is offline  
Reply With Quote
Old 06-29-2012, 11:00 AM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello RonSims,
Yes, you can put 2 time filters via the strategy wizard.

Please let me know if I can assist you any further.
NinjaTrader_Joydeep 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Series;Time Value Issue thinkster Automated Trading 4 05-02-2012 11:31 AM
Time Series kinkeadfx General Programming 3 02-27-2012 02:15 AM
Using Time Series saintalan Strategy Development 6 07-27-2011 01:54 PM
Time and non-time bar series dominance on chart rtrader Version 7 Beta General Questions & Bug Reports 9 07-31-2010 01:06 PM
Time series munkee Strategy Development 1 08-03-2009 02:54 PM


All times are GMT -6. The time now is 06:21 AM.