If it's off 5min bars I'm calculating there is 78 - 5min bars/day x 9 days = 702 min bars required? But if I put this many bars required it comes up with 0 trades so there must be something wrong.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Bars required..multi-time frame
Collapse
X
-
Bars required..multi-time frame
When Backtesting, if I have 5min chosen in the strategy analyzer window for the dataseries Value but in my script I have a condition that's looking at a Daily 7period simple moving average as far as 3days back, what should my minimum bars required be set to? Is it based off 5min bars or daily bars?
If it's off 5min bars I'm calculating there is 78 - 5min bars/day x 9 days = 702 min bars required? But if I put this many bars required it comes up with 0 trades so there must be something wrong.Tags: None
-
Hello zachj,
Your BarsRequired or Minimum bars is going to effect all of your Multiscripts in your Strategy/Indicator.
So with that said, you may not want to use the BarsRequired or Minimum bars, but check each series manually to make sure you have enough data so that you can define one for each of them.
For example:
Code:protected override void OnBarUpdate() { // Checks to make sure we have at least 30 or more bars in the Primary Bars objects before continuing and 10 bars for the secondary series. if (CurrentBars[0] < 30 || CurrentBars[1] < 10) return; // Script logic calculation code... }
JCNinjaTrader Customer Service
-
Yes that is correct. I don't know if that 1 bar is for the 5min or Day period though in the strategy analyzer.
And I'm not receiving any errors, that I can see at least, because I keep getting the maximum threshold of the output window reached message.
Would the min bar effect any intraday calculations of trades that do take place or would it just simply stop trades from occurring until the min bars is reached? If I'm just missing a few trades because it's not ready yet I can deal with that but if anything further than that makes me nervous.
Comment
-
Hello zachj,
My guess would be that there is an error that is causing your strategy not to calculate, but could you send me your log and trace files for today so that I may look into what occurred.
You can do this by going to the Control Center-> Help-> Mail to Support.
In the subject line put "ATTN: JC" and in the body reference this thread: http://www.ninjatrader.com/support/f...ad.php?t=62161JCNinjaTrader Customer Service
Comment
-
I had the same trouble with one of my indicators and could not determine what results I needed to start calculating from, specially when computing larger time frames like say 80 minutes or more, and given the entry points were random each time.
My work around was a
try
{
<code>
}
catch
{}
This stopped it failed simply caught the exception and di nothing with it and continued on its merry way.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment