.
DO NOT ASK FOR SOURCE CODES OR REQUEST FOR DECOMPILED INDICATORS TO BE MODIFIED. To avoid post deletion please follow the rules.

Re: MT4 Indicator requests and ideas

#7381
Cladi39 wrote:
Fri Nov 08, 2019 10:06 pm
Desatar wrote:
Fri Nov 08, 2019 7:45 pm
Hey guys,
need help finding an indicator.
I am looking for a Stochastic indi that shows divergences and hidden divergences. I looked through the stochastics formun and did not find one.
Anybody can help with that?

Thx.
D.
Maybe this.
Kinda. More like the divergence in the bottom indicator too.


Re: MT4 Indicator requests and ideas

#7382
uncle wong wrote:
Thu Oct 31, 2019 11:52 pm
Dear Mrtools and Coders ,

Is it possible create a simple indicator showing profit and loss in pips in a rolling window for closed trades and open trades(bar by bar ?) please?
There are already profit and loss indicators in mql4 but they are not like an oscillator in a seperate window.
Dear Mrtools

I-profit indicator displays profit in pips modified by Mladen.Can you modify this indicator as in a seperate window profit per bar(?)(like an oscillator) please?

Code: Select all

//+----------------------------------------------------------------------------+
//|                                                              i-Profit.mq4  |
//|                                                                            |
//|                                                    Êèì Èãîğü Â. aka KimIV  |
//|                                                       http://www.kimiv.ru  |
//|                                                                            |
//|  12.05.2008  Indicator for:                                                    |
//|              - current profit                                             |
//|              - profit for today                                          |
//|              - profit for yesterday                                            |
//|              - profit for several past days                         |
//|              - profit for current week                                   |
//|              - profit for current month                                    |
//|              - profit for current quarter                                  |
//|              - profit for current year                                      |
//+----------------------------------------------------------------------------+
#property copyright "Êèì Èãîğü Â. aka KimIV"
#property link      "http://www.kimiv.ru"
#property indicator_chart_window

//------- Âíåøíèå ïàğàìåòğû èíäèêàòîğà ----------------------------------------+
extern int   eiPercent = 5;            // Calculation of the profit procentage depends on:
                                       //  0 - current balance
                                       //  1 - balance on the beginning of the day
                                       //  2 - balance on the beginning of the week
                                       //  3 - balance on the beginning of the month
                                       //  4 - balance on the beginning of the quarter
                                       //  5 - balance on the beginning of the year
extern int   eiOffsetY = 30;           // Versital shifting the text
extern int   eiStepY   = 12;           // Versital shifting step
extern int   eiX1Row   = 3;            // X coordinate first column
extern int   eiX2Row   = 165;          // X coordinate second column
extern int   eiX3Row   = 240;          // X coordinate 3rd column
extern color ecText    = Gray;         // Color of the text
extern color ecProfit  = Green;        // Color of the profit
extern color ecLoss    = FireBrick;    // Color of the loss

//------- Ãëîáàëüíûå ïåğåìåííûå èíäèêàòîğà ------------------------------------+

//------- Áóôåğû èíäèêàòîğà ---------------------------------------------------+

//------- Ïîêëş÷åíèå âíåøíèõ ìîäóëåé ------------------------------------------+

//+----------------------------------------------------------------------------+
//|  Custom indicator initialization function                                  |
//+----------------------------------------------------------------------------+
void init() {
  DeleteObjects();
  Comment("");
}

//+----------------------------------------------------------------------------+
//|  Custom indicator deinitialization function                                |
//+----------------------------------------------------------------------------+
void deinit() {
  DeleteObjects();
  Comment("");
}

//+----------------------------------------------------------------------------+
//|  Custom indicator iteration function                                       |
//+----------------------------------------------------------------------------+
void start() {
  datetime d0, d1, d2, d3, d4, d5, d6, d7, d8;

  d0=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));
  while (TimeDayOfWeek(d0)<1 || TimeDayOfWeek(d0)>5) d0-=24*60*60;
  d1=d0-24*60*60;
  while (TimeDayOfWeek(d1)<1 || TimeDayOfWeek(d1)>5) d1-=24*60*60;
  d2=d1-24*60*60;
  while (TimeDayOfWeek(d2)<1 || TimeDayOfWeek(d2)>5) d2-=24*60*60;
  d3=d2-24*60*60;
  while (TimeDayOfWeek(d3)<1 || TimeDayOfWeek(d3)>5) d3-=24*60*60;
  d4=d3-24*60*60;
  while (TimeDayOfWeek(d4)<1 || TimeDayOfWeek(d4)>5) d4-=24*60*60;
  d5=DateOfMonday();
  d6=StrToTime(Year()+"."+Month()+".01");
  d7=DateBeginQuarter();
  d8=StrToTime(Year()+".01.01");

  double tb=AccountBalance(), tp=AccountProfit();
  double p0=GetProfitFromDateInCurrency("", -1, -1, d0);
  double p1=GetProfitFromDateInCurrency("", -1, -1, d1)-p0;
  double p2=GetProfitFromDateInCurrency("", -1, -1, d2)-p1-p0;
  double p3=GetProfitFromDateInCurrency("", -1, -1, d3)-p2-p1-p0;
  double p4=GetProfitFromDateInCurrency("", -1, -1, d4)-p3-p2-p1-p0;
  double p5=GetProfitFromDateInCurrency("", -1, -1, d5);
  double p6=GetProfitFromDateInCurrency("", -1, -1, d6);
  double p7=GetProfitFromDateInCurrency("", -1, -1, d7);
  double p8=GetProfitFromDateInCurrency("", -1, -1, d8);

  string st;
  switch (eiPercent) {
    case 0 :         st="current"          ; break;
    case 1 : tb-=p0; st="on the beginning of the day"     ; break;
    case 2 : tb-=p5; st="on the beginning of the week"  ; break;
    case 3 : tb-=p6; st="íon the beginning of month"  ; break;
    case 4 : tb-=p7; st="on the beginning of quarter"; break;
    default: tb-=p8; st="on the beginning of the year"    ; break;
  }
  
  double tr= tb==0 ? 0 : tp*100/tb;
  double r0= tb==0 ? 0 : p0*100/tb;
  double r1= tb==0 ? 0 : p1*100/tb;
  double r2= tb==0 ? 0 : p2*100/tb;
  double r3= tb==0 ? 0 : p3*100/tb;
  double r4= tb==0 ? 0 : p4*100/tb;
  double r5= tb==0 ? 0 : p5*100/tb;
  double r6= tb==0 ? 0 : p6*100/tb;
  double r7= tb==0 ? 0 : p7*100/tb;
  double r8= tb==0 ? 0 : p8*100/tb;

  SetLabel("iProfit11", "Current Profit", ecText, eiX1Row, eiOffsetY);
  SetLabel("iProfit21", "Profit for today", ecText, eiX1Row, eiOffsetY+eiStepY);
  SetLabel("iProfit31", "Profit for "+TimeToStr(d1, TIME_DATE), ecText, eiX1Row, eiOffsetY+2*eiStepY);
  SetLabel("iProfit41", "Profit for "+TimeToStr(d2, TIME_DATE), ecText, eiX1Row, eiOffsetY+3*eiStepY);
  SetLabel("iProfit51", "Profit for "+TimeToStr(d3, TIME_DATE), ecText, eiX1Row, eiOffsetY+4*eiStepY);
  SetLabel("iProfit61", "Profit for "+TimeToStr(d4, TIME_DATE), ecText, eiX1Row, eiOffsetY+5*eiStepY);
  SetLabel("iProfit71", "Profit for a week", ecText, eiX1Row, eiOffsetY+6*eiStepY);
  SetLabel("iProfit81", "Profit for month", ecText, eiX1Row, eiOffsetY+7*eiStepY);
  SetLabel("iProfit91", "Profit for quarter", ecText, eiX1Row, eiOffsetY+8*eiStepY);
  SetLabel("iProfit01", "Profit for the year", ecText, eiX1Row, eiOffsetY+9*eiStepY);

  SetLabel("iProfit12", DoubleToStr(tp, 2), ColorOnSign(tp), eiX2Row, eiOffsetY);
  SetLabel("iProfit22", DoubleToStr(p0, 2), ColorOnSign(p0), eiX2Row, eiOffsetY+eiStepY);
  SetLabel("iProfit32", DoubleToStr(p1, 2), ColorOnSign(p1), eiX2Row, eiOffsetY+2*eiStepY);
  SetLabel("iProfit42", DoubleToStr(p2, 2), ColorOnSign(p2), eiX2Row, eiOffsetY+3*eiStepY);
  SetLabel("iProfit52", DoubleToStr(p3, 2), ColorOnSign(p3), eiX2Row, eiOffsetY+4*eiStepY);
  SetLabel("iProfit62", DoubleToStr(p4, 2), ColorOnSign(p4), eiX2Row, eiOffsetY+5*eiStepY);
  SetLabel("iProfit72", DoubleToStr(p5, 2), ColorOnSign(p5), eiX2Row, eiOffsetY+6*eiStepY);
  SetLabel("iProfit82", DoubleToStr(p6, 2), ColorOnSign(p6), eiX2Row, eiOffsetY+7*eiStepY);
  SetLabel("iProfit92", DoubleToStr(p7, 2), ColorOnSign(p7), eiX2Row, eiOffsetY+8*eiStepY);
  SetLabel("iProfit02", DoubleToStr(p8, 2), ColorOnSign(p8), eiX2Row, eiOffsetY+9*eiStepY);

  SetLabel("iProfit13", DoubleToStr(tr, 2)+" %", ColorOnSign(tr), eiX3Row, eiOffsetY);
  SetLabel("iProfit23", DoubleToStr(r0, 2)+" %", ColorOnSign(r0), eiX3Row, eiOffsetY+eiStepY);
  SetLabel("iProfit33", DoubleToStr(r1, 2)+" %", ColorOnSign(r1), eiX3Row, eiOffsetY+2*eiStepY);
  SetLabel("iProfit43", DoubleToStr(r2, 2)+" %", ColorOnSign(r2), eiX3Row, eiOffsetY+3*eiStepY);
  SetLabel("iProfit53", DoubleToStr(r3, 2)+" %", ColorOnSign(r3), eiX3Row, eiOffsetY+4*eiStepY);
  SetLabel("iProfit63", DoubleToStr(r4, 2)+" %", ColorOnSign(r4), eiX3Row, eiOffsetY+5*eiStepY);
  SetLabel("iProfit73", DoubleToStr(r5, 2)+" %", ColorOnSign(r5), eiX3Row, eiOffsetY+6*eiStepY);
  SetLabel("iProfit83", DoubleToStr(r6, 2)+" %", ColorOnSign(r6), eiX3Row, eiOffsetY+7*eiStepY);
  SetLabel("iProfit93", DoubleToStr(r7, 2)+" %", ColorOnSign(r7), eiX3Row, eiOffsetY+8*eiStepY);
  SetLabel("iProfit03", DoubleToStr(r8, 2)+" %", ColorOnSign(r8), eiX3Row, eiOffsetY+9*eiStepY);

  Comment("Profit procentage depends on balance " +st);
}

//+----------------------------------------------------------------------------+
//|  Âîçâğàùàåò öâåò ïî çíàêó ÷èñëà                                            |
//+----------------------------------------------------------------------------+
color ColorOnSign(double nu) {
  color lcColor=ecText;

  if (nu>0) lcColor=ecProfit;
  if (nu<0) lcColor=ecLoss;

  return(lcColor);
}

//+----------------------------------------------------------------------------+
//|  Àâòîğ    : Êèì Èãîğü Â. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Âåğñèÿ   : 12.05.2008                                                     |
//|  Îïèñàíèå : Âîçâğàùàåò äàòó íà÷àëà êâàğòàëà                                |
//+----------------------------------------------------------------------------+
//|  Parameters:                                                                |
//|                                    (-2 - before last)                       |
//|                                    (-1 - previous)                          |
//|    no - number of quarter          ( 0 - current)                           |
//|                                    ( 1 - next)                              |
//|                                    ( 2 - following)                         |
//+----------------------------------------------------------------------------+
datetime DateBeginQuarter(int nk=0) {
  int ye=Year()-MathFloor(nk/4);
  nk=MathMod(nk, 4);
  int mo=Month()-MathMod(Month()+2, 3)+3*nk;
  if (mo<1) {
    mo+=12;
    ye--;
  }
  if (mo>12) {
    mo-=12;
    ye++;
  }

  return(StrToTime(ye+"."+mo+".01"));
}

//+----------------------------------------------------------------------------+
//|  Àâòîğ    : Êèì Èãîğü Â. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Âåğñèÿ   : 12.05.2008                                                     |
//|  Îïèñàíèå : Âîçâğàùàåò äàòó ïîíåäåëüíèêà                                   |
//+----------------------------------------------------------------------------+
//|  Parameters:                                                                |
//|                                    (-2 - before last week)                 |
//|                                    (-1 - past weel)                        |
//|    no - numer of Monday            ( 0 - current week)                     |
//|                                    ( 1 - next)                             |
//|                                    ( 2 - following)                        |
//+----------------------------------------------------------------------------+
datetime DateOfMonday(int no=0) {
  datetime dt=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));

  while (TimeDayOfWeek(dt)!=1) dt-=24*60*60;
  dt+=no*7*24*60*60;

  return(dt);
}

//+----------------------------------------------------------------------------+
//|  Óäàëåíèå îáúåêòîâ.                                                        |
//+----------------------------------------------------------------------------+
void DeleteObjects() {
  string st="iProfit";
  int    i, j;

  for (i=0; i<10; i++) {
    for (j=1; j<4; j++) ObjectDelete(st+i+j);
  }
}

//+----------------------------------------------------------------------------+
//|  Àâòîğ    : Êèì Èãîğü Â. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Âåğñèÿ   : 19.02.2008                                                     |
//|  Îïèñàíèå : Âîçâğàùàåò ñóììàğíûé ïğîôèò â âàëşòå äåïîçèòà                  |
//|             çàêğûòûõ ñ îïğåäåë¸ííîé äàòû ïîçèöèé                           |
//+----------------------------------------------------------------------------+
//|  Parameters:                                                               |
//|    sy - numer of instrument          (""   - any symbol,                   |
//|                                      NULL - current symbol)                |
//|    op - operation                    (-1   - any position)                 |
//|    mn - MagicNumber                  (-1   -  any magic)                   |
//|    dt - Data time in the seconds since 1970 ( 0 - beginning of history)    |
//+----------------------------------------------------------------------------+
double GetProfitFromDateInCurrency(string sy="", int op=-1, int mn=-1, datetime dt=0)
{
  double p=0;
  int    i, k=OrdersHistoryTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
      if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (mn<0 || OrderMagicNumber()==mn) {
            if (dt<OrderCloseTime()) {
              p+=OrderProfit()+OrderCommission()+OrderSwap();
            }
          }
        }
      }
    }
  }
  return(p);
}

//+----------------------------------------------------------------------------+
//|  Àâòîğ    : Êèì Èãîğü Â. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Âåğñèÿ   : 12.10.2007                                                     |
//|  Îïèñàíèå : Óñòàíîâêà òåêñòîâîé ìåòêè                                      |
//+----------------------------------------------------------------------------+
//|  Ïàğàìåòğû:                                                                |
//|    nm - íàèìåíîâàíèå îáúåêòà                                               |
//|    tx - òåêñò                                                              |
//|    cl - öâåò ìåòêè                                                         |
//|    xd - êîîğäèíàòà X â ïèêñåëàõ                                            |
//|    yd - êîîğäèíàòà Y â ïèêñåëàõ                                            |
//|    cr - íîìåğ óãëà ïğèâÿçêè        (0 - ëåâûé âåğõíèé)                     |
//|    fs - ğàçìåğ øğèôòà              (8 - ïî óìîë÷àíèş)                      |
//+----------------------------------------------------------------------------+
void SetLabel(string nm, string tx, color cl, int xd, int yd, int cr=0, int fs=9) {
  if (ObjectFind(nm)<0) ObjectCreate(nm, OBJ_LABEL, 0, 0,0);
  ObjectSetText(nm, tx, fs);
  ObjectSet(nm, OBJPROP_COLOR    , cl);
  ObjectSet(nm, OBJPROP_XDISTANCE, xd);
  ObjectSet(nm, OBJPROP_YDISTANCE, yd);
  ObjectSet(nm, OBJPROP_CORNER   , cr);
  ObjectSet(nm, OBJPROP_FONTSIZE , fs);
}
//+----------------------------------------------------------------------------+

i-profit_2 (1).mq4
(15.16 KiB) Downloaded 44 times

Re: MT4 Indicator requests and ideas

#7383
hello mrtools,

Would it be possible to modify the attached indicator?

RSI Improved is a 2 in 1 indicator having 'original' and 'rotated' elements to it.

I would like the 'original' to be removed only leaving the 'rotated' part and for it to be centered in the middle of the indicator window. Also would it be possible to add MTF and interpolation please.

Currently I can remove the 'original' part by setting the colours to NONE but that leaves the 'rotated' part stuck at the top of the indicator window with a large empty space below.

Please see the attached image.

Thank you for your time.
rsi-improved.mq4
(4.91 KiB) Downloaded 67 times
Capture.PNG

Re: MT4 Indicator requests and ideas

#7384
thomdel wrote:
Fri Nov 08, 2019 6:41 pm
mrtools wrote:
Fri Nov 08, 2019 5:26 pm


They are fine, best thing to do is test the indicator settings, especially the double smooth, if the double smooth doesn't seem to be working when testing that could be when the problem comes up.

Thanks.

Sir,
I am a Beginner with no coding background and right now in the learning phase.

Please Advise on this : Sorry for long writeup
Ninjatrader 8 has a option in Indicator Option : Calculate on Bar Close : True / False ( Tick / Untick ).
So, when the Calculate on Bar Close is selected, the result appear only after Bar Close ( as it does not calculate with incoming tick / change in price).
This is a very Neat function. Example : Arrows / Dots appear ONLY AFTER BAR CLOSE.
This avoids recalculation. This avoids appear / disappear of dots / arrows.

If possible in MT4 Indicators,
Please Code " Jurik filter (text) " Indicator as Calculate on Bar Close function so that it Calculates and shows arrows / dots only after Bar Close.
Example : When Jurik filter (text) with selected mtf 15 min is applied on lower time frame 5 min chart then the arrows / dots will appear only after calculation of 15 mins bar close. ***

Please provide your feedback.


Thanks & Regards.
For the example you can set ArrowOnFirst to false and it will work that way.


Re: MT4 Indicator requests and ideas

#7388
Help me with notification problem and show arrow.
I have an Indicator, in the attached file and the attached image. Can you help me with the indicator and arrow on the chart as described below?

1. BUY ODERR
- BUY alert when the indicator surpasses Level 5, notify Take Profit when the indicator hits or exceeds Level 95.
- Warning STOP LOSS when price reverses and touches Level 5 again before passing or touching Level 95.

2. SELL ODER
- Warning SELL when the indicator falls below Level 95, notify Take Profit when the price touches or falls below Level 5.
- Warning STOP LOSS when price reverses and touches Level 95 again before passing or touching Level 5.

3. EACH BUY / SELL NAME
- Also show BUY and SELL arrows on the chart corresponding to BUY and SELL signals.
- Full alerts AlertsPushNotif, AlertsSound, AlertsEmail, AlertsMessage ...

Sincere thanks to mrtools and colleagues.
Untitled-2.png
Scalping.mq4
(11.61 KiB) Downloaded 52 times

Re: MT4 Indicator requests and ideas

#7390
kam44 wrote:
Sat Nov 09, 2019 12:28 am
hello mrtools,

Would it be possible to modify the attached indicator?

RSI Improved is a 2 in 1 indicator having 'original' and 'rotated' elements to it.

I would like the 'original' to be removed only leaving the 'rotated' part and for it to be centered in the middle of the indicator window. Also would it be possible to add MTF and interpolation please.

Currently I can remove the 'original' part by setting the colours to NONE but that leaves the 'rotated' part stuck at the top of the indicator window with a large empty space below.

Please see the attached image.

Thank you for your time.
Try!!
rsi-improved_(Mod.).mq4
(10.36 KiB) Downloaded 54 times
Cattura.JPG
The perfect indicatoris our head ...

Too many indicators confuse the head


  1. Similar Topics

    1. Requests & Ideas (MT5)

      81 Replies 10864 Views

      by mntiwana, Fri Nov 30, 2018 4:28 am in MT5 Indicators

      81 Replies
      10864 Views
    2. 6 Replies
      9821 Views

Return to “MT4 Indicators”

Who is online

Users browsing this forum: beltranlucy, BhanuGopal, CAHDPO, CommonCrawl [Bot], diktant, gold, Google [Bot], Mail.ru [Bot], MD80, rudiarius, schemman, stanisic, tiatatta, Waal9, Yandex [Bot] and 84 guests