
1. Re: Function and Calculations
Manas Ranjan Kar Jan 14, 2014 1:17 AM (in response to Aakash Dhondiyal)It would be easier if I can look at your data structure. Can you post a sample packaged workbook?
You need to create some additional calculated fields and a parameter (for the constant value, adds flexibility) for the above algorithm. Like a calculated field for New Variable with formula as
IF [Current Value] > [Previous Value] THEN [Previous Value] +[Constant Parameter]
ELSE [Previous Value]
END
You may create a parameter with some allowable values that suits you.

2. Re: Re: Function and Calculations
Aakash Dhondiyal Jan 14, 2014 2:01 AM (in response to Manas Ranjan Kar)Thanks @ manas
Yes i did though of same but problem still persist. I have posted the sample data sheet.
Also, I have tried to do same using R script function.Code is provided below.
SCRIPT_REAL(
' Temp < function(x){n < length(sum(x))
AP < rep(0.02, n)
for(i in 1:n) {if( x[i+1] > x[i] ) { AP[i+1] < 0.02 + AP[i]
if( is.na( AP[i+1]) == "TRUE" ) AP[i+1] < AP[i]
}
else AP[i+1] < AP[i]
}return(AP)
};Temp(sum(.arg1));'
,[EP])But it is giving Error.

Sample sheet.csv.zip 386 bytes


3. Re: Function and Calculations
Manas Ranjan Kar Jan 14, 2014 2:13 AM (in response to Aakash Dhondiyal)Can you point out what you want with respect to the sample data? All I see is the close/open prices, what might be your intended output?

4. Re: Re: Function and Calculations
Aakash Dhondiyal Jan 15, 2014 1:29 AM (in response to Manas Ranjan Kar)I want to create chart using this data.
Chart Name : Parabolic SAR
Link : Parabolic SAR  ChartSchool  StockCharts.com
I am stuck in the recursive process required to work out in this.