Summation

Hi,

I am trying to create a summation of an indicator that is created with the values of the S&P 500 Advances - Declines Percent data.

//Get S&P 500 Advances/Declines Ratio data 
Var1 = GETDATA(CODE=ADPSPX:BM); 

//Calculate the Indicator 
Var2 = MA(Var1, BARS=28, STYLE=Modified, CALC=Close); 
Var3 = Var2 * 100; 
Var4 = ACCSINCESIGNAL(Var3, BARDATE()==STRDATE(DATE=1970-01-06)); 
Var4

Until Var4 the calculation is correct BUT Var4 does not work. I used the Accumulation Since Signal Function - ACCSINCESIGNAL() to sum up all calculations done until Var3 since 1970/01/06. I want to create a summation index of the daily values calculated from Var1 to Var3.

Any suggestions?

Thanks

Thomas

 

ADDENDUM - Code Input Suggestion

I had some difficulties inputting the code the correct format using the “<> Code” button. I always got the error message see below. I tried a lot of settings to overcome the issue. I came to the conclusion that it is best to wright FIRST the text and THEN input the code. I am not sure whether this is the cause of the issue but it had worked.

Curiously enough, writing the addendum after inserting the code did not cause any issues.

screen shot-01

Hi Thomas,

Why use ACCSINCESIGNAL()? Why not use ACC()?

Since you are using 1970 as the start, you will never get a signal to start from if your data does not go back that far. Because of that, nothing will be accumulated.

We’ll have a look at the code plugin and see what is going on.

All the best

Mathew