[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 112

 
Hi all. I don't know where to write it, so I'm writing it here. I need a simple indicator, which for local professionals would not be difficult to write. Maybe it is somewhere else, but search did not give anything (+7). I want to use histogram of crossing wipes with bars below and above zero, red and green respectively. I use 7EMA close and 7EMA open. If you can not hard to write please or poke the nose if such an indicator already exists. I will use it as an indicator and do not know how to use it.)
 
Djon777:
Hi all. I don't know where to write it, so I'm writing it here. I need a simple indicator, which for local professionals would not be difficult to write. Maybe it is somewhere else, but search did not give anything (+7). I want to use histogram of crossing wipes with bars below and above zero, red and green respectively. I use 7EMA close and 7EMA open. If you can not hard to write please or poke the nose if such an indicator already exists. I will use it as an indicator and do not know how to use it.)
MACD is in the standard set of MT4 indicators.
 
Zhunko:
MACD is included in the standard MT4 indicator set.


I know it is, but what I need is a histogram like this http://savepic.org/2586171.gif
 
artmedia70:
Discrimination alone... :(
In order to "discriminate", you must first discriminate! The only question is who? ;)
 

Good afternoon!

I want to use a custom indicator in my EA. I downloaded the indicator, took its code and pasted it in my EA. I got an error. My understanding is that theSetIndexBuffer() functioncan only be used in indicators. What should I do: change it to another function (in which function) or pull data from custom indicator and insert it into Expert Advisor's code?

I would be very thankful for the help!

 

Good afternoon.

I have SupDem, changed it a little, added a strip thickness buffer.

I am trying to find these bars by their number relative to the 0-th bar.

double GetSapDemUP(string sy="0", int tf=0,int ne=0) {
  if (sy=="" || sy=="0") sy=Symbol();
  double zz;
  int    i, k=iBars(sy, tf), ke=0;

  for (i=1; i<k; i++) {
    zz=iCustom(sy, tf, "SupDem_5z_1", 6, i+1);
    if (zz!=0) {
      ke++;
      if (ke>ne) return(zz);
    }
  }
  Print("SupDem_5z_1(): SupDem ",ne," не найден");
  return(0);
}

double GetSapDemDN(string sy="0", int tf=0,int ne=0) {
  if (sy=="" || sy=="0") sy=Symbol();
  double zz;
  int    i, k=iBars(sy, tf), ke=0;

  for (i=0; i<k; i++) {
    zz=iCustom(sy, tf, "SupDem_5z_1", 5, i);
    if (zz!=0) {
      ke++;
      if (ke>ne) return(zz);
    }
  }
  Print("SupDem_5z_1(): SupDem ",ne," не найден");
  return(0);
}
It is not working, what have I done wrong? Help me with the code
Files:
 

Good afternoon!

Dear Professionals, could you please advise me.

If the price exceeds by 50 pips the open price of this order, the order has to be modified.

OrderSelect(0, SELECT_BY_POS,MODE_TRADES);

double OPEN = OrderOpenPrice();
double maximus = OPEN + 0.00500;
Alert ("maximus = ",maximus);
double minimus = OPEN - 0.00500;
RefreshRates();//refresh data.
timecur = TimeToStr(TimeCurrent(),TIME_SECONDS); //Calculate current time in HH:MM format.
if ((timecur > "00:00:00") && (timecur < "22:58:00") && (Deal_s == 1) && (Deal_bb == 0)&& (Bid > maximus))
{
OrderSelect(0, SELECT_BY_POS,MODE_TRADES);
Lootup = OrderLots () * 0.34;
Lootdown = OrderLots () * 0.34;
OrderClose(OrderTicket(), Lootdown, Ask, 10, CLR_NONE);
Alert (GetLastError());
Deal_bb = 1;
}

If it happens during the day, I am able to do it. Please tell me, how to check if opening price + 50 P is controlled by price for each lot, until it is closed in next day?

 
berezhnuy:

Good afternoon.

I have SupDem, changed it a little, added a strip thickness buffer.

I am trying to find these bars by their number relative to the 0-th bar.

Can't find it, what did I do wrong? help code

That's how you look for the prices of extremes that are in the 0 and 1 buffer!!!

Try outputting the values via print or soment, 2 and 3, 4 and 5 buffers.

example:

Comment(iCustom(NULL,0, "SupDem_5z_1", 5, i));

Something like this...

 
Egori4:

Good afternoon!

I want to use a custom indicator in my EA. I downloaded the indicator, took its code and pasted it in my EA. I got an error. My understanding is that theSetIndexBuffer() functioncan only be used in indicators. What should I do: change it to another function (in which one) or pull data from custom indicator and insert it into Expert Advisor's code?

I would be very grateful for your help!

First in a series of articles:


https://www.mql5.com/ru/articles/1456

 
Boneshapper:

Good afternoon!

Dear Professionals, could you please advise me.

If the price exceeds by 50 pips the open price of this order, the order has to be modified.

OrderSelect(0, SELECT_BY_POS,MODE_TRADES);

double OPEN = OrderOpenPrice();
double maximus = OPEN + 0.00500;
Alert ("maximus = ",maximus);
double minimus = OPEN - 0.00500;
RefreshRates();//Refresh data.
timecur = TimeToStr(TimeCurrent(),TIME_SECONDS); //Calculate current time in HH:MM format.
if ((timecur > "00:00:00") && (timecur < "22:58:00") && (Deal_s == 1) && (Deal_bb == 0)&& (Bid > maximus))
{
OrderSelect(0, SELECT_BY_POS,MODE_TRADES);
Lootup = OrderLots () * 0.34;
Lootdown = OrderLots () * 0.34;
OrderClose(OrderTicket(), Lootdown, Ask, 10, CLR_NONE);
Alert (GetLastError());
Deal_bb = 1;
}

If it happens during the day, I am able to do it. Please advise me, how to check how to set condition that controls opening price + 50 P for each lot, until it closes in few days.

Try to loop through the positions

for(int i=OrdersTotal()-1; i>=0; i--)
   {
    if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
       {
         if(OrderType()==OP_BUY)
            {
          //ваши действия 
            }
         if(OrderType()==OP_SELL)
            {
          //ваши действия 
            }
       }
   }
 
Reason: