Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 Balage0922, Today, 07:38 AM
|
0 responses
2 views
0 likes
|
Last Post
by Balage0922
Today, 07:38 AM
|
||
Started by JoMoon2024, Today, 06:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by JoMoon2024
Today, 06:56 AM
|
||
Started by Haiasi, 04-25-2024, 06:53 PM
|
2 responses
19 views
0 likes
|
Last Post
by Massinisa
Today, 05:32 AM
|
||
Started by Creamers, Today, 05:32 AM
|
0 responses
6 views
0 likes
|
Last Post
by Creamers
Today, 05:32 AM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
12 responses
1,786 views
0 likes
|
Last Post
by Leafcutter
Today, 05:30 AM
|
Comment