Page 7 of 45

Re: Metatrader 5 Versions of indicators.

Posted: Sat Apr 22, 2017 4:22 am
by baraozemo
Hi mladen,

I use this component in my template and in a test EA...
but while in graphic it has some glitches (the component is slow and does not update the screen correctly)
and while using the EA also gives the same problem and also leaves the backtest very very slow...
Could you help me to optimize and fix this component it's crucial to me?

Re: Metatrader 5 Versions of indicators.

Posted: Sat Apr 22, 2017 6:30 am
by mladen
baraozemo wrote: Sat Apr 22, 2017 4:22 am Hi mladen,

I use this component in my template and in a test EA...
but while in graphic it has some glitches (the component is slow and does not update the screen correctly)
and while using the EA also gives the same problem and also leaves the backtest very very slow...
Could you help me to optimize and fix this component it's crucial to me?
The BarsCalculated() returns the number of calculated bars - not the not calculated/changed
The correct math for the new calculated bars should be Bars(_Symbol,_Period)-BarsCalculated(handle);

Try that out

Dsl macd

Posted: Sat Apr 22, 2017 10:08 pm
by mladen
New metatrader 5 version of dsl macd posted here : https://www.forex-station.com/viewtopic ... 1295350565

Re: Metatrader 5 Versions of indicators.

Posted: Wed Apr 26, 2017 5:18 am
by baraozemo
Hi,
I need help with bb.

I want to detect the "bollingers bands" opening in the mt5, (see graphic)
the code samples that I have only get Touch or break in bb with the price, but it's not I need,
I need to get the "BB" opening like in this graphic.

Code: Select all

   int               m_BBHand;         
   double            m_BBup[];
   double            m_BBlow[];
   double            m_BBmidle[];    
   MqlRates          m_BBrate[];          // To be used to store the prices, volumes and spread of each bar   

int OnInit()
{
      m_BBHand=iBands(_Symbol,BB_TimeFrame,BB_Period,BB_Shift,BB_deviation,PRICE_CLOSE);
      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),m_BBHand);

}

void OnTick()
{
         ArraySetAsSeries(m_BBrate,true);
        
         ZeroMemory(m_BBup);
         ZeroMemory(m_BBlow);
         ZeroMemory(m_BBmidle);         
         ArraySetAsSeries(m_BBup,true);
         ArraySetAsSeries(m_BBlow,true);
         ArraySetAsSeries(m_BBmidle,true);
         if(CopyRates(_Symbol,BB_TimeFrame,0,3,m_BBrate)<0)
           {
            return(false);
           }
         if(CopyBuffer(m_BBHand,0,1,3,m_BBmidle)<0 || 
            CopyBuffer(m_BBHand,1,1,3,m_BBup)<0 || 
            CopyBuffer(m_BBHand,2,1,3,m_BBlow)<0)
            {
            return(false);
            }           
         }       

      bool  buyreg,sellreg=false;

         //but  this code get candle crossing the bands (and it's not that I need)
         ///I need is only to get the "bands opening" (see the attached graphic) 
            buyreg=m_BBrate[1].close>m_BBlow[1] && m_BBrate[1].open<m_BBlow[1];// White (bull) candle crossed the Lower Band from below to above
           sellreg=m_BBrate[1].close<m_BBup[1]&& m_BBrate[1].open>m_BBup[1];// Black (bear) candle crossed the Upper Band from above to below
}

Re: Metatrader 5 Versions of indicators.

Posted: Wed Apr 26, 2017 5:43 am
by mladen
baraozemo wrote: Wed Apr 26, 2017 5:18 am Hi,
I need help with bb.

I want to detect the "bollingers bands" opening in the mt5, (see graphic)
the code samples that I have only get Touch or break in bb with the price, but it's not I need,
I need to get the "BB" opening like in this graphic.

Code: Select all

   int               m_BBHand;         
   double            m_BBup[];
   double            m_BBlow[];
   double            m_BBmidle[];    
   MqlRates          m_BBrate[];          // To be used to store the prices, volumes and spread of each bar   

int OnInit()
{
      m_BBHand=iBands(_Symbol,BB_TimeFrame,BB_Period,BB_Shift,BB_deviation,PRICE_CLOSE);
      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),m_BBHand);

}

void OnTick()
{
         ArraySetAsSeries(m_BBrate,true);
        
         ZeroMemory(m_BBup);
         ZeroMemory(m_BBlow);
         ZeroMemory(m_BBmidle);         
         ArraySetAsSeries(m_BBup,true);
         ArraySetAsSeries(m_BBlow,true);
         ArraySetAsSeries(m_BBmidle,true);
         if(CopyRates(_Symbol,BB_TimeFrame,0,3,m_BBrate)<0)
           {
            return(false);
           }
         if(CopyBuffer(m_BBHand,0,1,3,m_BBmidle)<0 || 
            CopyBuffer(m_BBHand,1,1,3,m_BBup)<0 || 
            CopyBuffer(m_BBHand,2,1,3,m_BBlow)<0)
            {
            return(false);
            }           
         }       

      bool  buyreg,sellreg=false;

         //but  this code get candle crossing the bands (and it's not that I need)
         ///I need is only to get the "bands opening" (see the attached graphic) 
            buyreg=m_BBrate[1].close>m_BBlow[1] && m_BBrate[1].open<m_BBlow[1];// White (bull) candle crossed the Lower Band from below to above
           sellreg=m_BBrate[1].close<m_BBup[1]&& m_BBrate[1].open>m_BBup[1];// Black (bear) candle crossed the Upper Band from above to below
}
Snap1.png
baraozemo

What would be the exact criteria for "opening"?

Re: Metatrader 5 Versions of indicators.

Posted: Wed Apr 26, 2017 6:24 am
by baraozemo
hi,
I think that we can mesure the angle of the bb_bands_High and bb_bands_Low.

I will have two signals:
1) BB is opening the mouth (The price is walking, non-lateral market)
if the angle of bb_bands_high is > 45º
and the angle of bb_bands_low > 45º
the bb is opening the mouth...
(see graph)

2) Check is the price is falling or growing up (buy and sell signal)

Re: Metatrader 5 Versions of indicators.

Posted: Wed Apr 26, 2017 4:12 pm
by mladen
baraozemo wrote: Wed Apr 26, 2017 6:24 am hi,
I think that we can mesure the angle of the bb_bands_High and bb_bands_Low.

I will have two signals:
1) BB is opening the mouth (The price is walking, non-lateral market)
if the angle of bb_bands_high is > 45º
and the angle of bb_bands_low > 45º
the bb is opening the mouth...
(see graph)

2) Check is the price is falling or growing up (buy and sell signal)

Snap1.png
baraozemo

You can not calculate the angle on a price time series
Some other criteria should be used

Re: Metatrader 5 Versions of indicators.

Posted: Wed Apr 26, 2017 10:46 pm
by baraozemo
(bb is opening)
bb_band_up is growing
bb_band_down is falling

bb is opening for buy
(price touch the bb_band_up)
and (volume is growing)

bb is opening for sell
(price touch the bb_band_down)
and (volume is falling)

the idea is get the breakout for some points

Normalized macd

Posted: Fri Apr 28, 2017 6:52 pm
by mladen
Found one issue in the multi time frame mode of normalized macd
It is fixed now


Re: Metatrader 5 Versions of indicators.

Posted: Fri Apr 28, 2017 10:06 pm
by baraozemo
mladen, i found this person that is selling a indicator,
I suspect that this one of the indicators created here...lol