Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Understanding Multi-series Processing
Collapse
X
-
Hello Brillo,
Thanks for your note.
This would depend on the exact code in the script.
If BarsInProgress is 5, then there must be at least 6 data series (including the primary which is BarsInProgress 0).
Anytime you limit code to processing while a specific BarsInProgress is updating, that code will only trigger when the bar closes for that specific data series.
For example, if on my chart I have a 1 minute series.
In Initialize() I add:
Add(PeriodType.Tick, 1);
Add(PeriodType.Day, 1);
This makes for three series:
BarsInProgress 0 is the primary series of 1 minute
BarsInProgress 1 is the 1 tick series
BarsInProgress 2 is the day series.
If in OnBarUpdate() I write:
if (BarsInProgress == 0)
{
Print(string.Format("{0} | Executes on each minute", Times[0][0] ));
EnterLong(0, 1, "entry);
// EnterLong(int barsInProgressIndex, int quantity, string signalName)
}
This will update on each minute, when it places an order, that order will fill with prices from the minute series. This means the order will fill with the open price of the next minute bar.
If in OnBarUpdate() I write:
if (BarsInProgress == 0)
{
Print(string.Format("{0} | Executes on each minute", Times[0][0] ));
EnterLong(1, 1, "entry);
// EnterLong(int barsInProgressIndex, int quantity, string signalName)
}
This will update each minute, the entry will use fill prices from the 1 tick series. This means the order will fill with the next tick price.
If in OnBarUpdate() I write:
if (BarsInProgress == 1)
{
Print(string.Format("{0} | Executes on each tick", Times[0][0] ));
EnterLong(2, 1, "entry);
// EnterLong(int barsInProgressIndex, int quantity, string signalName)
}
This will update on each tick, the entry will use fill prices from the daily series. Meaning the order will fill with the next daily bars open price.
I've made an example that prints the output window and allows the BarInProgress the order is being placed to to change. This is so you can compare the fill price of the order and match this with the BarsInProgress for the data series that was used to fill the order.
That said, changing the BarsInProgress for the logic or for the order entry will drastically change the results as this changes either when code is being triggered or changes the fill price and time of the orders being placed.Attached FilesChelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Tekie, 05-10-2023, 07:03 PM
|
6 responses
244 views
0 likes
|
Last Post
![]()
by Roonie23
Today, 05:04 AM
|
||
Started by bolli vishal, Today, 04:51 AM
|
0 responses
4 views
0 likes
|
Last Post
![]()
by bolli vishal
Today, 04:51 AM
|
||
Started by mw_futures, 04-24-2025, 05:26 AM
|
4 responses
32 views
0 likes
|
Last Post
![]()
by mw_futures
Today, 01:17 AM
|
||
Started by raysinred, Yesterday, 10:32 AM
|
1 response
22 views
0 likes
|
Last Post
![]()
by rockmanx00
Yesterday, 09:25 PM
|
||
Started by cbadr, Yesterday, 08:19 PM
|
0 responses
8 views
0 likes
|
Last Post
![]()
by cbadr
Yesterday, 08:19 PM
|
Comment