Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
What are the problems with backtesting?
Collapse
X
-
In my strategy I am looking at the last 5-10 bars to determine an entry trigger. If I reduced the bar size from 3500 ticks then my triggers would be different. And how would I know how small to make the chart when even on a 100 tick chart it could sometimes trade 3 prices?Originally posted by Baruch View PostHi Jeff,
You need to run it on a smaler chart, so your exits would be not on the same bar. You can get your trigers from the current chart.
Baruch
Comment
-
It is impossible that in all of the trades there were 3 prices traded in 1 second. So there has to be something wrong....
Are my ticks in the right format?
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;19
20100301 085253;1110.25;1
20100301 085253;1110.25;7
20100301 085253;1110.25;10
20100301 085253;1110.25;2
20100301 085253;1110.25;2
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;2
20100301 085253;1110.25;1
20100301 085253;1110.25;25
20100301 085253;1110.25;1
20100301 085253;1110.25;1
20100301 085253;1110.25;42
20100301 085253;1110.25;2
20100301 085253;1110.25;2
20100301 085253;1110.25;2
20100301 085253;1110.25;2
20100301 085253;1110.25;4
20100301 085253;1110.25;21
20100301 085253;1110.25;1
20100301 085253;1110.25;5
20100301 085253;1110.25;5
Comment
-
I have access to my own tick database that I converted to Ninja ticks. I do not use a data provider.
My profit target is 2 ticks so all of my winners are 2 ticks. There is a stop loss so the loser is 11 ticks. The only other exit condition is 8-16 bars pass, which hasnt happened.
Here is what it looks like:
Comment
-
Unfortunately I am not sure why all trades exit the same second as per the conditions you setup.
Since the entry and exit price are listed for the same second, it would indicate the historical data has it listed this way.
What happens if you run the strategy in a chart when connected to the Simulated Data Feed? Does it enter and exit the same second as well?
Comment
-
Hi Jeff,
1. If your Time Period is 3500 ticks, so each bar is made of 3500 ticks Each bar has only one time - its end time, so if you enter and exit on the same bar you have the same TS for entry and exit.If I reduced the bar size from 3500 ticks
2. If your PT is 2 ticks you need to run it on 1 tick TF!
Baruch
Comment
-
When I run it on simulated data not all trades are on the same bar. Was my tick format correct? My data works fine when just looking at charts.
Ok I understand why the timestamps would be messed up. However that does not explain the profit being messed up. If I enter on a bar with a limit order and then go for 2 ticks of profit, will it fill be if at any time on that bar, the profit was hit? Even if that happens before my entry is filled?
PT is what? Period of time?
TF is what? Time Frame?
Why do you need to run it on 1 if PT is 1?
What I am doing is I am looking for the trend on the past few bars and then I am sending a limit order off of the market in an attempt to buy a pullback or sell a pop. Once I get filled I am going for 2 ticks with a stoploss of 5 ticks. So everytime I get filled, the same bar is guaranteed to contain my cover price (since I am buying a pullback). Could this cause an issue?Last edited by jeffbg123; 03-03-2010, 02:22 PM.
Comment
-
You need to program your strategy as a multi-time frame strategy then: http://www.ninjatrader-support.com/H...ameInstrumentsJosh P.NinjaTrader Customer Service
Comment
-
So Ninjatrader does not support entry and exit on the same bar?
When I try to run the Add() function I get
Failed to call 'Add' method for period type 'Tick': Exception of type 'System.Out.OfMemoryException'
I dont think it even goes through a single bar?Last edited by jeffbg123; 03-03-2010, 04:27 PM.
Comment
-
What do you mean by entry and exit? Are you just trying to reverse your position? If so just place an entry order in the opposite direction and it will reverse you. If you are asking about entering at open and closing somewhere inside that bar, you don't have that granularity in a backtest. Backtesting runs off of snapshot data based on bar's OHLC. You have no information inbetween each bar.
Reason you ran out of memory is because running a 1 tick series is extremely taxing on the system and doing so should only be used on a few days only.Josh P.NinjaTrader Customer Service
Comment
-
I am entering and then closing a position when I hit my 2 tick profit or 11 tick stoploss. Then I wait for another trigger and enter again.
I understand the OHLC part and see that this is why 1 tick bars are necessary.
However I tried running it on 1 tick bars with "Add(PeriodType.Tick,3500);" And in my On bar update I put:
if(BarsInProgress == 1)
{
Print("3500 bar");
}
This print statement was never printed to the output window. I did not get any log messages.
What could be wrong?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
111 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
38 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
42 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
78 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment