NinjaTrader 7 Indicators - BarTimes indicator
futures io


Categories Help    

NinjaTrader 7 Indicators
Indicators in this section are compatible with NinjaTrader 7


Entries
BarTimes indicator 5 *
Exported with NinjaTrader 7.0.1000.31

Latest revision on 7/27/16 - see revision notes for details

This indicator computes the elapsed time between bars on a non-time based chart. There are a number of enhancements to the indicator GHPBarTimer by NJAMC upon which it is based. Upon Installation it will be named fpgBarTimes so as not to conflict with the base indicator.


Additions/modifications/fixes included in the 7/27/2016 version
  1. Added : an option to display an Alert message when the MA for the total time is above, below, or both (an Or condition) of the designated time zones. Setting this option will force the Non-Directional Plot to be included (see #3 below)
  2. Added: an IntSeries file to record the results of number 1 above, as controlled by the switch that allows the recording of various outputs.
  3. Added : option to plot MAs for the bar time in Up bars and Down bars (directional Option). Doji bars have their bar time evenly split across the two so it does not skew the results. The period for these can be set to a different value than the MA total (Non-Directional option) time. Both can be plotted.
  4. Added: an Auto adjust feature which will adjust the various time line values according to the change in chart’s bar type or value. The purpose is to allow the user to change a bar type or value and automatically adjust the zone time lines by a ratio calculated (to the nearest .25) from the bar types values specified in the various Bar Type parameters.

    For example, if the chart bar type is set to Tick with a value of 75 (which matches the parameter value for a tick bar) changing that value to 150 would result in the zone line values being doubled. Note: if the Time Lines Option (#04) is set to “TimeIncrement” then the increment value may or may not be adjusted according to the AutoAdjust Increment setting. The bar types supported is as follows: Tick, Renko, UniRenko, BetterRenko, SveRenko, Range, and Volume. Others can easily be added (see number 4 in the Notes section under this item).

    Hint: When using this option first set the default values (these are found in the Auto Adjust Parameters section) for each bar type that you intend to use and save it as the indicators default profile. Once set, those values will be the base from which all of the calculations will be done when changing either the bar type or the bar type’s value. Once the final bar type/value is determined the appropriate parameter(s) should be set and the auto adjust option turned off as it is intended to be an aid for determining the appropriate zone line and time settings for the bar type and/or value.

    Notes:
    4.1. Only a few of the possible combinations or bar type changes have been tested. However, the logic for processing these changes is the same for all. It is possible that there may still be a bug.
    4.2. Because the calculated value might be hard to determine from the Y-axis there is an option to log the results to the Output window.
    4.3. This enhancement should be used as an aid to determine new zone setting when a bar type or value is changed.
    4.4. If the code is modified to support additional bar types, be sure to keep the type and value in the same relative order as an index is used in the code.

    5 Modified: various colors for better contrast on a chart with a dark background.
    6.]Modified: the default zone line values. [FONT=Calibri]
    7. Fixed: the HFT zone value was not being written to the DataSeries.
    8. Fixed: the Max time percent was not used in the calculation.

    Note:
    There is no version number in the indicator's name therefore it will replace the existing indicator. If a backup copy is deemed necessary export the old version first. Also recommend that the previous version be deleted first.

Original Enhancements are as follows:


1. A minutes or seconds display is user selectable

2. Bar times are organized into user defined time “zones” as follows:
a. Time Zone 1 (TZ-n) is the starting TZ and is defined in decimal minutes, i.e., 0.5 = 30 seconds, etc.
b. A user defined increment, also in decimal minutes, is added to TZ-1 to create TZ-2. The same increment is added to TZ-2 to create TZ-3. TZ-4 is anything above TZ-3. Lines are produce for TZ-1 to 3. The HTF-like “zone” is a sub period of TZ-1 and is identified when the bar time is LT or EQ to a user define number of seconds. If the bar time is below the defined time it could be considered potential HFT activity
c. An optional histogram of TZ1-TZ4 times is produced, with each zone having a user defined color.
3. An optional truncated display for excessive bar times (above Zone 3) which will force a user define percentage (xx.y) be added to the TZ-3 value and used to plot excessive bar times. This is done to keep the indicator panel the same size. Setting a max value does not disturb the MA calculation.

4. Optional visual alerts using background colors can be painted for excessive time (EXT) bars and potential HFT bars, or
both. A consecutive bar count can be set for both to eliminate false alerts for both EXT and HFT-like bar times.

5. A moving average for current bar times can be calculated from 6 MA types.

6. The assigned zone number for the current bar time and its moving average can be sent to 2 IntSeries which can be
used in Bloodhound or user written strategy. The values are 0 = potential HFT-like activity (only the current bar time
zone), 1-3 the zone number for the current bar time and its MA, and 4 = excessive bar time (EXT zone) also for the
current bar time and the MA.

7. Using this indicator on a time based chart will produce a message in the lower right
corner and disable further calculations.

Please PM me if you encounter any problems rather than write them in the review.

Revision Descriptions:

1. 6/11/16 The revision includes the Zone code = 0 for HTF-like time bars in the IntSeries.
2. 7/27/16 Revision description is above

Note:
If you have the previous version, unless the IntSeries is used in either a strategy or in BloodHound and the indication of when there is a HTF-like bar is desired, it is not necessary to install the latest version.


Change Log:
6/7/16 Initial release
6/11/16 Emit Zone code to IntSeries for HFT-like bar time
7/27/16 Various, described above


Category NinjaTrader 7 Indicators 
 
Suggest other entries I might like
Details: BarTimes indicator
Category: NinjaTrader 7 Indicators 


June 7th, 2016
Size: 24.43 KB
Downloaded: 592 times
 


 
Category
 



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.