View Full Version : NT ver.7 /Interactive Brokers FX session times wrong
abfc123
10-11-2010, 06:28 AM
Hi,
I am comparing the IB chart for an FX pair with the NT chart using the 'Forex' session template. Times set it in are as specified by IB for their FX.
However when i use this template to generate NT charts, it has big gaps and appears incorrect.
When I use the NT '24/7' session template, I see the data.
Please advise how to correctly set the 'Forex' template,
Thanks
NinjaTrader_Bertrand
10-11-2010, 06:46 AM
Our Forex session template would cover times from 5PM EST Sunday to Friday 5 PM EST - which are the official FX spot session times - you could customize the template according to your needs or create a different one via Tools > Session Manager.
abfc123
10-11-2010, 07:24 AM
Hi Bertrand,
I agree that these are the correct FX session times specified in the 'Forex' template.
However, please pull up 2 AUDJPY charts. one with the NT 'Forex' session template and one with the 'Default 24/7 'session.
I am seeing gaps in the 'Forex' session data where there should be prices. I should be getting data from 5pm Sun-5pmFri
My pc clock is set to Exchange time and my IB TWS is correctly configured.
NT7 is the only application that is giving me this nonsensical price series.
Thanks and regards
NinjaTrader_Bertrand
10-11-2010, 07:29 AM
I'll check into here, when exactly are you seeing the gaps on your charts?
Have you tried with a cleaned up cache (just empty those subfolders with NT7 being closed down - MyDocuments\NinjaTrader 7\db\cache).
abfc123
10-11-2010, 08:12 AM
Hi Bertrand,
Restarting Ninja seems to have resolved the gaps for the 'Forex' session chart.
Obviously, I it is easier to see these error with only 5days of lookback. Is there any way of verifying the integrity of say 6mths of 1 min data? If i was to backtest with these gaps in my data present my results would be completely erroneous.
IB data even without the process of loading into NT persistent store is of questionable quality.
Can you recommend an alternative data source for high granularity intraday data?
Thanks
NinjaTrader_Bertrand
10-11-2010, 09:04 AM
Great to hear this resolved the gap issues for you - our preferred 3rd party datasource for NT7 would be Kinetick - www.kinetick.com
abfc123
10-11-2010, 09:28 AM
On the subject of Multi timeframe, I have a 1min strategy with secondary Daily Bar series.
At the start of a new Daily session(5.01pm), I want to reset variables.
Add(PeriodType.Day, 1);
if (BarsInProgress == 1)
{
//reset variables here
}
Doesn't seem to work.
Is the only alternative to run a check on each minute bar?
Thanks
NinjaTrader_Bertrand
10-11-2010, 09:53 AM
Yes, you would need to reset on the finer series to 'catch' the 5:01 timestamp.
abfc123
10-11-2010, 10:19 AM
Using the following hardcoded test is obviously not good practice
if (Times[0].ToString().Contains("5:16:00 PM"))
Is there a way to request the the start time of the named session from within ninjascript?
Thanks
NinjaTrader_Bertrand
10-11-2010, 10:22 AM
Yes, you could access the session begin and end times via NinjaScript for NT7 -
http://www.ninjatrader.com/support/helpGuides/nt7/getnextbeginend.htm
abfc123
10-11-2010, 11:06 AM
Thanks, I'm using the Bars.FirstBarOfSession test
A question about Backtesting vs Realtime:-
For backtesting , I generate levels at start of session, set (OnBarClose = true) then test whether High of minute Bar>=level.
This is obviously satisfactory for backtesting but for live I would want to enter at market at first tick touch at or above the level. Aside from the increased CPU usage what other issues might I have by setting the OnBarClose = false
Alternatives might be setting/re-setting limit orders when new level targets are regenerated but i would prefer avoiding amending orders.
Thanks again
NinjaTrader_Bertrand
10-11-2010, 11:14 AM
Ok, good - correct the CPU load would be heavier in this case, you also should keep in mind that if you reference indicators in your script they should not contain any CalculateOnBarClose setting in their Initialize(), you would want to set this solely from the calling strategy.
abfc123
10-11-2010, 12:18 PM
so for example, if I had a 1 minute strategy that referenced the ATR of a secondary Daily Bar Series:-
Add(PeriodType.Day, 1);
double DailyATR = ATR(BarsArray[1],atrLookback)[1];
double lastDailyClose = Closes[1][0];
where i wanted to check if the intraday tick/price had touched the lastDailyClose+DailyATR
and where the daily bars and reciprocal indicators are required to calculate onBarClose=true to give values at the end of each completed daily session.
Is there a way to allow just the primary Bar Series to be evaluated onBarClose=false?
Thanks
NinjaTrader_Josh
10-11-2010, 01:31 PM
You would have to set your CalculateOnBarClose setting to false and then in the BarsInProgress setting that you do not wish to have it calculated via a false setting you would add logic to filter it so you only process the closing ticks.
if (BarsInProgress == 1 && FirstTickOfBar)
{
/* Do something. Note that the FirstTickOfBar is the same event as the closing of the bar. When using this method you need to offset the [] indexing back one to the bar that just closed otherwise you will be accessing the new bar. So [0] should be [1] to get the bar that just closed. */
}
abfc123
10-12-2010, 12:47 PM
Hi Josh,
Attached is a basic test strategy.
I want to run it against 1 minute FX data with 'Forex' session template times(start/end@5pmEST).
Stop-In is the previous Daily Close + Daily ATR(50).
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:35:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:36:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:37:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:38:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:39:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:40:00 PM, DailyATR=0
lastDailyClose(0) at 10/11/2010 5:00:00 PM, MinuteBarTime=10/12/2010 2:41:00 PM, DailyATR=0
I'm obviously missing something important.
Thanks and regards
NinjaTrader_RyanM
10-12-2010, 03:10 PM
Hi abfc123,
We're discussing two similar issues in two threads. Can you continue the conversation here only:
http://www.ninjatrader.com/support/forum/showthread.php?t=34465
Once this has been resolved feel free to start another thread with anything that remains outstanding.