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
Where can i find this data ?
Collapse
X
-
Comment
-
mate41,
You could try modifying your session template to be 24/7 to see if it gives you more data. This is done by right click > data series > set session template to "Default 24/7". What data source are you comparing to for your session open that you see a difference?Adam P.NinjaTrader Customer Service
Comment
-
AdamP,
i think we can't solve the problem because the data isn't retrieved correctly.
The data provider is IB and i tried the 'default 24/7'.
I also created and tried a 'startup' section to avoid retrieving the sess_open on every tick. Nothing works as it has to do.
I need the the differences from the quotes and 'previous session close' to trade CFD's but this may not be the reason for having the correct data.
Comment
-
Mate,
What data source are you comparing to to get the opening for the day? In other words, what data are you looking at that pinpoints the NT data from IB as wrong?
Please make sure your PC clock is synced to a standardized source like NIST. Please find instructions below.
Adam P.NinjaTrader Customer Service
Comment
-
Adam,
look at the screenshot i attached below.
The line at the middle indicate:
close previous session, price at the open of the market, current price, etc.... At the most right you have the differences net and percent between the current price and the previous session close.
The line above indicate the sess_Open = taken by NT from IB and see also the calculated differences.
In this shot you have all what you need to compare.
Comment
-
mate,
Please see the attached screenshot. I added daily bars to the chart, checked the opening of the day price, then compared to some of your code modified to print session open. I put some ellipses around the prices so you can see.
I would recommend using CurrentDayOHL.CurrentOpen[0] to get session open.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
-
Adam,
the variable-name was a bad name. I had to name it sess_previous_close or sess_start_new_market or whatever...
So this session open on the market to start trading is 1253.00 and not 1250.25 !
The 1250.25 quote is the first traded price when the market opened a new session.
That way there is already a negative started price and the chg_net schould be -2.75 at that moment.
And yes, i used on my first code sess_Open = CurrentDayOHL().CurrentOpen[0] but that isn't what it must be.Last edited by mate41; 12-12-2011, 03:20 PM.
Comment
-
mate,
So you actually want the previous day's close?
You could add a second data series Add(PeriodType.Day,1); in Initialize(), then every OnBarUpdate(), check if(BarsInProgress==1 && FirstTickOfBar), if it is, set prev_Day_Close = Closes[1][1]; The FirstTickOfBar is to ensure you aren't resetting the variable every tick.
I.e.
Code:protected override void Initialize() { Add(PeriodType.Day,1); //other code here } protected override void OnBarUpdate() { if ( BarsInProgress == 1 && FirstTickOfBar) { previous_Day_Close = Closes[1][1]; } //other code here }
Adam P.NinjaTrader Customer Service
Comment
-
Hi Adam,
thanks for your hints. I am back to the first (hint) code, others don't work.
Code:if ( BarsInProgress == 0 && FirstTickOfBar) sess_Open = PriorDayOHLC().PriorClose[0]; // ok, right one and taken only once // here are the problems: the calculation is wrong; // [B]difference of 0.25[/B] compared with the real quote (on ES 03-12) change_Net = CurrentPriceValue[0] - sess_Open; // and of course the calculated percent also change_Per = (change_Net * 100) / sess_Open;
Comment
-
Hi mate41,
The only way to track this down is to Print() all values used in your calculation, in order to identify which exact value isn't working as you expected. Verify that every element in your calculation matches expectations. You could also consider contacting IB support to see if they can offer details on their provided net change value. They may use a settlement value, or a different session close definition.Ryan M.NinjaTrader Customer Service
Comment
-
Ryan,
of course i compared the data with a Print(....).
The data from a future like ES can't be better.
But data from for ex. RIG is completely wrong.
This is the answer from IB:
"The shown closing price is the official closing price of the exchanges. Currently we show for RIG@NYSE a closing price of 41.84 which is the official close of yesterday's trading. I double checked with Bloomberg and this one is correct"
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kaledus, Today, 01:29 PM
|
1 response
7 views
0 likes
|
Last Post Today, 01:53 PM | ||
Started by frankthearm, Yesterday, 09:08 AM
|
13 responses
45 views
0 likes
|
Last Post
by frankthearm
Today, 01:52 PM
|
||
Started by PaulMohn, Today, 12:36 PM
|
2 responses
16 views
0 likes
|
Last Post
by PaulMohn
Today, 01:48 PM
|
||
Started by Conceptzx, 10-11-2022, 06:38 AM
|
2 responses
55 views
0 likes
|
Last Post
by PhillT
Today, 01:47 PM
|
||
Started by yertle, Yesterday, 08:38 AM
|
8 responses
37 views
0 likes
|
Last Post
by ryjoga
Today, 01:22 PM
|
Comment