I hope you can help me, greetings from Chile.
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
1 second graph
Collapse
X
-
1 second graph
Good afternoon, I need data from an instrument every 1 second, however when using close candles every 1 second in "data series", not all candles are every 1 second, but some are every 5 seconds or more, I think it has what to do with the data or ticks, but how do I configure, (or is it possible) to configure the graph so that even so all the candles are every 1 second, that every second that passes a candle appears?
I hope you can help me, greetings from Chile.Last edited by samir; 04-17-2018, 11:55 PM.Tags: None
-
I have noticed, testing robots on multiple instruments that the data updates have an all instruments distribution.
Does the broker have to see that in the chart the price is not updated every 1 second, or every 5 (exactly) ?, for example, when putting 5 seconds and with a stopwatch, it is not always accurate every 5 seconds, a 40%, of course it has cost me but with a chronometer I have noticed.
Anyway, if it was the fault of the data provider (broker) can you set up Ninjatrader 8 so that, even so, I updated the graph every second, regardless of whether the prices changed or not?
Anyway I am trading with another broker (real account), online platform and is tremendously the distribution of the price update, I think it's because I use demo account with FXCM broker, I will consult with them about this.
But anyway, is it possible to graph the data every second on the graph? (I do not want it to be accurate, but the interval does not change more than 20% of the time, placing the interval 1 second deviates more than 1,000% difference, with 10 seconds much less, in minutes it is not possible to detect difference.
-
Hello samir,
The Bars on the chart are data driven. If no data is received while the bar is open then NinjaTrader can't build that bar.
This means if no data is received over a 1 second bar, then no bar appears for that second.
The only work around would be to create your own connection adapter in an external custom developed application and feed the data to NinjaTrader through the API and the External interface.
There isn't anything in NinjaTrader that would allow you to create bars where there was no data.
Below is a link to a forum link with details about using the API.
Chelsea B.NinjaTrader Customer Service
Comment
-
Maybe a way ?
Hi Samir !
I don't know if you figure out what you wanted to do, but i found a little turn around that can allow to create some sort of a count at each seconds, even if its not perfect at all, i would like to share it with you :
Code:if (Time[0] >= ValueOfTimePlusTheIntervalUsedHasDataSeries || ValueOfTimePlusTheIntervalUsedHasDataSeries == null) {//After the interval has passed, the TimeUsed will be equal to the TimePlusInterval, and set back the Time Saved ValueOfTimePlusTheIntervalUsedHasDataSeries = (Time[0].AddSeconds(SecondInterval)); IsFirstTickOfBarForVirtualDataSeries = true; } //SecondInterval would be 1 in our case if (IsFirstTickOfBarForVirtualDataSeries == true) { //Do your stuff IsFirstTickOfBarForVirtualDataSeries = false; } //and also, use this "DateTime? AverageSpreadValueOfTimeUsedHasDataSeries = null;" in default to have the DateTime on null and not 00:00 on startup I also use this method in the "protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)" section, and not in barupdate, to avoid issues
You could also try to create a custom data series (even if i never tried and i'm not sure if its even possible), based on one second, yet again, you would face some issues with the storage of the data on each second (unless if you precisely know how much seconds you need, and that you can store the data trough multiples double's and not series double). Also, if you look to try it, i'm unsure if it would work well onbarupdate, but it work really well onmarketdata.
Anyway, this little trick help me a bit for what i was doing, maybe it can help you too !
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Perr0Grande, Today, 08:16 PM
|
0 responses
2 views
0 likes
|
Last Post
by Perr0Grande
Today, 08:16 PM
|
||
Started by elderan, Today, 08:03 PM
|
0 responses
5 views
0 likes
|
Last Post
by elderan
Today, 08:03 PM
|
||
Started by algospoke, Today, 06:40 PM
|
0 responses
10 views
0 likes
|
Last Post
by algospoke
Today, 06:40 PM
|
||
Started by maybeimnotrader, Today, 05:46 PM
|
0 responses
12 views
0 likes
|
Last Post Today, 05:46 PM | ||
Started by quantismo, Today, 05:13 PM
|
0 responses
7 views
0 likes
|
Last Post
by quantismo
Today, 05:13 PM
|
Comment