Horizontal Line Drawing
Results 1 to 4 of 4

Thread: Horizontal Line Drawing

  1. #1
    Good afternoon everyone.

    I don't know how to program in MT. I'm looking to learn a bit in order to plan something I expect is quite simple to do. I am not looking to do the work for me personally, but if what I am trying is possible, I would love to know. The operational spec is as follows:

    The indior could have three input variables:

    1. SPREAD (integer)
    2. ENTRY (price)
    3. STOPDIST (integer)

    According to those three inputs, I want the indior to draw some standard MT4 horizontal dashed-lines on my chosen chart. For instance:

    Draw a red horizontal line at (ENTRY minus STOPDIST) and tag it SL.
    Draw a green horizontal line at (ENTRY plus STOPDIST) and tag it R1.

    Those 2 are only examples, and do not utilize the SPREAD variable. But, in a nutshell, I want to be able to calculate some values utilizing those three inputs and then have MT4 draw and label different color lines in that price on my chart.

    I'm not seeking to say pls post all replies here pls (because it always seems so damn cheeky!) . Butif anyone could let me know if this is feasible I would be quite grateful and go looking to attempt to do it!

    Cheers,
    Dave

  2. #2
    It's possible, here is a beginning point:

    //Input Values
    extern int SPREAD = 5;
    extern int ENTRY = 3;
    extern int STOPDIST = 20;

    //Calculate Line Positions
    SLprice1=....
    R1price1=....

    //draw Lines
    ObjectCreate(SL, OBJ_HLINE, 0, SLprice1);
    ObjectSet(SL, OBJPROP_COLOR, clr);
    ObjectSet(SL, OBJPROP_STYLE, STYLE_DOT);
    ObjectSetText(SL, StopLoss, 10, Times New Roman, Red);

    ObjectCreate(R1, OBJ_HLINE, 10, R1price1);
    ObjectSet(R1, OBJPROP_COLOR, clr);
    ObjectSet(R1, OBJPROP_STYLE, STYLE_DOT);
    ObjectSetText(R1, R1, 10, Times New Roman, Blue);

  3. #3
    Charlie,

    Thank you for the affirmation that it's possible, and thanks even more so for your code to start off me - that was actually quite kind of you.

    Cheers,
    Dave

  4. #4
    How is program written by you in MT4?

    Can you show me too? Where do I go to create an indior which you show to davecrom01?

    Please discuss.

    Thank you.

    .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.