Range Bars
- Indicadores
- Artur Zas
- Versión: 1.12
- Actualizado: 19 julio 2021
- Activaciones: 10
The robust charting solution enables creating custom live range bar charts on the MetaTrader 4 trading platform.
You can apply all of the standard and custom indicators and technical studies directly to the range bar charts and you can run EAs directly on these charts as well* (for details see text below the input summary).
To create a range bar chart you need to attach the Range Bar indicator to a standard time frame (1 minute is recommended) and use the indicator's settings to generate a live custom chart that will be displayed on an offline chart of your choice. All of the available settings are described below:
Bar type definition
- Range bar size - Defines the since of the range bar
- Range bar calculation mode - ( pips / ticks/ points / ATR % / % )
- Build history for number of days
- Build history starting from date
Settings for ATR based bar size calculation
- Daily ATR period
- Percentage of ATR to calculate candle size (high to low).
Chart synchronization
- Reset Open on each trading day.
- Override start of trading day
Misc settings
- Display on offline chart (M2, M3, M4, M6, M7, M8, M9 or M10)
- Apply template to offline chart (name of the template to apply to the range bars chart)
- Automatically open offline chart (true/false)
- Re-calculate chart on history updates.
- Minimum chart update interval (defined in milliseconds).
Alerts and Info
- Sound signal on new bar (true/false).
- Only signal reversal bars (true/false).
- Use Alert Window to display signal (true/false).
- Sound file to play on bullish bar.
- Sound file to play on bearish bar.
- Color of High threshold indicator.
- Color of Low threshold indicator.
- Color of an inactive threshold indicator.
* EAs can be used directly on the offline chart, however, a small tweak is required, so you need to have access to your EA source code. Below is an EA skeleton example that is capable of running directly on the offline chart:
#property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { // You need to initialize a time to call the OnTimer event. // It is used to call OnTick whenever the Bid price changes. // The check is made every 250 ms, which should be sufficient. EventSetMillisecondTimer(250); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { // Remember to destroy timer in the OnDeinit event. EventKillTimer(); //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { // // This is where all of your EA trading logic resides. // I just write to the log in this example... // Print("OnTick function call - bid = "+(string)Bid); } //+------------------------------------------------------------------+ //| The OnTimer function is used to call OnTick() | //| whenever the Bid price changes. | //+------------------------------------------------------------------+ void OnTimer() { RefreshRates(); static double prevBid = 0; if(Bid != prevBid) { prevBid = Bid; OnTick(); } } //+------------------------------------------------------------------+
works great, I recommend it