MQL4 - automated forex trading   /  

Forum

Candle Counter

Back to topics list To post a new topic, please log in or register

avatar
8
1007 2011.04.15 15:56 

I would like to know whether there is a mt4 indicator to count the number of bull and bear candles seperately in a chart for a given time intervel.

Eg: I want to know how many candles were bulls or bears in the last 2 hour period in a 5 minutes chart.

Regards

Noufel

Testing of Expert Advisors in the MetaTrader 4 Client Terminal: An Outward Glance

Testing of Expert Advisors in the MetaTrader 4 Client Terminal: An Outward Glance

What happens after you have clicked on the "Start" button? The article answers this and many other questions.


avatar
571
brewmanz 2011.04.16 05:58 

I'm not aware of one (but google search is a wonderful thing ...)

If I were to write this (and I'm not offering, BTW), I would ...

a) keep track of bull candles in one buffer (value 0 or 1) & bear candles in another (value 0 or -1)

b) sum candle count via iMAOnArray() * 24 using SMA with 24 periods


avatar
4328
WHRoeder 2011.04.16 16:32 
1007:
I would like to know whether there is a mt4 indicator to count the number of bull and bear candles seperately in a chart for a given time intervel.

Modify the RSI from
            rel=Close[k]-Close[k+1];
            if(rel>0) sump+=rel;
            else      sumn-=rel;
            k--;
           }
         positive=sump/RSIPeriod;
         negative=sumn/RSIPeriod;
to
            rel=Close[k]-Close[k+1];
            if(rel>0) sump+=1;
            else      sumn+=1;
...
         positive=sump;// /RSIPeriod;
         negative=sumn;// /RSIPeriod;


avatar
4328
WHRoeder 2012.03.26 15:02 
WHRoeder:
Modify the RSI from
            rel=Close[k]-Close[k+1];
            if(rel>0) sump+=rel;
            else      sumn-=rel;
            k--;
           }
         positive=sump/RSIPeriod;
         negative=sumn/RSIPeriod;
to
            rel=Close[k]-Close[k+1];
            if(rel>0) sump+=1;//rel;
            else      sumn-=1;//rel;
            k--;
           }
         positive=sump;// /RSIPeriod;
         negative=sumn;// /RSIPeriod;
Back to topics list  

To add comments, please log in or register