How to make hotkey for "Vertical Line"?

 

Hello,

 

How to make hotkey for "Vertical Line" in MT4?

 

Thanks,

Max 

 
Max-Enrik: How to make hotkey for "Vertical Line" in MT4?
  1. Write a script that creates a vertical line, assign a hotkey to it.
  2. Why bother? Click on the vertical line button and then the chart.
 
WHRoeder:
Max-Enrik: How to make hotkey for "Vertical Line" in MT4?
  1. Write a script that creates a vertical line, assign a hotkey to it.
  2. Why bother? Click on the vertical line button and then the chart.

Thanks for reply.

I do not know how can I write a script. 

I would like to make automatically create "Vertical Line"s like screenshot.

How can I make it. 


Screenshot 

Please find attachment file. 

 
Max-Enrik: I do not know how can I write a script.
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

No file(s) attached.
 
input ENUM_TIMEFRAMES in_tfRef = PERIOD_H1;  // Reference time
input int in_lines = 10;                     // Number of lines

OnStart()
{
   for (int i=0; i<in_lines; i++)
      ObjectCreate("line_"+(string)i, OBJ_VLINE, 0, iTime(Symbol(), in_tfRef, i), 0);
}

This is the minimum to do what you are asking. It does not have error checking nor lines styling. I have not tested it but I think it should work.

Now learn how to do an script, there is a lot of documentation about it.

Regards.

 
xiruko:

This is the minimum to do what you are asking. It does not have error checking nor lines styling. I have not tested it but I think it should work.

Now learn how to do an script, there is a lot of documentation about it.

Regards.

I have a lot of errors.

Thanks! 

 
Max-Enrik:

I have a lot of errors.

Thanks! 

Lots of errors? I realised that it actually has one error:

void OnStart()

 I forgot the void keyword.

 Now it works correctly (I have just tested it).

 Regards. 

 
xiruko:

Lots of errors? I realised that it actually has one error:

 I forgot the void keyword.

 Now it works correctly (I have just tested it).

 Regards. 

Thanks so much. You made my day. I highly appreciate it.

I would like to add Vertical Line to forward (future H1). Also How can I change color to Black? 

I will be very happy if you help this one.

 

All best,

Max

 

 

Screenshot

 
Max-Enrik: I would like to add Vertical Line to forward (future H1). Also How can I change color to Black? 
xiruko This is why just giving them the answer doesn't work. He has learned nothing, and now wants you to change it again.
 
WHRoeder:
xirukoThis is why just giving them the answer doesn't work. He has learned nothing, and now wants you to change it again.

My bad. I apologize for that. I will send to you errors message when I start pc.

Also I am new in this area. Where may I learn how to create a script?

Thanks for your support.

 

All best,

Max 

 
Max-Enrik: . Where may I learn how to create a script?
You can lead a horse to water, but you can't make him drink. I can post links, but I can't make you click
Reason: