What I've ended up with works on all time based timeframes (except Monhtly and Yearly), as well as tick and volume timeframes. It also works for all chart types (Candlestick, OHLC, HiLoBars and LineOnClose). Theres also been a lot done to optimise the efficiency of the code, so it produces little overhead in terms of cpu usage.
The above screenshot shows Multiple Timeframes (MTF) added 3 times with different options applied. The first MTF is given a Multiplier input of 2 (the default) which creates a 2 minute panel (because we started off with a 1 minute chart), I've then applied the embedded "Scalper style" option which gives the same results as the Scalper indicator would on a 2 minute chart. The second MTF I've created a 5 minute panel and applied the embedded ModHeikenAshi option. The third MTF I've created a 15 minute panel and applied the Candle scale option to produce larger candles.
Above is a screenshot of the properties options all set to default. Notice that by default we take on the Plot type, such as "CandleStick", "OHLC" and the up/down colours directly from the Chart's existing defaults, but we can if we want use the override options to create mixed charts. There is no limit in terms of applying all the options at once, etc..
For those TTM fans I've attached another screenshot with the bars set in a TTM / OHLC manner with both Scalper and ModHeikenAshi stype options applied. The Scalper and ModHeikenAshi implementations are exactly the same as in the standalone indicators, with one exception, if you are running the Scalper on a time based chart within the MTF and have enabled the "Highlight current trigger bars" option you will be able to see historic trigger bars as you scroll backwards, an added bonus and side effect of the MTF optimisation process.
There are two things to be aware of.
1. NT will only allow indicators in seperate panels to display values/prices always set to 2 decimal places, so by default MTF will adjust the price, whether the ticksize is above or below 2 decimal places to be 2 decimal places. If you want to change the MTF behaviour you can by changing the "Price indicator scale" option in properties, you will probably soon notice the limitation, but it has the advantage in that you can overlay other indicators if the ticksize is not 2 decimal places (e.g. an EMA with a matching scale for its input period).
2. These candles are reconstructed bars completely done in MTF and do not constitute NT Bars objects or anything similar. So an MTF bar for a day, for example, which was created from minute bars, will possibly have different boundary times to a default NT daily bar.
To import:
- Download the file contained in this thread to your desktop
- From the Control Center window select the menu File > Utilities > Import NinjaScript
- Select the downloaded file
Comment