MetaTrader 4 Client Terminal build 610 - page 21

 
JMayer02:
...

Hello,

Welcome to mql4.com forum. If you post the code (not a screen shot) you may have a chance to get help.

 
angevoyageur:

Hello,

Welcome to mql4.com forum. If you post the code (not a screen shot) you may have a chance to get help.



#property copyright "BLUR71"
#property link      "blrobertsjr@hotmail.com"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 LimeGreen
#property indicator_width1 2
#property indicator_color2 Red
#property indicator_width2 2
#property indicator_color3 DarkSlateGray
#property indicator_width3 1
#property indicator_color4 Aqua
#property indicator_width4 0
#property indicator_style4 2
#property indicator_levelcolor DarkSlateGray
#property indicator_levelstyle 2
#define   indicator_minimum -50
#define   indicator_maximum  50
extern bool AlertOn=false, ColorDescendingBars=false,PlotMainLine=true, PlotSignalLine=false;
extern int  RSIPeriod=13,RSIPrice=0,MASignal=0,MAMode=0,BuyAlertLevel=-10,SellAlertLevel=10;
extern double RSIHistoModify=1.5;
double UpBuffer[], DownBuffer[], RSIMain[], RSISignal[];
int Positive=0, Negative=0;
//----
int init()
  {IndicatorBuffers(4);
   SetIndexStyle(0,2);
   SetIndexBuffer(0,UpBuffer);
   SetIndexEmptyValue(0,EMPTY_VALUE);
   SetIndexStyle(1,2);
   SetIndexBuffer(1,DownBuffer);
   SetIndexEmptyValue(1,EMPTY_VALUE);
   if(PlotMainLine)
   SetIndexStyle(2,0); else
   SetIndexStyle(2,12);
   SetIndexBuffer(2,RSIMain);
   if (PlotSignalLine)
   SetIndexStyle(3,0); else
   SetIndexStyle(3,12);
   SetIndexBuffer(3,RSISignal);
   SetLevelValue(0,BuyAlertLevel);
   SetLevelValue(1,SellAlertLevel);
   return(0);}
//----
int deinit() {return(0);}
//----
int start()
{int counted_bars=IndicatorCounted(),I,limit;
 IndicatorShortName("RSI HistoAlert ["+RSIPeriod+","+RSIPrice+","+MASignal+
                    ","+MAMode+","+DoubleToStr(RSIHistoModify,2)+"X]");
 if (counted_bars<0) return(-1);
 if (counted_bars>0) counted_bars--;
 limit=Bars-31;
 if(counted_bars>=31) limit=Bars-counted_bars-1;
//----
   for (I=limit;I>=0;I--)
   {RSIMain[I]=((iRSI(0,0,RSIPeriod,RSIPrice,I)-50)*RSIHistoModify);
      if(RSIMain[I]>BuyAlertLevel)
      {if (Positive==0)
       {Positive=1;Negative=0;
        if (I == 1 && AlertOn ) Alert(Symbol()," M",Period()," RSI Histo BUY @ ",Ask);}}
      else if (RSIMain[I]<SellAlertLevel)
      {if(Negative==0)
       {Negative=1;Positive=0;
        if (I == 1 && AlertOn) Alert(Symbol()," M",Period()," RSI Histo SELL @ ",Ask);}}
    if(ColorDescendingBars==true)
    {if (RSIMain[I]>RSIMain[I+1])
      {UpBuffer[I]=RSIMain[I];
       DownBuffer[I]=EMPTY_VALUE;}
     else
      {DownBuffer[I]=RSIMain[I];
       UpBuffer[I]=EMPTY_VALUE;}}
     else if(ColorDescendingBars==false && RSIMain[I]>=0.00)
      {UpBuffer[I]=RSIMain[I];}
     else 
      {DownBuffer[I]=RSIMain[I];}}
for(I=0; I<limit; I++)
    RSISignal[I]=iMAOnArray(RSIMain,Bars,MASignal,0,MAMode,I);
return(0);
}
Hey, thanks for the quick reply! Well, here it is. I hope I did this correctly. Let me know if I screwed it up.
 
  1. No need for the decrement Contradictory information on IndicatorCounted() - MQL4 forum
    // if (counted_bars>0) counted_bars--;
    // limit=Bars-31;
    // if(counted_bars>=31) limit=Bars-counted_bars-1;
       if (counted_bars < 30) counted_bars = 30;
       limit=Bars-counted_bars-1;
    //----
       for (I=limit;I>=0;I--)

  2. You are computing [limit .. 0] but not for the OnArray
    for(I=0; I<limit; I++)
        RSISignal[I]=iMAOnArray(RSIMain,Bars,MASignal,0,MAMode,I);
    
 
JMayer02:

Hey, thanks for the quick reply! Well, here it is. I hope I did this correctly. Let me know if I screwed it up.

You only have to change this line :

      RSIMain[I]=((iRSI(0,0,RSIPeriod,RSIPrice,I)-50)*RSIHistoModify);

to

      RSIMain[I]=((iRSI(NULL,0,RSIPeriod,RSIPrice,I)-50)*RSIHistoModify);
 
angevoyageur:

You only have to change this line :

to


THAT. IS. AWESOME!

IT WORKED! (I don't mean to sound surprised. Of course it worked).

Thank you so very much!!!!!!!!

 
JMayer02:


THAT. IS. AWESOME!

IT WORKED! (I don't mean to sound surprised. Of course it worked).

Thank you so very much!!!!!!!!

You are welcome
 
Are we now on 613?? If so, what's been changed?
 
Trevhib:
Are we now on 613?? If so, what's been changed?

Why 613 ? I am not aware of a new build.

EDIT: I just saw the topic talking about build 613.

 
angevoyageur:
Why 613 ? I am not aware of a new build.
It's available from the MetaQuotes test server. Main purpose appears to be including metaviewer.dll, presumably for the magazines mentioned in relation to MT5 at https://forum.mql4.com/46992/page3#916775
 
gchrmt4:
It's available from the MetaQuotes test server. Main purpose appears to be including metaviewer.dll, presumably for the magazines mentioned in relation to MT5 at https://forum.mql4.com/46992/page3#916775
Ok, thank you. This server is for beta only.
Reason: