Overlay Chart

johnnybegoode

Trader
Jul 19, 2016
56
0
22
47
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
 

ruma29

Master Trader
Nov 12, 2016
58
4
49
58
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.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,298
1,529
144
Odesa
www.earnforex.com
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

  • OverlayChart.mq5
    11.6 KB · Views: 38
  • 👍
Reactions: japking, Loneblade and jagg

Eurotrade

Trader
Jan 9, 2020
1
0
17
73
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
 

masoud_da

Newbie
Apr 8, 2020
1
0
1
47
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

Newbie
Oct 8, 2019
2
0
2
42
someone could put in mt5 without repainting
 

Attachments

  • Overlay Chart Modified to Not Repaint on each bar MT4 Indicator.mq4
    17.4 KB · Views: 19

darioaquino

Newbie
Oct 8, 2019
2
0
2
42
@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

Enivid

Administrator
Staff member
Nov 30, 2008
19,298
1,529
144
Odesa
www.earnforex.com
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.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,298
1,529
144
Odesa
www.earnforex.com
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]);
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,298
1,529
144
Odesa
www.earnforex.com
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

  • OverlayChart.ex5
    21 KB · Views: 5
  • OverlayChart.mq5
    14.3 KB · Views: 10
  • 👍
Reactions: Loneblade

Enivid

Administrator
Staff member
Nov 30, 2008
19,298
1,529
144
Odesa
www.earnforex.com
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.
 

Loneblade

Trader
Oct 9, 2019
35
9
19
Singapore/Beijing
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.
 

1pips

Trader
Oct 6, 2022
3
2
8
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