Scripts to open a chart and draw something on the opened chart? Possible?

To add comments, please log in or register
ggjjm5
11
ggjjm5  

Hi, 

So far whenever I am facing a problem, I always can find a solution from MQL or online. However, I got stuck on this problem. Maybe this is a limitation from MT4.

The task is to open a chart using Chartopen(), and then draw something(lines) on the opened chart, but not the one we run script on.

For example, I have one USDCAD chart in my terminal, there is a script which is executed on the USDCAD. The script is to open GBPUSD chart, and draw a line on GBPUSD(not on USDCAD), is it possible?

Many thanks,

Alain Verleyen
38676
Alain Verleyen  
Yes it's possible.
sistema
30
sistema  
Alain Verleyen :
Yes it's possible.

can I open two exchanges (usd / jpy-gbp / usd) in the same chart and compare the respective prices?

nicholi shen
2392
nicholi shen  
#include <chartobjects/chartobjectslines.mqh>
#include <charts/chart.mqh>

void OnStart()
{
   CChartObjectVLine vline;
   CChart chart;
   chart.Open("GBPUSD", PERIOD_CURRENT);
   vline.Create(chart.ChartId(), "vline_test", 0, TimeCurrent());
   chart.Redraw();
   Sleep(5000);
   chart.Close();
}
ggjjm5
11
ggjjm5  

Wow! that really works. Many thanks. nicholi.

That is definitely advanced programming for me. It is worth learning C++.

See, any problem has a solution, I believe. so far at least.

To add comments, please log in or register