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

libCSS - .lmx Suffix Removal Code
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3650
Page 2 of 2
Author:  milanese [ Fri May 30, 2014 9:42 am ]
Post subject:  libCSS - .lmx Suffix Removal Code

theforexedge » Fri May 30, 2014 9:23 am wrote:Tommaso

Do you mean that there is an easier way of doing this?

I guess as my coding skills are quite limited and I used to use the CSS code from Steve's shell i've just cut and pasted the libCSS..

I was using the CSS weighing all the currency pairs, but I found that there are two conditions I wanted to make sure are happening:

1. There is s currency cross

2. Top or bottom reversal

and I found just weighing the symbols on the charts worked..

Anyway thinks for all your help.. :good:

Jason
As I told you just use TMA-slope add this to functions:

Code: Select all

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double GetSlope(string symbol,int tf,int shift)
  {
   double atr=iATR(symbol,tf,TMA_ATR_MA,shift+10)/10;
   double gadblSlope=0.0;
   if(atr!=0)
     {
      double dblTma = iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, shift);
      double dblPrev = ( iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, shift + 1 ) * 231 + iClose( symbol, tf, shift ) * 20 ) / 251;
      
      gadblSlope=(dblTma-dblPrev)/atr;
     }

   return ( gadblSlope );

  }
//+------------------------------------------------------------------+
//| calcTma()                                                        |
//+------------------------------------------------------------------+
double calcTma(string symbol,int tf,int shift)
  {
   double dblSum  = iClose(symbol, tf, shift) * 21;
   double dblSumw = 21;
   int jnx,knx;

   for(jnx=1,knx=20; jnx<=20; jnx++,knx--)
     {
      dblSum  += ( knx * iClose(symbol, tf, shift + jnx) );
      dblSumw += knx;

      if(jnx<=shift)
        {
         dblSum  += ( knx * iClose(symbol, tf, shift - jnx) );
         dblSumw += knx;
        }
     }

   return( dblSum / dblSumw );

  }
//+------------------------------------------------------------------+
You can call them in that way:

Code: Select all

TMASlopeVal[0]= GetSlope(Symbol(),TMASlopeTF,0);
   TMASlopeVal[1]= GetSlope(Symbol(),TMASlopeTF,m_bar+1);
   TMASlopeVal[2]= GetSlope(Symbol(),TMASlopeTF,m_bar+2);
Cheers :)

Tommaso
Author:  traderduke [ Mon Jul 18, 2016 12:49 pm ]
Post subject:  libCSS - .lmx Suffix Removal Code

Tommaso
do you have a up to date TMASlope indicator with your code?
Ray
Author:  milanese [ Mon Jul 18, 2016 12:56 pm ]
Post subject:  libCSS - .lmx Suffix Removal Code

traderduke » Mon Jul 18, 2016 12:49 pm wrote:Tommaso
do you have a up to date TMASlope indicator with your code?
Ray
Hi Ray you can try the attached one, it is actualized for the latest builds..

Cheers :)

Tommaso
All times are UTC Page 2 of 2