PDA

View Full Version : codes for different time frames


yellowTrader
02-18-2009, 11:08 AM
Hello,
Is it possible to create a time base strategy for a Particular time period chart but run it on a different time period chart?
Anotherwords is it possible to create an action to be taken the bar stamped 10:34 am (like drawing a horizontal line from its' high) but run this code on a 15 min chart?

NinjaTrader_Josh
02-18-2009, 11:31 AM
Not sure I follow. When you run on a 15min chart you can only work based off of the timestamps you receive from that chart. You would not receive a 10:34 timestamp.

yellowTrader
02-18-2009, 11:43 AM
The indicator I am trying to make is suppose to do some visual tasks like drawing lines from the the open/high/low/close of a few specific 1 min bars. But since the bars that they are being drawn from can't fit on the screen (need substantial chart compression) I am looking for a way to run this task on a longer period chart like a 15 min bar chart but remember the lines are still going to be drawn from the values of the 1 min bars.
Is this possible?

NinjaTrader_Josh
02-18-2009, 11:47 AM
Nope. Only way is if you have a real-time chart and you run with CalculateOnBarClose. Then you can check your PC clock and then just save the value at 10:34. This would not work with historical bars since you do not have the intrabar granularity.

Multi-time frame indicators will be available in NT7.

yellowTrader
02-18-2009, 01:05 PM
In that case is there any way I can filter part of the data so the 1 min chart gets truncated? Let's say I want to view the i min chart for Monday through Friday but I want to delete/filter the data for tuesday & Wednesday.

NinjaTrader_Josh
02-18-2009, 01:49 PM
You can only filter with dates. ToDay(Time[0]) will give you the date of the current bar. If the date lies on a Tuesday or Wednesday then don't process your strategy logic.

yellowTrader
02-18-2009, 01:57 PM
No I meant that I want to trucate the chart.That means I only want to view the bars for only certain dates.This would have nothing to do with the running strategies.

NinjaTrader_Josh
02-18-2009, 02:03 PM
Only way you can do that is to delete the data from your database. Tools->Historical Data->Delete. If you pull data from your data provider after you do this it will repopulate those dates.

yellowTrader
02-18-2009, 03:24 PM
This option doesn't work.
I opened a chart of ES going back 15 days then from the Control Center I went to Tools>Historical Data> Delete and deleted all the data except the first day and the last day but when I came back to the chart , the same number of days were visible.
Am I doing something wrong?

NinjaTrader_Josh
02-18-2009, 03:26 PM
You can't have any charts of the instrument open when you delete.

yellowTrader
02-18-2009, 03:31 PM
Got it. thanks.