I will write an advisor free of charge - page 146

 
Ivan:

The point is to calculate and send an alert every time what I have shown in the picture happens.

Take a close look even at your chart. There are many more places where candles near almost the same shadow price than are shown by the arrows. And these are not necessarily extremes.

 
Aleksei Stepanenko:

Look closely even at your chart. There are many more places where candles near almost the same shadow price than are shown by the arrows. And these are not necessarily extremes.

the arrows were drawn randnomno, to understand what your post is about? that's what's interesting
 
There will be many points in different places. The rule of thumb for the same shadow price of two or three candles is not enough. In my opinion.
 

Knock-knock Indicator Ver 1

The indicator finds neighbouring candlesticks with close shadow values. The candlesticks of the current timeframe are used.

 
Aleksei Stepanenko:

Knock-knock Indicator Ver 1

The indicator finds neighbouring candlesticks with close shadow values. It uses the candlesticks of the current timeframe.

It is very fast, but the essence of the indicator is to provide alerts, for example I am not able to monitor all currency pairs,

As for the alerts, it would be good to make some adjustments, let us set the deviation for different pairs and of course test.

i have thrown it on the eurik, very good, but i need a setting and alert, then it should work.

Files:
111.JPG  103 kb
 

Hello Dear programming gurus, I'm asking for your help in finishing this robot. I AM NOT A PROGRAMMER MYSELF.

I'm not a programmer myself, I wrote the first function myself, but I trawled through different parts found on the Internet, but I can't connect the other two functions I would like to see. I can't find the other two functions I would like to see, so please help me. I think that for you it will not be as difficult as for me. If you would like to help, please make a function which will closepending order after one of two pending orders has triggered. And the second function should automatically increase order's lot ("let's say" for every $50 of balance 0.01 lot, after reaching $100 the robot should automatically increase lot by 0.02). The code I put out works, that is (puts two pending orders and trawls them). But as I wrote before I cannot attach the other two functions in any way.Thanks in advance for your help.

extern int    TakeProfit     = 100.0;
extern bool   AllPositions   = True; // Управлять всеми позициями
extern bool   ProfitTrailing = True;  // Тралить только профит
extern int    TrailingStop   = 50;    // Фиксированный размер трала
extern int    TrailingStep   = 0;     // Шаг трала
extern bool   UseSound       = False;  // Использовать звуковой сигнал
extern string NameFileSound  = "expert.wav";  // Наименование звукового файла


void start() 
{
double TakeProfitLevelB;
double TakeProfitLevelS;
double BuyStart = Ask + 400*_Point;
double SellStart = Bid - 400*_Point;

TakeProfitLevelB = BuyStart + TakeProfit*Point;
TakeProfitLevelS = SellStart - TakeProfit*Point;

if (Open[1]==Close[1]&& OrdersTotal()==0)
{
int BuyTicket = OrderSend(Symbol(),OP_BUYSTOP,0.10,BuyStart,3,0,TakeProfitLevelB,NULL,0,0,Green);
int SellTicket = OrderSend(Symbol(),OP_SELLSTOP,0.10,SellStart,3,0,TakeProfitLevelS,NULL,0,0,Blue);
}
  for (int i=0; i<OrdersTotal(); i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (AllPositions || OrderSymbol()==Symbol()) {
        TrailingPositions();
      }
    }
  }
}

void TrailingPositions() 
{
  double pBid, pAsk, pp;

  pp = MarketInfo(OrderSymbol(), MODE_POINT);
  if (OrderType()==OP_BUY) {
    pBid = MarketInfo(OrderSymbol(), MODE_BID);
    if (!ProfitTrailing || (pBid-OrderOpenPrice())>TrailingStop*pp) {
      if (OrderStopLoss()<pBid-(TrailingStop+TrailingStep-1)*pp) {
        ModifyStopLoss(pBid-TrailingStop*pp);
        return;
      }
    }
  }
  if (OrderType()==OP_SELL) {
    pAsk = MarketInfo(OrderSymbol(), MODE_ASK);
    if (!ProfitTrailing || OrderOpenPrice()-pAsk>TrailingStop*pp) {
      if (OrderStopLoss()>pAsk+(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0) {
        ModifyStopLoss(pAsk+TrailingStop*pp);
        return;
      }
    }
  }
}

void ModifyStopLoss(double ldStopLoss) 
{
  bool fm;

  fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE);
  if (fm && UseSound) PlaySound(NameFileSound);
}
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Свойства ордеров - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Knock-knock Indicator Ver 2

With alerts. The Distance number can be set separately on each chart.

 
Aleksei Stepanenko:

Knock-knock Indicator Ver 2

With alerts. On each chart you can set the Distance number separately.

It's not working yet, here is the alert, 2 minutes ago

1. before i entered the pair, there was no signal

2. The alert appeared, but there is no candle.

I would also like to change the number of candlesticks for the signal, say 3 candlesticks in a row or 5

the timeframe is not accidentally selected H1) think about it later, I need to finalize the indicator and then I may test the robot

Files:
kcdg.JPG  72 kb
 
Aleksei Stepanenko:

Knock-knock Indicator Ver 2

With alerts. The Distance number can be set separately on each chart.

Here we go again, it looks like you have it watching other timeframes

If all is well done, the robot can be trusted)

first let's finish and test it

Files:
555.JPG  84 kb
 
Ivan:

Hi, who can write a simple indicator (there might already be one, but I haven't found it)

The point is to calculate and send an alert every time what I have shown in the picture happens. Namely, when several one-hour candlesticks almost hit the same point.

The way candlestick indicators are written, I think this one will be simpler.


You should look for the so-called "takeovers" in your picture, but even the last arrow on the picture will be a wrong entry - brains people easily ignore unwanted signals.

Reason: