+ Reply to Thread
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,455

    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);}
    }

+ Reply to Thread

Similar Threads

  1. High Low v2 EA
    By funyoo in forum Expert advisors backtesting
    Replies: 4
    Last Post: 03-08-2012, 06:23
  2. Bars Price High Low EA
    By funyoo in forum Expert advisors backtesting
    Replies: 49
    Last Post: 09-18-2011, 01:25
  3. Draw moving SL
    By przem81621 in forum Scripts and other tools
    Replies: 8
    Last Post: 10-15-2009, 01:51
  4. High impact fundamental EA
    By tradebymago in forum Ideas for expert advisors
    Replies: 6
    Last Post: 08-19-2009, 14:49
  5. Bars Price High Low SMA Filter EA
    By funyoo in forum Expert advisors demo statements
    Replies: 0
    Last Post: 11-23-2008, 21:29

Posting Permissions

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