Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
hide blocks of data
Collapse
X
-
excluding data
Hi Jason,
I am trying to exclude some bad data from security. I succesffully exlclude the data points and save it but when I backtest thee strategy gets in to a trade at some of those bad data points.
Is this normal? If not what should I do? I already deleted the data and reloaded it and restarted NT.
Thanks
Comment
-
Yes I use 7.0.0.21
For example I use a test strategy which has only this initialize and on bar update sections:
protected override void Initialize()
{
Add("FGBL 12-10", PeriodType.Minute, 5);
Add("^VIX", PeriodType.Day, 1);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (Positions[1].MarketPosition == MarketPosition.Flat && ToTime(Times[0][0]) >= ToTime(2, 35, 0) && ToTime(Times[0][0]) <= ToTime(4, 05, 0))
{
EnterLong (1,1, "Sln1");
}
}
As primary instrument I use ZN 12-10 or ZB 12-10 but for some other instruments I don't get the same error. On 22/03/2010 the trade starts at 3:05 AM although that period is excluded from historical data.
Thanks
Comment
-
aseke,
By "delete" did you mean you actually removed the data files or did you simply excluded the entries with the bad data? What you want to do is exclude the data and not delete them. Deleting them will simply be redownloaded from your data provider, while excluding them will effectively ignore those data points.Josh P.NinjaTrader Customer Service
Comment
-
That would be the correct way to exclude data.
As far as your script goes now, what I suggest is trying a very simple timestamp print test to see what your strategy actually sees as data.
This should print every single bar's timestamp for the secondary series. Then please compare this versus the excluded data list.
Code:if (BarsInProgress == 1) { Print(Time[0]); }
Josh P.NinjaTrader Customer Service
Comment
-
Do you use "ZN 12-10" as the primary instrument and "FGBL 12-10" as the secondary instrument? As I said previously this problem does not occur for every instrument.
I am sending my code to you. I use 5 minute data and if you run this strategy with "ZN 12-10" as the primary instrument you should be getting the error on 2010-03-22 at 3:05 AM.
ThanksAttached Files
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by zstheorist, Today, 07:52 PM
|
0 responses
3 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
149 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
Comment