Hi
I wrote an EA without sending/closing orders.
for now I just want EA show me some Comments and an alert.
It's not working well and I can't find problems.
Funny part is if I put Bullish(Calculate_Bullish_Volume()) and bearish (Calculate_Bearish_Volume()) in the comment Bullish is stop working and returns 0.
But in a comment without bearish bullish is working.(however I think its not working perfectly)
its not the only problem of this EA.
please help me to find reasons and solutions.
I hope you understand my English .
I know its not very easy ;)
All the parts will be using in this EA but I made some parts comment (gray ) because I think they work well.
This doesn't provide the reason, but here are some ideas to simplify and shrink your code.
class BBvol { datetime m_last_time; double m_last_price; public: int bear,bull; BBvol():bear(0),bull(0),m_last_time(Time[0]),m_last_price(Bid){} void Refresh() { if(m_last_time != Time[0]) { m_last_time = Time[0]; bear = 0; bull = 0; } if(Bid > m_last_price) bull++; else if(Bid < m_last_price) bear++; m_last_price = Bid; } }; void OnTick() { static BBvol vol; vol.Refresh(); string res=""; for(int i=13;i>=0;i--) res+= " C"+string(i+1)+": "+string(Volume[i]); res+="\n\nBear volume = "+string(vol.bear); res+="\nBull volume = "+string(vol.bull); Comment(res); }
This doesn't provide the reason, but here are some ideas to simplify and shrink your code.
Thank you very much Nicholishen.
your codes are much more better .
can you help also for timing ?
what do you think about my TimeDifference()
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I wrote an EA without sending/closing orders.
for now I just want EA show me some Comments and an alert.
It's not working well and I can't find problems.
Funny part is if I put Bullish(Calculate_Bullish_Volume()) and bearish (Calculate_Bearish_Volume()) in the comment Bullish is stop working and returns 0.
But in a comment without bearish bullish is working.(however I think its not working perfectly)
its not the only problem of this EA.
please help me to find reasons and solutions.
I hope you understand my English .
I know its not very easy ;)
All the parts will be using in this EA but I made some parts comment (gray ) because I think they work well.