Coding help - page 721

 
Tigra:

Try it out now
 
mladen:
Try it out now

thank you Bro=) Now everything is fine) Mladen, you can not help me with one indicator? Some errors corrected?
 
Tigra:

thank you Bro=) Now everything is fine) Mladen, you can not help me with one indicator? Some errors corrected?
Post it and then we can check
 
mladen:
Post it and then we can check


In this indicator, there are some problems when using the 4 digit quotes. But it is not critical, the problem is the scale at 4 digit to the level of 100, tried to show the pictures, looking at the right time is very straining your eyes (after a few days, whether as a thread to change the scale to the level of 40 - it would be better to be seen histograms and right corner of the text that would indicate the current value? 

 Оставлю оригинальный текст на русском, тк возможны искажения при переводе(

У этого индикатора есть некоторые проблемы при использовании 4 значных котировок. Но это не критично, самая проблемы это масштабирование на 4 значном до уровня 100, постарался показать на картинках, разглядывать нужный момент весьма напрягает глаза( после нескольких дней, можно ли как нить поменять масштаб до уровня 40 - что бы лучше было видно гистограммы и в правом углу текстом что бы обозначалось текущее значение? Еще не могу понять почему появляються черные гистограммы поверх при увеличении (

 

 

 

 

Files:
GhosTrend.ex4  38 kb
 
Tigra:


In this indicator, there are some problems when using the 4 digit quotes. But it is not critical, the problem is the scale at 4 digit to the level of 100, tried to show the pictures, looking at the right time is very straining your eyes (after a few days, whether as a thread to change the scale to the level of 40 - it would be better to be seen histograms and right corner of the text that would indicate the current value? 

 Оставлю оригинальный текст на русском, тк возможны искажения при переводе(

У этого индикатора есть некоторые проблемы при использовании 4 значных котировок. Но это не критично, самая проблемы это масштабирование на 4 значном до уровня 100, постарался показать на картинках, разглядывать нужный момент весьма напрягает глаза( после нескольких дней, можно ли как нить поменять масштаб до уровня 40 - что бы лучше было видно гистограммы и в правом углу текстом что бы обозначалось текущее значение? Еще не могу понять почему появляються черные гистограммы поверх при увеличении (

 

 

 

 

Sorry, I can not change ex4 files
 
mladen:
Sorry, I can not change ex4 files
Can you throw more thought as to decompile mq4?

Можешь подкинуть мысль как еще декомпилировать в mq4?
 
Tigra:

Sorry, decompiling is not something I am a fan of (and I don't see any reason in the world why should anybody decompile anything)

And I am happy to say that anybody telling since the new metatrader 4 builds appeared that something can be decompiled is simply lying (I have seen pictures "proving" that something can be decompiled and the moron even showed original source comments at the picture not knowing that the comments are completely removed by any compiler at the world - so, how much did he learn about coding when he was using decompiler on older builds when he does not know the basic things about producing an executable code of any sort?).

If you can use it use it. If you can not you can not. You got it for free. So, what is the problem? Changing it? There is always the author of something that can be asked to change something. But if the author sees that someone wants to plainly butcher what he/she made and made available to all, then why the hell would he post anything again? Pretending that there is no original author and playing the role of it? For a thing that is given to all for free? It is like spitting somebody in a face just because he wished you a good day

 
mladen:

Sorry, decompiling is not something I am a fan of (and I don't see any reason in the world why should anybody decompile anything)

And I am happy to say that anybody telling since the new metatrader 4 builds appeared that something can be decompiled is simply lying (I have seen pictures "proving" that something can be decompiled and the moron even showed original source comments at the picture not knowing that the comments are completely removed by any compiler at the world - so, how much did he learn about coding when he was using decompiler on older builds when he does not know the basic things about producing an executable code of any sort?).

If you can use it use it. If you can not you can not. You got it for free. So, what is the problem? Changing it? There is always the author of something that can be asked to change something. But if the author sees that someone wants to plainly butcher what he/she made and made available to all, then why the hell would he post anything again? Pretending that there is no original author and playing the role of it? For a thing that is given to all for free? It is like spitting somebody in a face just because he wished you a good day

 

Unfortunately I do not know who the author is, in this applied here, 
the indicator is also found here in a branch of TMA. from your post 
I realized that he could no longer work correctly when decompilation ( 
Well, in general, I understand if suddenly I will mq4 of this indicator, you can help me? 
Perhaps when you distort the translation I noticed a certain aggression in the latter comments, or just thought =) 
If all of a sudden it was, in my request nebylo nor any bad intention, just by reading the forum pointed out that 
you mladen and mrtools -professionaly in their field, this and decided to contact you. 

I leave the original in Russian - to transfer the case of distortion :

К сожалению я не знаю кто автор, по этому обратился сюда, индикатор тоже нашел здесь в ветке о тма. 
из вашего поста я понял что при декомлиляции он может уже не правильно работать(
Ладно, в общем понимаю, если вдруг у меня будет mq4 этого индикатора, вы мне сможете помочь?

Возможно при искажении перевода я заметил некую агрессию в последнем коментарии, или просто показалось =)
Если вдруг она была, то в моей просьбе небыло ни какого умысла плохого, просто читая форум 
обратил внимание что Вы и mrtools -профессионалы в своей области, по этому и решил обратиться к Вам
 

Hi guys I'm trying to edit an ema-rsi indicator that can show an up or down arrow when 4 ema cross happens and rsi is > or < 50.

My problem is that theese arrows don't refresh for every tick once they appeared, I need to change timeframe if I want to check if conditions are still good to show arrow. Can you tell me where is the problem ? I post the code.

Thank you 

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red

#property indicator_width1 4
#property indicator_width2 4

double CrossUp[];
double CrossDown[];
extern int FasterEMA1     = 6;
extern int SlowerEMA1     = 12;
extern int FasterEMA2     = 7;
extern int SlowerEMA2     = 14;
extern int RSInowPeriod   = 6;
extern int barsBack       = 2000;
extern bool AlertsMessage = true;
extern bool AlertsSound   = true;
extern bool debug         = false;
extern double K           = 1.0 ;

bool EMACrossedUp = false;
bool RSICrossedUp = false;
bool EMACrossedDown = false;
bool RSICrossedDown = false;
int SignalLabeled = 0; // 0: initial state; 1: up; 2: down.
int upalert=false,downalert=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 241);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 242);
   SetIndexBuffer(1, CrossDown);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start() {
   int limit, i, counter;
   double fasterEMA1now, slowerEMA1now, fasterEMA1previous, slowerEMA1previous, fasterEMA2now, slowerEMA2now, fasterEMA2previous, slowerEMA2previous;
   double RSInow;
   double Range, AvgRange;

   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=MathMin(Bars-counted_bars,barsBack);
  
   for(i = limit; i>=0; i--) {
      
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
        AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      }
      Range=AvgRange/10;

      fasterEMA1now = iMA(NULL, 0, FasterEMA1, 0, MODE_EMA, PRICE_CLOSE, i);
      fasterEMA1previous = iMA(NULL, 0, FasterEMA1, 0, MODE_EMA, PRICE_CLOSE, i+1);
      
      fasterEMA2now = iMA(NULL, 0, FasterEMA2, 0, MODE_EMA, PRICE_CLOSE, i);
      fasterEMA2previous = iMA(NULL, 0, FasterEMA2, 0, MODE_EMA, PRICE_CLOSE, i+1);
      
      slowerEMA1now = iMA(NULL, 0, SlowerEMA1, 0, MODE_EMA, PRICE_CLOSE, i);
      slowerEMA1previous = iMA(NULL, 0, SlowerEMA1, 0, MODE_EMA, PRICE_CLOSE, i+1);
      
      slowerEMA2now = iMA(NULL, 0, SlowerEMA2, 0, MODE_EMA, PRICE_CLOSE, i);
      slowerEMA2previous = iMA(NULL, 0, SlowerEMA2, 0, MODE_EMA, PRICE_CLOSE, i+1);
      
      RSInow=iRSI(NULL,0,RSInowPeriod,PRICE_CLOSE,i);
      
      if (RSInow > 50) {
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" RSI UP ");
         RSICrossedUp = true;
         RSICrossedDown = false;
      }
      
      if (RSInow < 50) {
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" RSI DOWN ");
         RSICrossedUp = false;
         RSICrossedDown = true;
      }
      
      if ((fasterEMA1now >= slowerEMA1now) && (fasterEMA1previous < slowerEMA1previous) && (fasterEMA2now >= slowerEMA2now) && (fasterEMA2previous < slowerEMA2previous) ) {
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" EMA UP ");
         EMACrossedUp = true;
         EMACrossedDown = false;
      }

      if ((fasterEMA1now <= slowerEMA1now) && (fasterEMA1previous > slowerEMA1previous) && (fasterEMA2now <= slowerEMA2now) && (fasterEMA2previous > slowerEMA2previous)) {
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" EMA DOWN ");
         EMACrossedUp = false;
         EMACrossedDown = true;
      }

      if ((EMACrossedUp == true) && (RSICrossedUp == true) && (SignalLabeled != 1)) {
         CrossUp[i] = Low[i] - K*Range;
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" SIGNAL UP ");
         if(i<=2 && AlertsMessage && !upalert)
           {
            Alert (Symbol()," ",Period(),"M  BUY SIGNAL ");
            //SendMail("EMA Cross Up on "+Symbol(),"");
            upalert=true;
            downalert=false;
           }          
         if(i<=2 && AlertsSound && !upalert)
           {
            PlaySound("alert.wav");
            upalert=true;
            downalert=false;
           }
         SignalLabeled = 1;
      }

      else if ((EMACrossedDown == true) && (RSICrossedDown == true) && (SignalLabeled != 2)) {
         CrossDown[i] = High[i] + K*Range;
         if (debug)Print(TimeToStr(Time[i],TIME_DATE)+TimeToStr(Time[i],TIME_SECONDS)+" SIGNAL DOWN ");
         if(i<=2 && AlertsMessage && !downalert)
           {
            Alert (Symbol()," ",Period(),"M  SELL SIGNAL ");
            //SendMail("EMA Cross Down on "+Symbol(),"");
            downalert=true;
            upalert=false;
           }
         if(i<=2 && AlertsSound && !downalert)
           {
            PlaySound("alert.wav");
            downalert=true;
            upalert=false;
           }
         SignalLabeled = 2;
      }
   }
   return(0);
}
//end
 

hi mr mladen:

could you add vertical line  on this indicator when trend change (zero cross)

similar this picture:

 

 

regard 

Files:
Reason: