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
if I were as good as you, I would love to do this
So this is a big problem for me, cause I need to use the MA array in the calculation
Try calculating ma value like this :
and do not set the cciValue1 array as series
Try calculating ma value like this :
Well I did try again and again without success...I don't understand how metaeditor calculate arrays
What's wrong now?
Well I did try again and again without success...I don't understand how metaeditor calculate arrays What's wrong now?
Doc
The loop already goes from 0 to rates_total so no need for rates_total-i-1Here is the version that works (with some other changes too)
Doc The loop already goes from 0 to rates_total so no need for rates_total-i-1Here is the version that works (with some other changes too)
Thank you, I replace this with 0 and now works
if (cciValue1[rates_total-1] > ExtBLBuffer[rates_total-1]) {cci1 = " 0 "; cocci1 = Blue; ucci1 = 1; dcci1 = 0;}
else if (cciValue1[rates_total-1] < ExtBLBuffer[rates_total-1]) {cci1 = " 0 "; cocci1 = Red; ucci1 = 0; dcci1 = 1;}
else {cci1 = " 0 "; cocci1 = Yellow; ucci1 = 0; dcci1 = 0;}
Good morning!
Well I tried it a little bit more but it doesn't work. Instead of rates_total-1 I need to have 0 here
Good morning! Well I tried it a little bit more but it doesn't work. Instead of rates_total-1 I need to have 0 here
Doc
You can not chose a "mixture". If the array is set as series then you can use 0,. If it is not set as series, then you must use rates_total-1
Doc You can not chose a "mixture". If the array is set as series then you can use 0,. If it is not set as series, then you must use rates_total-1
Dear Mladen,
in the previous page of this thread I asked you how to call the SMA
Originally Posted by dr.house7
Mladen,
I have a doubt...I call the MA like this
Code:
maValue1 = SimpleMA(i,period1,cciValue1);
so it's not an handle, how could I use the "ArraySetAsSeries" function? I need to keep the price of CCI, that's my weak point
DocNow i'm in this situation, I have the CCI correct but the SMA nope...how could I make this SMA working like the CCI (handle- set as series etc.) to be able to place "0" in the calculation bars?
Dear Mladen,
in the previous page of this thread I asked you how to call the SMA
Now i'm in this situation, I have the CCI correct but the SMA nope...how could I make this SMA working like the CCI (handle- set as series etc.) to be able to place "0" in the calculation bars?Doc
You must rewrite 2 of the functions used in your code. Your StdDev_Func() and SimpleMA() functions are forcing you to work the way it is written now. You have to rewrite the StdDev_Func() and SimpleMA() to use arrays that are set as series in order to be able to work like that.
Doc You must rewrite 2 of the functions used in your code. Your StdDev_Func() and SimpleMA() functions are forcing you to work the way it is written now. You have to rewrite the StdDev_Func() and SimpleMA() to use arrays that are set as series in order to be able to work like that.
ok,
so I need to place this after rates_total
double iSma(double price, int period, int i,int bars, int instanceNo=0)
{
if (ArrayRange(workSma,0)!= bars) ArrayResize(workSma,bars); instanceNo *= 2; int k;
if (period<2) return(price);
//
//
//
//
//
workSma = price;
if (i>=period)
workSma = workSma+(workSma-workSma)/(double)period;
else { workSma = 0; for(k=0; k=0; k++) workSma += workSma;
workSma /= k; }
return(workSma);
}then I need to make something like that for std dev ?
ok,
so I need to place this after rates_total
double iSma(double price, int period, int i,int bars, int instanceNo=0)
{
if (ArrayRange(workSma,0)!= bars) ArrayResize(workSma,bars); instanceNo *= 2; int k;
if (period<2) return(price);
//
//
//
//
//
workSma = price;
if (i>=period)
workSma = workSma+(workSma-workSma)/(double)period;
else { workSma = 0; for(k=0; k=0; k++) workSma += workSma;
workSma /= k; }
return(workSma);
}no, it's not that