Did receive another snippet of code from the original developer... the thing is, of course it should be smoothed, but somehow calculations don't fit, it should move btween 0 and 100.
i will work on it, and crack it, I now have some approaches availabel, thanks to all again (sadly I am still fighting myself into it).

Seems like having winning ideas is so easy, coding so difficult laugh

// definition
Length1.Name = "Psychological area period";
Length1.SetInt(30);
Length1.SetIntLimits(1, MAX_STUDY_LENGTH);


//body
int &perioda = sc.GetPersistentInt(1);
perioda = Length1.GetInt();






//example output
//2: ATR Simple
if (CalculationMethod.GetIndex() == 2) {
sc.ATR(sc.BaseDataIn, outputID, Lengthfirst.GetInt(), MOVAVGTYPE_SIMPLE);
}




//PSL
for (int ictr = 1; ictr <= (perioda); ictr++)
{
if (outputID[sc.Index] > outputID[sc.Index - ictr])
{
Count = Count + 1.0f;
}
}

PSL[sc.Index] = (Count / (perioda)) *100.0f;

Last edited by danatrader; 06/06/20 07:10.