Results 1 to 2 of 2
 0 Attachment(s)    

Thread: How to draw a line for high/low boundaries

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    5

    Default How to draw a line for high/low boundaries

    Hello all,
    first of all, many thanks to funyoo for his great job and especially for this awesome and very useful "how to" section for those, like me, that are fighting with MQL language.

    I would like some tips about how to draw 2 lines (at High and Low) of a specific bar after a specific condition has been meet.

    eg. if the current bar, after close (that means bar[1] because the new bar[0] is already started and is forming, is an inside bar of the previous bar (in that case bar[2]), I would like to draw 2 lines at High and Low of bar[2].

    Many thanks in advance
    Mimmo

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by skipper View Post
    Hello all,
    first of all, many thanks to funyoo for his great job and especially for this awesome and very useful "how to" section for those, like me, that are fighting with MQL language.

    I would like some tips about how to draw 2 lines (at High and Low) of a specific bar after a specific condition has been meet.

    eg. if the current bar, after close (that means bar[1] because the new bar[0] is already started and is forming, is an inside bar of the previous bar (in that case bar[2]), I would like to draw 2 lines at High and Low of bar[2].

    Many thanks in advance
    Mimmo
    Hi skipper and welcome,

    Here is an idea :

    string Inside="false";
    if(conditions)Inside="true";

    for(int i=0;i<2;i+=2){
    if(Inside="true"){
    ObjectDelete("recth"+i);
    ObjectCreate("recth"+i,OBJ_HLINE,0,0,High[1]);
    ObjectSet("recth"+i,OBJPROP_COLOR,Red);
    ObjectSet("recth"+i,OBJPROP_WIDTH,1);
    ObjectSet("recth"+i,OBJPROP_RAY,False);}
    if(conditions to delete the lines){ObjectDelete("recth"+i);}
    }

    for(int j=0;j<2;j+=2){
    if(Inside="true"){
    ObjectDelete("rectl"+j);
    ObjectCreate("rectl"+j,OBJ_HLINE,0,0,Low[1]);
    ObjectSet("rectl"+j,OBJPROP_COLOR,Red);
    ObjectSet("rectl"+j,OBJPROP_WIDTH,1);
    ObjectSet("rectl"+j,OBJPROP_RAY,False);}
    if(conditions to delete the lines){ObjectDelete("rectl"+j);}
    }

Similar Threads

  1. High Frequency EA??? Extremely High Number of Trades
    By joseclar in forum Expert advisors live statements
    Replies: 1
    Last Post: 01-21-2011, 10:37
  2. How can i draw a dot on my chart?
    By [+EagleEye+] in forum MQL programming
    Replies: 1
    Last Post: 08-21-2010, 11:44
  3. High frequency EA- High number of trades
    By joseclar in forum Ideas for expert advisors
    Replies: 2
    Last Post: 02-28-2010, 08:50
  4. Draw moving SL
    By przem81621 in forum Scripts and other tools
    Replies: 8
    Last Post: 10-15-2009, 02:51

Tags for this Thread

color, funyoo, high, how to, low, mql

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •