Edit: With Tick Replay disabled, it appears to work, not sure why that would affect it in this case. I would like it to work with Tick Replay enabled.
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
OnBarUpdate does not work in Replay on CL
Collapse
X
-
OnBarUpdate does not work in Replay on CL
I have an indicator which uses OnMarketData and OnBarUpdate. I'm testing it out on NQ and CL in market replay mode on 5/8/18. NQ plots the output from the indicator but CL does not. I am able to place a breakpoint in OBU when the indicator is loading, but during the actual replay process the breakpoint in OBU is not hit in CL. What steps can I take to fix this?
Edit: With Tick Replay disabled, it appears to work, not sure why that would affect it in this case. I would like it to work with Tick Replay enabled.Last edited by habibalex; 06-03-2018, 01:30 PM.Tags: None
-
Hello habibalex,
Do you have historical tick data for both series for the entire period loading historically?
In the Playback Controller have you selected Market Replay or Historical Tick data?
If Market Replay, is there Market Replay data for both series for the entire period?
If you feel you can confirm this, please include screenshots of the chart, the playback controller, and the historical data window showing both the market replay data and the historical data.Chelsea B.NinjaTrader Customer Service
-
I have historical data for both series for the entire loading period
Market replay is selected in the playback controller
Both series have data for market replay for the entire period.
When I uncheck Tick Replay my indicator data loads correctly and I am able to see the output of the indicator.
Tick Replay checked w/ NYMEX ETH session: https://imgur.com/a/5DAYCyl
Tick Replay unchecked w/ NYMEX ETH session: https://imgur.com/a/2KJH7Ew
for some reason if I use CME RTH US Index session w/ Tick Replay checked it works.
Comment
-
Hello habibalex,
For OnMarketData to trigger historically TickReplay must be enabled.
Below is a public link to the help guide on TickReplay.
Also from the help guide:
"2. By default, this method is not called on historical data (backtest), however it can be called historically by using TickReplay"
However, you mentioned:
"With Tick Replay disabled, it appears to work, not sure why that would affect it in this case"
Is this still the case?
The script could be using OnBarUpdate which would only need a secondary 1 tick series added to trigger events on each tick and build plots using historical ask tick and bid tick data.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello habibalex,
The script is not triggering OnBarUpdate at all when TickReplay is enabled and State is State.Realtime while playing back ?
If you print the time at the top of OnBarUpdate no prints appear in real-time data?
I am not able to reproduce this behavior.
Attached is a test script and below is a public link to a test that demonstrates. The test script test both OnBarUpdate and OnMarketData, but we are only interested in OnBarUpdate.
Are you able to reproduce the behavior using the test script I have provided and the steps in the video?
Did you download the Market Replay data from NinjaTrader's servers in the Historical Data window?
Do you have a slimmed down test script with only the necessary code to demonstrate the behavior that I can test on my end?Attached FilesChelsea B.NinjaTrader Customer Service
Comment
-
When I set your indicator to Calculate.OnBarClose I do not get any output in the output window for real time trades. With Calculate.OnEachTick set, I get output. Are you able to reproduce that w/ your script?
Comment
-
Hello habibalex,
(edited)
The script is designed not to print for historical data. This is because we are testing real-time playback.
To confirm, you have played back the entire period in Market Replay and no prints have appeared at all, is this correct?
I ask because your screenshot is showing that you have not hit play on the Market Replay Controller and nothing has been played back.Last edited by NinjaTrader_ChelseaB; 06-07-2018, 08:43 AM.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello habibalex,
With the indicator set with Calculate as 'On bar close', with TickReplay enabled, in Playback, I am not able to reproduce.
Can you provide a video showing that the code in the script has not been changed and showing that you have played back through all of the data?
You can use Jing to make short videos for free.
Below is a public link to the jing website.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, Today, 07:55 PM
|
0 responses
6 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:55 PM
|
||
Started by janio973, Today, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
242 views
0 likes
|
Last Post
by john_44573
Today, 06:11 PM
|
||
Started by reynoldsn, Today, 05:56 PM
|
0 responses
13 views
0 likes
|
Last Post
by reynoldsn
Today, 05:56 PM
|
||
Started by bortz, 11-06-2023, 08:04 AM
|
51 responses
1,996 views
0 likes
|
Last Post
by aligator
Today, 05:50 PM
|
Comment