You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good morning Mladen,
I did try to add a BB with CCI price, but I have problem with the standard deviation.
SimpleMAOnBuffer(rates_total, prev_calculated, period2+period3, period3, cciValue2, maValue2);
//BB
//--- variables
int pos;
//--- starting calculation
if(prev_calculated>1) pos=prev_calculated-1;
else pos=0;
//--- main cycle
for(int i=pos;i<rates_total && !IsStopped();i++)
{
//--- middle line
ExtMLBuffer=SimpleMAOnBuffer(rates_total, prev_calculated, period1+period2, period2, cciValue1, maValue1);
//--- calculate and write down StdDev
ExtStdDevBuffer=StdDev_Func(i,cciValue1,ExtMLBuffer,ExtBandsPeriod);
//--- upper line
ExtTLBuffer=ExtMLBuffer+ExtBandsDeviations*ExtStdDevBuffer;
//--- lower line
ExtBLBuffer=ExtMLBuffer-ExtBandsDeviations*ExtStdDevBuffer;
//---
}[/CODE]
what I like to have is the CCI line that cross the Bands (in this ex. the bottom line)
[CODE] if (cciValue1[0] < ExtBLBuffer[0]) {cci1 = " 0 "; cocci1 = Blue; ucci1 = 1; dcci1 = 0;}
else if (cciValue1[0] > ExtBLBuffer[0]) {cci1 = " 0 "; cocci1 = Red; ucci1 = 0; dcci1 = 1;}It doesn't work, could you please take a look?
If I want add a second period for the BB I need to re-write all the cycle? Could you please let me show how simplify this?
Thank you
doc
Good morning Mladen,
I did try to add a BB with CCI price, but I have problem with the standard deviation.
SimpleMAOnBuffer(rates_total, prev_calculated, period2+period3, period3, cciValue2, maValue2);
//BB
//--- variables
int pos;
//--- starting calculation
if(prev_calculated>1) pos=prev_calculated-1;
else pos=0;
//--- main cycle
for(int i=pos;i<rates_total && !IsStopped();i++)
{
//--- middle line
ExtMLBuffer=SimpleMAOnBuffer(rates_total, prev_calculated, period1+period2, period2, cciValue1, maValue1);
//--- calculate and write down StdDev
ExtStdDevBuffer=StdDev_Func(i,cciValue1,ExtMLBuffer,ExtBandsPeriod);
//--- upper line
ExtTLBuffer=ExtMLBuffer+ExtBandsDeviations*ExtStdDevBuffer;
//--- lower line
ExtBLBuffer=ExtMLBuffer-ExtBandsDeviations*ExtStdDevBuffer;
//---
}[/CODE]
what I like to have is the CCI line that cross the Bands (in this ex. the bottom line)
[CODE] if (cciValue1[0] < ExtBLBuffer[0]) {cci1 = " 0 "; cocci1 = Blue; ucci1 = 1; dcci1 = 0;}
else if (cciValue1[0] > ExtBLBuffer[0]) {cci1 = " 0 "; cocci1 = Red; ucci1 = 0; dcci1 = 1;}It doesn't work, could you please take a look?
If I want add a second period for the BB I need to re-write all the cycle? Could you please let me show how simplify this? Thank you
docdoc
Return from SimpleMAOnBuffer() function is not the ma value of the desired buffer, but the number of elements processed (in the case of that call, it is the rates_total). If you wish to calculate the ma value of a certain element "on-the-fly", you must do it with a function that does that differently (we already did that in a couple of occasions at this thread). That function is made to process the entire buffer at once
doc
Try out this version
you must do it with a function that does that differently (we already did that in a couple of occasions at this thread). That function is made to process the entire buffer at once
I was worried that you would tell me this There's no other way?
I need only a BB that works with CCI price
doc Try out this version
Thanks Mladen,
I tried but seems there is a problem...if you insert 900 for period the signal is wrong, cause the color is blue but the cci is above the BLbuffer
Thanks Mladen, I tried but seems there is a problem...if you insert 900 for period the signal is wrong, cause the color is blue but the cci is above the BLbuffer
doc
When in doubt always best to make all visible
Here is this version. Try it out and check the conditions
PS: you can not set those buffers as serries since the StdDev_Func does not work that way - it would work in a wrong dirrection then
doc
When in doubt always best to make all visible
Here is this version. Try it out and check the conditions
PS: you can not set those buffers as serries since the StdDev_Func does not work that way - it would work in a wrong dirrection thenThank you!
I have a very complicated relationship with arrays
Thank you! I have a very complicated relationship with arrays
That is probably the main problem of metatrader 5 : everything is much more complicated than in metatrader 4. So, instead of evolution (that the most efficient ways survive) we have some kind of inverted evolution : "the more complicated the better" logic. Probably it is why they are not able to get serious support (it is almost 5 years that metatrader 5 started and how many of us are using it in live trading?)
That is probably the main problem of metatrader 5 : everything is much more complicated than in metatrader 4. So, instead of evolution (that the most efficient ways survive) we have some kind of inverted evolution : "the more complicated the better" logic. Probably it is why they are not able to get serious support (it is almost 5 years that metatrader 5 started and how many of us are using it in live trading?)
They started "developing" it more than 6 years ago (according to metatrader). Here is a post they posted here on TSD where it is obvious when did they start the whole thing : https://www.mql5.com/en/forum/general
That is probably the main problem of metatrader 5 : everything is much more complicated than in metatrader 4. So, instead of evolution (that the most efficient ways survive) we have some kind of inverted evolution : "the more complicated the better" logic. Probably it is why they are not able to get serious support (it is almost 5 years that metatrader 5 started and how many of us are using it in live trading?)
:):)
I like to study this language because I approached a little to c++, in a way that I can understand immediately.
For me mt5 is a very nice tool to use it, I like the way I can manually trade and change everything directly on the chart...but the BIGGEST problem (the reason why mt5 is a big failure) is the no hedge possibility