Re: MT4 Indicator requests and ideas

15124
pin12 wrote: Mon Mar 14, 2022 2:20 pm Hello !

This is a script that performs buy and sell operations simultaneously, but it doesn't work, perhaps because of a programming error, or because the code isn't updated.

Could someone fix it please? Thanks since now..
Try, seems ok now.
These users thanked the author mrtools for the post (total 2):
Sincere007, pin12

Re: MT4 Indicator requests and ideas

15125
Jimmy wrote: Sun Mar 13, 2022 9:25 pm Link removed and attached your image to your post. In future please attach all files to posts as links aren't permitted in this section.

You may upload it by attaching it to your post using this guide: How to attach images and indicators.
Thank you! Please tell me or give a link to a page or topic where I can look at and select one of the indicator modifications: dynamic-cycle-expiorer-indicator , I will be very grateful to you, I'm just a beginner and have not yet figured out how and where to look on the site, but I know there are topics on some indicators, where many of their versions are posted. Thank you in advance.


IndicatorRe: MT4 Indicator requests and ideas

15127
Hi Everybody,

I've found and modified a gap finder indicator for MT4 and I'd love to add a simple toggle On/Off button on chart.
Could someone help me?
I'm new to coding and I'm struggling figuring out how to properly set it.

Code: Select all

#property indicator_chart_window
#property indicator_buffers 1
#property description "Automatically render boxes for liquidity gaps "
#property indicator_color1 Black

extern double Gap_Size_Minimum = 100;
extern int ExtendBars = 1000;
extern int    History = 1000;
extern color Gap_Up = Aqua;
extern color Gap_Down = Tomato;
input ENUM_LINE_STYLE Rectangle_Style = STYLE_SOLID;

double Pip;
int init()
  {
    Pip = Point;
   if(Digits==3 || Digits==5) Pip = 10*Point;
   return(0);
  }

int deinit()
  {
    string ObjName;
    for(int i = ObjectsTotal()-1; i>=0; i--)
    {
      ObjName = ObjectName(i);
      if(StringFind(ObjName,"liquidity_gaps",0)>=0)
        ObjectDelete(ObjName);
    }
    return(0);
  }

int start()
  {
   int i, limit, counted_bars=IndicatorCounted();
   limit = MathMin(History,Bars-counted_bars-1);
   string ObjName;
   for(i=limit; i>=0; i--)
   {
     if(i>Bars-2) continue;
     if(MathAbs(Open[i]-Close[i+1]) > Gap_Size_Minimum*Pip)
     {
       ObjName = "liquidity_gaps_Up_"+Time[i];
       color ObjColor;
       if(Open[i] > Close[i+1]) ObjColor = Gap_Up;
       else ObjColor = Gap_Down;
       if(ObjectFind(ObjName)<0)
       {  
         ObjectCreate(ObjName,OBJ_RECTANGLE,0,Time[i+1],Close[i+1],Time[i],Open[i]);
         ObjectSet(ObjName,OBJPROP_BACK,0);         
         ObjectSet(ObjName,OBJPROP_COLOR,ObjColor);                 
         ObjectSet(ObjName,OBJPROP_STYLE,Rectangle_Style);
       }
     }
     
     //datetime thistime = Time[i];     
     int ib = i+ExtendBars;
     while(ib>=0)
     
     {
       ObjName = "liquidity_gaps_Up_"+Time[ib];
       if(ObjectFind(ObjName)>=0)
       {
         double pr2 = ObjectGet(ObjName,OBJPROP_PRICE2);
         double pr1 = ObjectGet(ObjName,OBJPROP_PRICE2);
         ObjectSet(ObjName,OBJPROP_TIME2,Time[i]);
         ObjectSet(ObjName,OBJPROP_PRICE2,pr2);
       }
       ib--;
     }
   }
   return(0);
  }
Thanks a lot in advance for your help

Re: MT4 Indicator requests and ideas

15130
Msquared wrote: Tue Mar 15, 2022 6:33 am Mr Tools would you be so kind as to change the way this channel indicator gives alerts. Instead of it alerting on the first candle that closes outside the channel, could you make it give an on the first candle that opens and closes completely over or under the channel. Thank You!!
Think it should do that now if alertsOnCurrent = false.
These users thanked the author mrtools for the post:
Msquared


Who is online

Users browsing this forum: Amazon [Bot], Banzai, ChatGPT [Bot], IBM oBot [Bot], TEAMTRADER, WhatsApp [Bot] and 66 guests