[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 738

 

I got it. Thanks for your help.

 
spidey:

Good evening, could you please advise me how to put an alert in the indicator, I've tried everything, it beeps at every tick, or doesn't beep at all...


Get it and sign it :)

Files:
 
Please advise how to compare the closing price of the i-th bar (for example М15) with the opening price of the day in the indicator
 

Hello.

Can you tell me or advise me where to get the .hst or what to generate Eliot waves for the visual tester, (can be in csv file) as in the picture below:

 
RomanS:
Please, tell me how to compare the close price of i-bar in indicator (for example М15) with the open price of the day


I must not have explained it correctly... for example

#property indicator_separate_window
#property  indicator_buffers 4
#property  indicator_color1  Red
#property  indicator_color2  Green
#property  indicator_color3  Blue
#property  indicator_color4  Black

extern int DAY       = 0;
extern int History   = 500;

double GBP[],EUR[],JPY[],USD[]; 

int init()
  {
   SetIndexBuffer(0, GBP);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(1, EUR);    
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(2, JPY);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(3, USD);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,2);
   IndicatorShortName("...");
   return;
  }

int start()
  {
  int limit = 0, 
      counted_bars = IndicatorCounted();
      if(counted_bars>0) counted_bars--; 
      limit = Bars - counted_bars;
 
  for(int i=0; i<limit; i++)
    {
     USD[i] = -(iClose("EURUSD",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY))
              -(iClose("GBPUSD",NULL,i)-iOpen("GBPUSD",PERIOD_D1,DAY))
              +(iClose("USDJPY",NULL,i)-iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i);
     EUR[i] = +(iClose("EURUSD",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY))
              +(iClose("EURUSD",NULL,i)*iClose("USDJPY",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY)*iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i)
              +(iClose("EURUSD",NULL,i)/iClose("GBPUSD",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY)/iOpen("GBPUSD",PERIOD_D1,DAY))*iClose("GBPUSD",NULL,i);
     GBP[i] = +(iClose("GBPUSD",NULL,i)-iOpen("GBPUSD",PERIOD_D1,DAY))
              +(iClose("GBPUSD",NULL,i)*iClose("USDJPY",NULL,i)-iOpen("GBPUSD",PERIOD_D1,DAY)*iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i)
              -(iClose("EURUSD",NULL,i)/iClose("GBPUSD",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY)/iOpen("GBPUSD",PERIOD_D1,DAY))*iClose("GBPUSD",NULL,i);
     JPY[i] = -(iClose("USDJPY",NULL,i)-iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i)
              -(iClose("EURUSD",NULL,i)*iClose("USDJPY",NULL,i)-iOpen("EURUSD",PERIOD_D1,DAY)*iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i)
              -(iClose("GBPUSD",NULL,i)*iClose("USDJPY",NULL,i)-iOpen("GBPUSD",PERIOD_D1,DAY)*iOpen("USDJPY",PERIOD_D1,DAY))/iClose("USDJPY",NULL,i);
    }
   return(0);
  }

If I set DAY = 0, then the price of the i-th bar, let it be M5, will be compared to the open price of today, if DAY = 1, then to the open price of yesterday, etc.

how to make it dynamic... If I wanted to compare it dynamically, i.e. when I copied for example the 1278th bar, it would be compared to the open price of the day when I see this bar.

 

Assuming that this is a graph of some indicator MAKD or STOH all the same, advise how to describe the entry point in the EA Xmax*0.25 for Selling and Xmin*0.25 for Buy. If the period "n" is not constant and Xmax and Xmin change.

Files:
ypi.rar  7 kb
 

how to implement such an operator

while ( Условие если закрылся любой ордер )                  
{   то опредеяем тип закрытого ордера из списка   }  
значение передаем следущему оператору

{  по переданому значению выбераем из списка нужный ордер и открываем его  } 
после того как ордер открыт возращяемся в начало

or what other way this loop can be implemented

 
RomanS:


I must have explained it wrong... for example

If I set DAY = 0, then the price of the i-th bar, let it be M5, will be compared to the open price of today, if DAY = 1, then to yesterday, etc.

how to do it dynamically... i.e. when calculating 1278th bar for example, it was compared to the open price of the day when this bar was opened.

For that, I have a function that returns OHLC of any senior period :)

//+------------------------------------------------------------------+
//| getOHLC                                                          |
//+------------------------------------------------------------------+
double getOHLC(int OHLC, string symbol, int timeframe, int shift = 0){
   if(timeframe < Period())return(-1);
   switch(OHLC){
      case 0:  return(iOpen(symbol, timeframe, iBarShift(symbol, timeframe, Time[shift])));
      case 1:  return(iLow(symbol, timeframe, iBarShift(symbol, timeframe, Time[shift])));
      case 2:  return(iHigh(symbol, timeframe, iBarShift(symbol, timeframe, Time[shift])));
      case 3:  return(iClose(symbol, timeframe, iBarShift(symbol, timeframe, Time[shift])));
   }
}
//+------------------------------------------------------------------+

Parameters:
int OHLC - what data should be taken from the high timeframe, correspond to the standard constants.
string symbol - symbolic name of the instrument.
int timeframe - period of the upper timeframe to work, correspond to the standard constants.
int shif t - optional parameter, specifying the number of the current bar, of the current timeframe, to search for matches of older periods.

Example of function call for your case:

for(int i=0; i<limit; i++)
    {
     USD[i] = -(iClose("EURUSD",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i))
              -(iClose("GBPUSD",NULL,i)-getOHLC(0, "GBPUSD",PERIOD_D1,i))
              +(iClose("USDJPY",NULL,i)-getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i);
     EUR[i] = +(iClose("EURUSD",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i))
              +(iClose("EURUSD",NULL,i)*iClose("USDJPY",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i)*getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i)
              +(iClose("EURUSD",NULL,i)/iClose("GBPUSD",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i)/getOHLC(0, "GBPUSD",PERIOD_D1,i))*iClose("GBPUSD",NULL,i);
     GBP[i] = +(iClose("GBPUSD",NULL,i)-getOHLC(0, "GBPUSD",PERIOD_D1,i))
              +(iClose("GBPUSD",NULL,i)*iClose("USDJPY",NULL,i)-getOHLC(0, "GBPUSD",PERIOD_D1,i)*getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i)
              -(iClose("EURUSD",NULL,i)/iClose("GBPUSD",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i)/getOHLC(0, "GBPUSD",PERIOD_D1,i))*iClose("GBPUSD",NULL,i);
     JPY[i] = -(iClose("USDJPY",NULL,i)-getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i)
              -(iClose("EURUSD",NULL,i)*iClose("USDJPY",NULL,i)-getOHLC(0, "EURUSD",PERIOD_D1,i)*getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i)
              -(iClose("GBPUSD",NULL,i)*iClose("USDJPY",NULL,i)-getOHLC(0, "GBPUSD",PERIOD_D1,i)*getOHLC(0, "USDJPY",PERIOD_D1,i))/iClose("USDJPY",NULL,i);
    }

Accordingly iClose("EURUSD",NULL,i) will find the closing price of bar number i of the current chart, and getOHLC(0, "EURUSD",PERIOD_D1,i) the opening price of the day in which bar i of the current chart is.

 
RomanS:


I must have explained it wrong... for example

If I set DAY = 0, then the price of the i-th bar, let it be M5, will be compared to the open price of today, if DAY = 1, then to the open price of yesterday, etc.

how to do it dynamically... i.e. when calculating 1278th bar for example, it was compared to the open price of the day when this bar was opened.

You first need to calculate which day this bar corresponds to. I'm not at home right now, so I'll give you the function later when I get home in the evening. In the meantime, search for it yourself or figure out how to implement it.

Oops... Already offered a variant....

 
akuma_san1:

Assuming that this is a chart of some indicator MAKD or STOH all the same, advise how to describe the entry point in the EA Xmax*0.25 for Selling and Xmin*0.25 for Buy. If the period "n" is not constant and Xmax and Xmin change.

Your entry criteria are very vaguely defined. It's not clear to me personally. If you need to control the crossing of any level, then changing all the parameters you provided have no interfering factors. Just look at the value of the required parameter on the first bar and the value of the same parameter on the second bar. If the value of the parameter on the first bar is higher than a threshold value that you have specified and the value on the second bar is lower, we have a crossing from bottom to top. If the value on the first bar is lower and the value on the second bar is higher - we have a crossing from up to down. Here we have two signals for Buy and Sell. You can check just the value above or below - so we will have the same signal, but throughout the time the parameter is either above or below the monitored value.
SZY. If the parameters didn't change, we would never have a signal... :)