Download MetaTrader 5

How to make hotkey for "Vertical Line"?

To add comments, please log in or register
Examine the Top MetaTrader 5 signals. Choose the best one and subscribe to it!
Max Enrik
814
Max Enrik 2015.03.31 19:53 

Hello,

 

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

 

Thanks,

Max 

whroeder1
14518
whroeder1 2015.03.31 20:49  
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.
Max Enrik
814
Max Enrik 2015.03.31 21:06  
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. 

whroeder1
14518
whroeder1 2015.04.01 00:59  
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.
Miguel
30
Miguel 2015.04.01 01:09  
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.

Max Enrik
814
Max Enrik 2015.04.01 07:48  
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! 

Miguel
30
Miguel 2015.04.01 11:43  
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. 

Max Enrik
814
Max Enrik 2015.04.01 13:44  
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

whroeder1
14518
whroeder1 2015.04.01 16:30  
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.
Max Enrik
814
Max Enrik 2015.04.01 17:29  
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 

whroeder1
14518
whroeder1 2015.04.01 18:10  
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
12
To add comments, please log in or register