Pollan's indicators - page 160

 
mladen:

Lines 100 and 101

cci[0]=(iCCI(Symbol(),0,vCCIPeriod,vCCIPrice,i-1)*vCCIMul)/100;

rsi[0]=(iRSI(Symbol(),0,vRSIPeriod,vRSIPrice,i+1)*vRSIMul)/100;[/CODE]

The "i-1" part

Lines 105 to 107

[CODE]for(pix = 1; pix <= nPeriod-1; pix++){

cci[pix]=(iCCI(Symbol(),0,vCCIPeriod,vCCIPrice,i-pix-1)*vCCIMul)/100;

rsi[pix]=(iRSI(Symbol(),0,vRSIPeriod,vRSIPrice,i+pix+1)*vRSIMul)/100;

the "i-pix-1" part

Those both parts are using future values (up to nPeriod future values) and are causing repainting. With code it is simple : we do not prove or disapprove anything : the code is doing what it is doing and all it takes is to see what will it do. And any testing of that indicator will show the above posted. So, it is not about what am I saying, but what that code is doing. And even a very quick back test will show after a couple of seconds that the indicator is repainting. Sorry

This is what it does (very quick back test example) :

It will do exactly the same in run-time

Do you bet? 1 case of beer

 

artist mladen :)

 
suat:
Do you bet? 1 case of beer

This is becoming ridiculous

Do your own testing. And everybody should do their own testing. As I told : it is not what you say but what that code does. If it was up to you we would have holly grails for centuries. Instead we are having "pollans indicators" that are repainting like hell.

____________________

PS: I never bet on things as serious as technical analysis and I never tell anything without testing. Bed time stories are for kids. Not for traders. I recomend that you do the same : do your own testing and believe what your ayes see not what your mind wants to believe that it is seeing

Good bye

 
suat:
for example this one is different work

You actually have no idea what are you talking about. Don't you?

 

And to avoid "misunderstandings" : this is the code for "pollans indicator" posted by "suat"

//+------------------------------------------------------------------+

//| pollan-indicator.mq4 |

//| Copyright © 2004, MetaQuotes Software Corp. |

//| http://www.metaquotes.net |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2004, MetaQuotes Software Corp."

#property link "http://www.metaquotes.net"

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 LimeGreen

#property indicator_color2 Red

//---- input parameters

extern int CountBars=1000;//70000

extern int nPeriod=15;

extern int CCI1Period=15;

extern int CCI2Period=15;

extern int RSI1Period=15;

extern int RSI2Period=15;

double CCI1Mul=1;

double CCI2Mul=1;

double RSI1Mul=1;

double RSI2Mul=1;

int CCI1PriceMax=0;

int CCI1PriceMin=0;

int CCI2PriceMax=0;

int CCI2PriceMin=0;

int RSI1PriceMax=0;

int RSI1PriceMin=0;

int RSI2PriceMax=0;

int RSI2PriceMin=0;

string ind1valtype1="max";

string ind1valopr="+";

string ind1valtype2="min";

double ind1valMul=1;

string ind2valtype1="max";

string ind2valopr="+";

string ind2valtype2="min";

double ind2valMul=-1;

double cci[];

double rsi[];

double val[];

double valMin=0;

double valMax=0;

double indval1=0;

double indval2=0;

int i=0, pix=0, StartBar=0;

//---- buffers

double value[];

double value2[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

// string short_name;

//---- indicator line

IndicatorBuffers(2);

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(0,value);

SetIndexBuffer(1,value2);

ArrayResize(cci,nPeriod);

ArrayResize(rsi,nPeriod);

ArrayResize(val,nPeriod);

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start(){

int counted_bars=IndicatorCounted();

indi();

return(0);

}

void CalcVal(int vCCIPeriod=0, int vCCIPrice=0, double vCCIMul=0, int vRSIPeriod=0, int vRSIPrice=0, double vRSIMul=0, int indNo=0){

for(pix = 0; pix <= nPeriod-1; pix++){

val[pix]=0;

}

cci[0]=(iCCI(Symbol(),0,vCCIPeriod,vCCIPrice,i-1)*vCCIMul)/100;

rsi[0]=(iRSI(Symbol(),0,vRSIPeriod,vRSIPrice,i+1)*vRSIMul)/100;

val[0]=(cci[0]-rsi[0]);

for(pix = 1; pix <= nPeriod-1; pix++){

cci[pix]=(iCCI(Symbol(),0,vCCIPeriod,vCCIPrice,i-pix-1)*vCCIMul)/100;

rsi[pix]=(iRSI(Symbol(),0,vRSIPeriod,vRSIPrice,i+pix+1)*vRSIMul)/100;

val[pix]=(cci[pix]-rsi[pix]);

val[pix]=val[pix]+val[pix-1];

}

}

double CalcValResult(string valtype1, string valopr, string valtype2, double valMul, int indNo=0){

double v=0, v1=0, v2=0;

if (valtype1 == "")return(0);

if (valtype1=="max")v1=valMax;else

if (valtype1=="min")v1=valMin;else v1=0;

if (valtype2=="max")v2=valMax;else

if (valtype2=="min")v2=valMin;else v2=0;

if (valopr != ""){

if (valopr == "+")v=v1+v2;else

if (valopr == "-")v=v1-v2;else

if (valopr == "/")v=v1/v2;else

if (valopr == "*")v=v1*v2;

} else v = v1;

v= v*valMul;

return(v);

}

void indi(){

value=0;

value2=0;

int counted_bars=IndicatorCounted();

//---- check for possible errors

if (counted_bars<0) return(-1);

if(Bars<=nPeriod) return(-1);

//---- last counted bar will be recounted

if (counted_bars>0) counted_bars--;

//---- initial zero

if(counted_bars<nPeriod){

for(i=1;i<=nPeriod;i++) value=0.0;

for(i=1;i<=nPeriod;i++) value2=0.0;

}

//----

StartBar=CountBars-nPeriod-1;

i=StartBar;

SetIndexDrawBegin(0,Bars-CountBars+nPeriod+1);

SetIndexDrawBegin(1,Bars-CountBars+nPeriod+1);

for (i=StartBar; i>=0; i--){

//IND1 VAL

valMax = 0;

valMin = 0;

CalcVal(CCI1Period, CCI1PriceMax, CCI1Mul, RSI1Period, RSI1PriceMax, RSI1Mul, 1);

valMax = val[0];

valMin = val[0];

for(pix = 1; pix valMax) valMax = val[pix];

for(pix = 1; pix <= nPeriod-1; pix++) if (val[pix] < valMin) valMin = val[pix];

indval1=CalcValResult(ind1valtype1, ind1valopr, ind1valtype2, ind1valMul, 1);

//END: IND1 VAL

//IND2 VAL

valMax = 0;

valMin = 0;

CalcVal(CCI2Period, CCI2PriceMax, CCI2Mul, RSI2Period, RSI2PriceMax, RSI2Mul, 2);

valMax = val[0];

valMin = val[0];

for(pix = 1; pix valMax) valMax = val[pix];

for(pix = 1; pix <= nPeriod-1; pix++) if (val[pix] < valMin) valMin = val[pix];

indval2=CalcValResult(ind2valtype1, ind2valopr, ind2valtype2, ind2valMul, 2);

//END: IND2 VAL

value=indval1;

value2=indval2;

}

}

//+------------------------------------------------------------------+
 
suat:
1 case beer pls

You should skip the beer : it is damaging your brain

 

suat is trolling (thus a troll) and should be ignored

 

..................

 

---------------------

 

-----------------

Reason: