PDA

View Full Version : Time series question


ashish
11-19-2007, 02:05 AM
Am I making a mistake here? Why are there trades after 11pm?

Ashish

NinjaTrader_Dierk
11-19-2007, 02:08 AM
Sorry, I don't follow.

ashish
11-19-2007, 02:28 AM
Sorry pls see thumbnail

ashish
11-19-2007, 07:38 AM
Hello,
Would someone please respond to this post?

NinjaTrader_Dierk
11-19-2007, 07:40 AM
A support rep will contact you shortly.

NinjaTrader_Josh
11-19-2007, 09:37 PM
ashish,

I am assuming you are running on a 5minute chart. Is this correct? The reason you are getting trade after 11 is because your condition is set at Time[1] not Time[0]. When you set it at Time[1] the comparison you are doing is effectively saying "If the time of the previous bar is less than 11pm, enter long". When you are backtesting this is what is happening with that code. On the current bar (time 11pm) it looks at the time of the previous bar (10:55pm). That time is less than 11pm so it wants to enter a trade. It enters the trade at the open of the next bar (11:05pm) because the 11pm bar is already completely closed and the next point in time is the open of the 11:05 bar hence the 11:05 timestamp on your trade.

ashish
11-20-2007, 06:16 AM
You ae the man Josh! Thank you
Ashish