NexusFi: Find Your Edge


Home Menu

 





custom timeframe


Discussion in NinjaTrader

Updated
    1. trending_up 2,111 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

custom timeframe

  #1 (permalink)
 toulouse-lautrec 
Europe
 
Experience: Beginner
Platform: NinjaTrader
Posts: 73 since Jun 2009
Thanks Given: 13
Thanks Received: 53

Hello,
i was wondering if it might be possible to have an indicator perform on another individually adjustable timeframe, independent of the timeframe the current chart is set to? e.g. chart is set to 1000 ticks however indicator is based on 5 min.

if so, does anyone have an example they might share or code snippets?

greetings

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
26 thanks
The Program
18 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



toulouse-lautrec View Post
Hello,
i was wondering if it might be possible to have an indicator perform on another individually adjustable timeframe, independent of the timeframe the current chart is set to? e.g. chart is set to 1000 ticks however indicator is based on 5 min.

if so, does anyone have an example they might share or code snippets?

greetings

This is possible. You can code an indicator that performs calculations on another adjustable timeframe. There are a few different solutions:


(1) You can simply add a second bar series to your chart and add an indicator to that bar series. If you do not wish to see it, you can set the second bar series to transparent. The inconvenient of this method is that your chart may suffer from non-equidistant bar spacing.

(2) You can code an indicator that loades secondary bars, which are used for calculations. I have coded a lot of these, and most versions are obfuscated, because it is pretty difficult to do and get a good result.

Examples are:

2a) VisualSMA and VisualEMA: They allow you to calculate the SMA and EMA from minute, tick, volume or Range bars irrespective of your main bar series on the chart. The non-equidistant bar spacing is gone, but you pay a price as the method introduces a little lag. Assume a 500 tick bar which closes at 2:35:42 PM (primary bar) and a 5 min bar which is used for calculating indicator values which closes at 2:35:00 PM. In that case the indicator value calculated from the 2:35:00 PM bar can only be displayed 42 seconds later, when the tick bar closes. You indicator now has a lag, which was not the case for solution (1). You cannot have it all, you will either get non-equidistant bar spacing or a lag. For backtesting this can be avoided, if you primary bar series is a 1-tick series. In that case you are in the best of all worlds, but the result - a 1 tick series on your chart - is not exactly visually appealing.

The indicators can be found here:




2b) Here is an open code indicator, which I have published, which allows to calculate the exact opening range of a minute based period on a tick, range or volume chart. The indicators works, but I have recently developed a better approach to the problem. Nevertheless, you could have a look at the code, as it is a genuine multi-timeframe indicator.



3) It is also possible to calculate composite bars. For example, if you have a 5 min bar series, you can easily calculate indicators using an integer multiple of the 5 min bar period. You could produce a 10 min Stochastics, or a 35 min MACD.

Reply With Quote
Thanked by:
  #4 (permalink)
 toulouse-lautrec 
Europe
 
Experience: Beginner
Platform: NinjaTrader
Posts: 73 since Jun 2009
Thanks Given: 13
Thanks Received: 53

FT,

thanks for your very detailed reply.

Shortly after posting i found your thread where you discuss your two indicators. These are really a great help, thanks again for sharing your work here.

I will keep experimenting using your VisualSMA with a period of 1 and the desired period as input for indicators, which should hopefully have the desired effect.

Started this thread Reply With Quote
Thanked by:




Last Updated on September 6, 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