Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
different analysis account to execution
Collapse
X
-
Hello franatas,
Yes, this is possible by adding a data series with the AddDataSeries() call.
The BarsInProgress is an index of each series in the BarsArray collection, in the order they are added, with the primary (chart bars) series having BarsInProgress Index 0.
Each series updates OnBarUpdate(). BarsInProgress will be the series that is having bar update.
Included with NinjaTrader is the SampleMultiInstrument that demonstrates adding an instrument series on line 50.
The SampleIntrabarBacktest reference sample linked below also provides an example of using AddDataSeries().
To place orders to a specific instrument while a different BarsInProgress is updating OnBarUpdate() , set the BarsInProgressIndex overload parameter for the method call.
EnterLong(int barsInProgressIndex, int quantity, string signalName)
Chelsea B.NinjaTrader Customer Service
-
else if (State == State.Configure)
{
//AddDataSeries(Data.BarsPeriodType.Tick, 1);
AddRenko("MNQ 03-24", 19, MarketDataType.Last);
}
SubmitOrderUnmanaged(1, OrderAction.Buy, OrderType.Market, ContratosBuy, 0, 0, "", "LARGOS");
Here I understand that I should place the order even if I am obtaining the data from process 0 which is NQ, when I start the strategy with the history visible the orders appear in the MNQ, but if I start without history and place the order I get this error in record: Sim101, No market data available to control the simulation processor. Affected order: Sell 1 Market, y tengo el grafico con el NQ y el MNQ con las mismos dias y temporalidad.
and another question, how can the second data be selected to be the same as the NQ, AddRenko("MNQ 03-24", 19, MarketDataType.Last); being able to choose only MNQ without contract 03-24 so as not to have to enter the code every relowerLast edited by franatas; 02-29-2024, 05:51 AM.
Comment
-
Hello franatas,
There does have to be data for all series involved to place order.
Are you connected to the NinjaTrader Brokerage when running the script?
Are you ensuring that CurrentBars[1] is greater than 0 before submitting the entry on BarsInProgress 1?Chelsea B.NinjaTrader Customer Service
Comment
-
Hello franatas,
I've tested this on my end and I am finding the order is being submitted without error in both historical and real-time.
Below is a link to a video of the test.
Attached is the exported simple test script.
RenkoSeriesOrderTest_NT8.zip
If you follow the exact steps shown in this video with this test script is the behavior different?
"how can the second data be selected to be the same as the NQ, AddRenko("MNQ 03-24", 19, MarketDataType.Last); being able to choose only MNQ without contract 03-24 so as not to have to enter the code every relower"
Unfortunately, since the instrument is different you will need to specify the contract month.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
608 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
355 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment