Overlay Chart

Shouldn't there be some sort of CopyBuffer or ArrayInitialize to O[] after the
"O[_i] = _CurRangeCenter + _SubOpen * _PipsRatio;" line?

O[0] for now in the CHFJPY example is around 107.262 instead of the indicator's plotted value of around 1.12443 when overlaid on the EURUSD chart in the attached chart example.

The value of O[0] is not current.

Screen_Shot_2016_07_22_at_1_03_46_PM.png
 
Enivid, USD index is frozen between 4pm EST and is normal at 8pm EST...so when overlay any other currency pair with USD index there is offset..doesn't match charts. All other pairs are OK. is it possible to fix that offset? Thank you.
 
It took me quite long, but I have finally updated the MQL5 version of the OverlayChart indicator to properly synchronize subcharts that have fewer (or more) bars than the host chart. For example, here is the EUR/USD chart with S&P500 index futures overlaid on H1 timeframe - when there are not enough bars, no subsymbol bar appears on the chart:

sp500-on-eurusd.png

And this is the German DAX30 index futures chart with EUR/USD added to it. When there is no place to display the more frequent EUR/USD bars, they are skipped:

eurusd-on-dax30.png
 

Attachments

  • 👍
Reactions: japking, Loneblade and jagg
It took me quite long, but I have finally updated the MQL5 version of the OverlayChart indicator to properly synchronize subcharts that have fewer (or more) bars than the host chart. For example, here is the EUR/USD chart with S&P500 index futures overlaid on H1 timeframe - when there are not enough bars, no subsymbol bar appears on the chart:

View attachment 14827

And this is the German DAX30 index futures chart with EUR/USD added to it. When there is no place to display the more frequent EUR/USD bars, they are skipped:

View attachment 14828
Thank you so mutch for this indicator - it works very well
 
Hi .
I hope you are doing well
Thanks for your great site and information .
I found the OverlayChart.mq5 on your site .
I want to change it to an ea to see the bars on the chart .
But i want to migrate it to an ea and have 1 file inclusing the ea and indicator .
Can you help me to do this ?
The ea is not supposed to do anything . just see the OverlayChart on the screen .

Thanks
 
@darioaquino I guess you could just add something like if (prev_calculated > 0) return(rates_total); at the top of the OnCalculate() function, but what is the point of preventing it from adding new bars?

this indicator of the option to start at the bar x set_center thus having a greater precision of the price distance
 

Attachments

  • 1.png
    1.png
    401.1 KB · Views: 17
  • 2.png
    2.png
    398.6 KB · Views: 16
As I can see in the attached code, the indicator uses the Close value of a given bar instead of the High-Low range middle to draw the overlay chart. But how does that improve its precision?

It isn't difficult to change the current MT5 version to take the set_center bar as an input parameter, I just don't see how it makes anything better.
 
hi, i wonder how to set overlay chart price label put on right side instead of left ? Thanks
Yes, just change this line:
MQL5:
ObjectSetInteger(0, grid_string, OBJPROP_TIME, 0, Time[_FirstBar - _BarsCount / 10]);
to this:
MQL5:
ObjectSetInteger(0, grid_string, OBJPROP_TIME, 0, Time[_LastBar]);
 
I have updated OverlayChart to version 1.03 to make the following changes:
  1. When using Line plot type, it now properly uses Close timeseries of the SubSymbol instead of its Open timeseries.
  2. The overlay chart is recalculated every second if there are no ticks - this will help you to analyze charts of the closed or inactive markets.
  3. SubSymbol price scale can now be positioned on the right side of the chart (via an input parameter).
  4. Added chart commentary with the SubSymbol for reference.
Here is an example of the chart with the right-side price scale:
overlay-demo.png
 

Attachments

  • 👍
Reactions: Loneblade
Is it possible to add more then one(5-10) on the same chart?
Yes, but you have to change the code a little bit. Find this line:
MQL5:
string Prefix = "OverlayChart"; // Indicator prefix.
and change it to this:
MQL5:
input string Prefix = "OverlayChart"; // Indicator prefix.
Then, you will be able to modify the prefix for chart object names each time you add the indicator to the same chart. Make sure the prefix is unique for each indicator.
 
Yes, but you have to change the code a little bit. Find this line:
MQL5:
string Prefix = "OverlayChart"; // Indicator prefix.
and change it to this:
MQL5:
input string Prefix = "OverlayChart"; // Indicator prefix.
Then, you will be able to modify the prefix for chart object names each time you add the indicator to the same chart. Make sure the prefix is unique for each indicator.
Thanks Enivid, the problem now is we don't know which colour represents which instrument. It would be good to have a coloured label to represent which different colour represents which instrument.
 
Thank you
Thanks Enivid, the problem now is we don't know which colour represents which instrument. It would be good to have a coloured label to represent which different colour represents which instrument.
Thnak you for the idea Enivid
Loneblade: If you point your mouse over the overlay char you will see tha name of the instrument.
 
  • 👍
Reactions: Enivid