Download MetaTrader 5
To add comments, please log in or register
Share links on the Forum. Now they have Rich Content!
bayan_trader
20
bayan_trader 2016.09.30 17:00 

Hi, I am trying to create a custom indi to draw simple horizontal lines at specific prices. I will enter those prices manually.

Would you guys pls help me on this. I hope this should be very simple for the person who can code. I can continue working on it.

Many thanks in advance :) 

whroeder1
13589
whroeder1 2016.09.30 17:59  
bayan_trader: . I hope this should be very simple for the person who can code.
  1. It should be simple to code. So do it.
  2. 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.
Keith Watford
Moderator
7861
Keith Watford 2016.09.30 21:06  
Read the help file for ObjectCreate
bayan_trader
20
bayan_trader 2016.09.30 21:21  
WHRoeder:
bayan_trader: . I hope this should be very simple for the person who can code.
  1. It should be simple to code. So do it.
  2. 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.

hi, thank you for replying. I am not a programmer but I am trying to draw multiple horizontal lines.

 Is this could be a start? I can't compile this code because of some errors. would you pls help me to fix it?

 Thanks 

//+------------------------------------------------------------------+
//|                                                         Bato.mq4 |
//|                                             Copyright 2016, BATO |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, BATO"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window

//+------------------------------------------------------------------+
//| Create the horizontal line                                       |
//+------------------------------------------------------------------+
bool HLineCreate(const long            chart_ID=0,        // chart's ID
                 const string          name="HLine",      // line name
                 const int             sub_window=0,      // subwindow index
                 double                price=0.9645,           // line price
                 double                price=0.9640,           // line price
                 double                price=0.9658,           // line price
                 double                price=0.9662,           // line price
                 const color           clr=clrDarkGray,        // line color
                 const ENUM_LINE_STYLE style=STYLE_DOT, // line style
                 const int             width=1,           // line width
                 const bool            back=false,        // in the background
                 const bool            selection=true,    // highlight to move
                 const bool            hidden=true,       // hidden in the object list
                 const long            z_order=0)         // priority for mouse click

  
  }
//+------------------------------------------------------------------+
bayan_trader
20
bayan_trader 2016.09.30 21:44  

guys is it possible to draw 2 horizontal lines (open and close of the candle) by entering dates into the code?

is this the code for that? How can i use it?

double  ObjectGetValueByTime(
   long       chart_id,      // chart ID
   string     object_name,   // object name
   datetime   time,          // time
   int        line_id=0      // line ID
   );
Keith Watford
Moderator
7861
Keith Watford 2016.09.30 22:45  
bayan_trader:

hi, thank you for replying. I am not a programmer but I am trying to draw multiple horizontal lines.

 Is this could be a start? I can't compile this code because of some errors. would you pls help me to fix it?

 Thanks 

 

You can't compile it because you have a function with no execution code. In fact no code at all, just parameters passed to a function
Keith Watford
Moderator
7861
Keith Watford 2016.09.30 22:51  
bayan_trader:

guys is it possible to draw 2 horizontal lines (open and close of the candle) by entering dates into the code?

is this the code for that? How can i use it?

 

You can't just copy and paste blocks of code from the documentation and expect them to work.

You have to ubderstand what you are trying to achieve and learn the methods to do that.

Coding in mql4 takes study time and effort, you can't just jump in and do it without learning the basics.

Fernando Carreiro
1428
Fernando Carreiro 2016.10.01 07:34  
bayan_trader: Hi, I am trying to create a custom indi to draw simple horizontal lines at specific prices. I will enter those prices manually. Would you guys pls help me on this. I hope this should be very simple for the person who can code. I can continue working on it. Many thanks in advance :)
Unless you already have some good experience in coding in languages like C or C++ or the like, don't think that you can just code an Indicator or EA by simply glancing at the documentation and a few copy/pasts.

You should first learn coding in general in C, before moving onto MQL4 and it takes many months (even a couple of years), for a complete beginner, to properly learn to code Indicators or EAs in MQL.

You need time to properly gain the necessary knowledge and coding experience for it. Obviously, if you are serious about it and have the dedication to stick with it, then go for it. But remember that it is a long-term project, and not short term.

If however, you are not serious about learning to code, or you need a solution quickly, then please consider hiring someone to code for you. Go to the Freelance section and place a Job advert, stating your budget and describing your requirements.
/
To add comments, please log in or register