MT4-HOWTO insert a line on chart that would match a certain variable value?

 

Hi,

I would like to have a line appear on my chart that would match a variable value so I could follow the EA visually. (MT4 please)

similar to a Trailing Stop mouvement.

I would also like to change the color of some lines in comments if possible.

Any help or advice would be appreciated.

Thanks.

 

if(ObjectFind<0) ObjectCreate in OnInit, ObjectDelete in OnDeinit, ObjectSetInteger(price)=variable && ChartRedraw in main function.

 
kypa:

if(ObjectFind<0) ObjectCreate in OnInit, ObjectDelete in OnDeinit, ObjectSetInteger(price)=variable && ChartRedraw in main function.

Thanks Kypa,

Looks like indicator commands (I know nothing about indicator coding but I will fiddle arround and try to figure it out.

Thanks again.

Mick

 

These are MQL functions, you can find documentation about them here:

https://www.mql5.com/en/docs/function_indices

You can write an indicator, an expert or fit them in the existing expert's code.

You will actually need ObjectSetDouble for price, it's my mistake. You can however use ObjectSetInteger to set objects' colors.

Documentation on MQL5: List of MQL5 Functions
Documentation on MQL5: List of MQL5 Functions
  • www.mql5.com
Reads from the file of the CSV type a string of one of the formats: "YYYY.MM.DD HH:MM:SS", "YYYY.MM.DD" or "HH:MM:SS" - and converts it into a datetime value
 
kypa:

These are MQL functions, you can find documentation about them here:

https://www.mql5.com/en/docs/function_indices

You can write an indicator, an expert or fit them in the existing expert's code.

You will actually need ObjectSetDouble for price, it's my mistake. You can however use ObjectSetInteger to set objects' colors.

Great kypa,

That gives me a good starting point.

BTW, i noticed that the command you pointed out, seems to point to the sub-window and not the main window-chart wich im looking for.

I will probably find it at that link.

Thanks

Mick
Reason: