NexusFi: Find Your Edge


Home Menu

 





Session Templates and Price Action


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ValutaTrader with 6 posts (0 thanks)
    2. looks_two Fat Tails with 5 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Lornz with 1 posts (0 thanks)
    1. trending_up 5,637 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 12 posts
    2. attach_file 2 attachments




 
Search this Thread

Session Templates and Price Action

  #1 (permalink)
 
ValutaTrader's Avatar
 ValutaTrader 
Oslo,Norway
 
Experience: Intermediate
Platform: NinjaTrader
Trading: EUR/USD
Posts: 66 since Apr 2011
Thanks Given: 4
Thanks Received: 52

Anyone using NTs built in session template for live automated trading?

I experience that quite a lot of indicators give wrong signals at the start of the session since they averages are calculated back from yesterdays session rather than the hours preceding the new session. Now, this may of course be what you want as well, but the extreme case is RangeNoGap bars that will show a major trend if the prices are different from yesterday, even if the prices are actually trending the opposite way at the start of the session.

Personally I find it better to implement session logic within the script so that the indicators act on 24/7 and my entries/exits are the only logic following the session boundaries.

What I would like though is an easy to use library for managing time zones in C# so that the scripts easily may be moved between servers in different zones; or perhaps an API in NT to query if the current hour is open for trading in say US Equities.

If anyone know of some simple workaround that I have missed or other use of indicators/session templates that dont make indicators jump across sessions, please let me know.

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Build trailing stop for micro index(s)
Psychology and Money Management
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



ValutaTrader View Post
Anyone using NTs built in session template for live automated trading?
I experience that quite a lot of indicators give wrong signals at the start of the session since they averages are calculated back from yesterdays session rather than the hours preceding the new session. Now, this may of course be what you want as well, but the extreme case is RangeNoGap bars that will show a major trend if the prices are different from yesterday, even if the prices are actually trending the opposite way at the start of the session.

Of course I use session templates for live automated trading. By the way everybody does, as every chart uses a session template!

You seem to be confusing a lot of things here.

(1) indicators do not give false signals at the start of the session
(2) indicators do use the hours preceding the new session not yesterday's session
(3) RangeNoGap is no indicator, but a bar type
(4) No bar type shows a trend
(5) RangeNoGap bars are not default NinjaTrader bars, before using them, you need to check whether they have been correctly coded - many non default bar types have bugs


ValutaTrader View Post
If anyone know of some simple workaround that I have missed or other use of indicators/session templates that dont make indicators jump across sessions, please let me know.

From your post it is not clear, where your problem lies. You would need to post a specific example of a chart with some indicators applied. Then it would be possible to solve the problem.

Reply With Quote
  #4 (permalink)
 
Lornz's Avatar
 Lornz 
Oslo, Norway
 
Experience: Advanced
Platform: CQG, Excel
Trading: CL
Posts: 1,193 since Apr 2010

He is referring to the age-old problem that most technical indicators were made for "smooth" daily data.

I think he is using RTH and wants to adjust the indicator(s) for overnight gaps. There are several ways of doing this...

Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 
ValutaTrader's Avatar
 ValutaTrader 
Oslo,Norway
 
Experience: Intermediate
Platform: NinjaTrader
Trading: EUR/USD
Posts: 66 since Apr 2011
Thanks Given: 4
Thanks Received: 52

Yes, I was a bit unclear on bars vs indicators. I feel both of them may give different results in this scenario however, and yes, some of these may contain errors as well.

PS In my view, some of the renko bars does give me an abstraction of price action that I would otherwise get from an indicator, so I regard them a bit like that.

Nevertheless, to illustrate my point, the following screen dump shows how the ADX on MedianRenko gives different slope at 7.15 AM and in one case triggers my strategy and the other not. One of the instances runs 24/7 and the other has a pure between 4 and 7 AM; i.e. a session with Europe morning and US extended hours.


Follow me on Twitter Started this thread Reply With Quote
  #6 (permalink)
 
ValutaTrader's Avatar
 ValutaTrader 
Oslo,Norway
 
Experience: Intermediate
Platform: NinjaTrader
Trading: EUR/USD
Posts: 66 since Apr 2011
Thanks Given: 4
Thanks Received: 52

PS I do see in the example/issue that it may actually be MedianRenko and not ADX that is the cause of the difference.

Follow me on Twitter Started this thread Reply With Quote
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


ValutaTrader View Post
Yes, I was a bit unclear on bars vs indicators. I feel both of them may give different results in this scenario however, and yes, some of these may contain errors as well.

PS In my view, some of the renko bars does give me an abstraction of price action that I would otherwise get from an indicator, so I regard them a bit like that.

Nevertheless, to illustrate my point, the following screen dump shows how the ADX on MedianRenko gives different slope at 7.15 AM and in one case triggers my strategy and the other not. One of the instances runs 24/7 and the other has a pure between 4 and 7 AM; i.e. a session with Europe morning and US extended hours.


@ValutaTrader: Sorry, could you explain what means "a pure between 4 and 7 AM" ? I don't understand your second session template.

Reply With Quote
  #8 (permalink)
 
ValutaTrader's Avatar
 ValutaTrader 
Oslo,Norway
 
Experience: Intermediate
Platform: NinjaTrader
Trading: EUR/USD
Posts: 66 since Apr 2011
Thanks Given: 4
Thanks Received: 52

Sorry; strange typo there....
I meant a pause or more specifically that the session is configured with multiple sections in the same day: 1AM-5AM followed by 7AM-1PM

The chart then jumps from 5AM to 7AM and causes some indicator or bar type to behave different after 7AM, compared to the one using 24/7 data.

Follow me on Twitter Started this thread Reply With Quote
  #9 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


ValutaTrader View Post
Sorry; strange typo there....
I meant a pause or more specifically that the session is configured with multiple sections in the same day: 1AM-5AM followed by 7AM-1PM

The chart then jumps from 5AM to 7AM and causes some indicator or bar type to behave different after 7AM, compared to the one using 24/7 data.

Does that mean that you have excluded data from your chart and now ask why the indicator produces a different value?

You are funny. If you exclude part of the data, of course the indicator will plot a different result. Garbage in, garbage out.


Make sure not to exclude data, when selecting your sessions

The session template should not be used to exclude data, but to select the start and end time of the session.

For GC I use a session template that reflects the actual trading hours, which can be found under the contract specifications at the CME website. You may use the following session templates:

(1) ETH template

ETH Session: 6:00 PM EST - 5:15 PM EST

(2) ETH template Tri-Session -> Session Times

Night session: 6:00 PM EST - 8:20 AM EST
Regular session: 8:20 AM EST - 1:30 PM EST
After-session: 1:30 PM EST - 5:15 PM EST

But in any case you would not want to exclude any data! The point of using a session template is not to include or exclude data, but to collect the session start time and session end time, such as required by some indicators such as the VWAP, the floor pivots or the daily range indicators.


There are two problems with bi-session and tri-session templates

Just in case that you opt for a bi-session or tri-session template, I would like to avert you to two NinjaTrader bugs:

(1) If you are running an automated strategy, some brokers will not allow limit and stop orders with GTC (good till cancelled), but you will have to qualify these orders as day orders. NinjaTrader has a habit of confusing the session end and the end of the trading day, so you may actually see your stop and limit orders removed at the session break.

(2) If you try to insert daily data - for example to collect the settlement price for futures - this cannot be done via the Add() method, as NinjaTrader will insert the daily bars in the middle of the trading day. You would need to load daily data asynchronously, which is a pain.

Therefore in any case, you should only use single session templates for automated trading strategies.

Reply With Quote
  #10 (permalink)
 
ValutaTrader's Avatar
 ValutaTrader 
Oslo,Norway
 
Experience: Intermediate
Platform: NinjaTrader
Trading: EUR/USD
Posts: 66 since Apr 2011
Thanks Given: 4
Thanks Received: 52


I guess you are at the core of my question there. It is not my intention to exclude data at all. I was in fact wondering why that happened when I use one of these templates. I pick an instrument, and in the Data Series dialog I tell it to be based on one particular template. Thats all.

So if possible; just let me know how to set this up without losing data/information. As I am obviously doing something wrong.

For one more illustration. The following to charts are of the 6E today. One of them with "Use instrument settings" template and one with "US Equities RTH". There are no other differences in my setup of these two.

Looking at the charts at 9.30 AM, one of them has an ADX value of approx 25 and the other approx 35.


Follow me on Twitter Started this thread Reply With Quote




Last Updated on May 31, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts