stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

CSS - how is it calculated?
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3279
Page 1 of 1
Author:  ManDrone [ Thu Nov 21, 2013 8:12 pm ]
Post subject:  CSS - how is it calculated?

Hello-
I have been poking around the forums for a while and see lots of discussion on the Currency Slope Strength indicator that Baluda created (I personally have played with v1.0.8). I understand how to read the values. I understand that it is comparing the currencies to each other in an "indexing" manner such that the sum of all "strengths" = 0. My question is simply - what is the formula used to derive these values? I'm curious to see how the scores are created. I tried looking on this website and elsewhere, but have not yet found a post discussing the technicalities.

Thanks for the help.
Author:  phil_trade [ Sun Nov 24, 2013 8:27 am ]
Post subject:  Re: CSS - how is it calculated?

ManDrone wrote:Hello-
I have been poking around the forums for a while and see lots of discussion on the Currency Slope Strength indicator that Baluda created (I personally have played with v1.0.8). I understand how to read the values. I understand that it is comparing the currencies to each other in an "indexing" manner such that the sum of all "strengths" = 0. My question is simply - what is the formula used to derive these values? I'm curious to see how the scores are created. I tried looking on this website and elsewhere, but have not yet found a post discussing the technicalities.

Thanks for the help.
Hi Mandrone

CSS is derived from Slope calculation. Example below in Delphi :

Code: Select all

function calcTmaTrue(symbol : string ; tf : integer; shift : integer):double;
var
res, weight, Mysum:double;
i,knx :integer;
begin
Mysum := 0;
weight := 0;
knx := 20;
for i:=0 to knx do
  begin
   Mysum := Mysum + iClose(symbol, tf, shift  + i)*(knx+1 - i);
   weight := weight + (knx+1 - i);
  end;
res := Mysum/weight;

result:=res;
end;  //function calcTmaTrue(symbol : string ; tf : integer; shift : integer):double;

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

function calcPrevTrue(symbol : string ; tf : integer; shift : integer):double;
var
 dblSum, dblSumw:double;
 jnx, knx:integer;
  begin
   dblSum  := iClose( symbol, tf ,shift + 1) * 21;
   dblSumw := 21;

   dblSum  := dblSum  +iClose( symbol, tf, shift) * 20;
   dblSumw := dblSumw +20;

   knx := 20;
   for jnx := 1 to 20 do
   begin
      dblSum  := dblSum  +iClose( symbol, tf, shift + 1 + jnx) * knx;
      dblSumw := dblSumw +knx;
      dec(knx);
   end;

   result:=dblSum / dblSumw;
end;  //function calcPrevTrue(symbol : string ; tf : integer; shift : integer):double;

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

Function GetSlope(symbol : string ; tf : integer ; shift : integer ; i : integer ) :double ;
var
   atr , gadblSlope, dblTma, dblPrev : double;

begin
    atr :=0;
   //atr := iATR(symbol, tf, 100, shift + 10) / 10;
   if (tf = 10080) then atr := GetIndicatorValue(ATR_W1[i], shift + 10 , 0) / 10;
   if (tf = 1440) then atr := GetIndicatorValue(ATR_D1[i], shift + 10 , 0) / 10;
   if (tf = 240) then atr := GetIndicatorValue(ATR_H4[i], shift + 10 , 0) / 10;
   if (tf = 60) then atr := GetIndicatorValue(ATR_H1[i], shift + 10 , 0) / 10;

   gadblSlope := 0.0;

   if not( atr = 0 ) then
   begin

    if CalculSlopeTrueTMA=1 then
    begin
      dblTma := calcTma(symbol, tf, shift );
      dblPrev := calcTma(symbol, tf, shift + 1 );
    end
    else
    begin
    dblTma := calcTmaTrue(symbol, tf, shift);
    dblPrev := calcPrevTrue(symbol, tf, shift);
    end;

    gadblSlope := ( dblTma - dblPrev ) / atr;

   end;
   // arrondi à la 3ème décimale
   result := RoundTo(gadblSlope,-3) ;

end;//Function GetSlope(symbol : string , tf : integer, shift : integer ) :double ;
Code is also embedded in most Steve EA. You should find it.

cheers

philippe
Author:  nanningbob [ Tue Feb 11, 2014 7:35 pm ]
Post subject:  Re: CSS - how is it calculated?

The CSS originally was calculated from the tma indicator. Triangular moving average, which makes a very smooth high.low.middle lines on a chart. The slope angle from each currency like aud/USD' aud/cad aud/chf etc was then averaged and made into a single line representing the entire strength or weakness of a currency. The theory behind it is you trade strength against weakness to catch the biggest moves. The numbers are changed in the different editions to maximize the movement of the currencies.
All times are UTC Page 1 of 1